|
@@ -206,6 +206,29 @@ module.exports = {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ 'todo-comments': {
|
|
|
+ meta: {
|
|
|
+ type: 'suggestion',
|
|
|
+ docs: {
|
|
|
+ description: 'TODO tracking',
|
|
|
+ category: 'Other',
|
|
|
+ recommended: true
|
|
|
+ },
|
|
|
+ schema: []
|
|
|
+ },
|
|
|
+ create: function (context) {
|
|
|
+ const sourceCode = context.getSourceCode();
|
|
|
+ const comments = sourceCode.getAllComments();
|
|
|
+ for (const comment of comments) {
|
|
|
+ if (comment.value.toLowerCase().includes('todo')) {
|
|
|
+ context.report({
|
|
|
+ node: comment,
|
|
|
+ message: comment.value
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -228,8 +251,9 @@ module.exports = {
|
|
|
* 'space-before-function-paren': ['error', 'never'],
|
|
|
* 'semi': ['error', 'always'],
|
|
|
* 'space-infix-ops': ['error'],
|
|
|
- * "indent": ['error', 'tab'],
|
|
|
+ * 'indent': ['error', 'tab'],
|
|
|
* 'no-console': ['warn'],
|
|
|
+ * 'z8/todo-comments': ['warn']
|
|
|
* },
|
|
|
* 'parserOptions': {
|
|
|
* 'ecmaVersion': 2022
|