diff --git a/index.js b/index.js index 1c5a7b3..8ae501d 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ 'use strict'; module.exports = { - extends: ["./eslint-config-react/index.js"], + plugins: ['eslint-plugin-todo-comments'], + extends: ['./eslint-config-react/index.js'], rules: { /* section1 : 可能存在的错误 */ // error; for循转方向出错 @@ -379,6 +380,14 @@ module.exports = { // 'template-curly-spacing': [2, 'never'], // error; yield* 后面必须加空格 'yield-star-spacing': [2, 'after'], - "react/prop-types": 0 + "react/prop-types": 0, + // 限制TODO个数 + 'todo-comments/todo-count-limit': [ + 'error', + { + terms: ['todo',"FIXME"], + location: 'start' + } + ] } }; diff --git a/package.json b/package.json index b447136..1441614 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-ivweb", - "version": "0.1.5", + "version": "0.1.6", "description": "腾讯IVWEB团队eslint配置检测规范", "license": "Apache-2.0", "repository": "iv-web/eslint-config-ivweb", @@ -29,7 +29,8 @@ "code style" ], "dependencies": { - "eslint-plugin-react": "^7.7.0" + "eslint-plugin-react": "^7.7.0", + "eslint-plugin-todo-comments": "^0.1.0" }, "devDependencies": { "babel-eslint": "^8.2.3",