Skip to content

Commit

Permalink
tools: add meta.fixable to fixable lint rules
Browse files Browse the repository at this point in the history
This commit adds the meta.fixable property to all fixable ESLint
rules. This is required as of ESLint 7.6.0.

PR-URL: nodejs#34589
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
cjihrig committed Aug 3, 2020
1 parent 6e65f26 commit ee0b44f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/eslint-rules/async-iife-no-unused-result.js
Expand Up @@ -12,6 +12,9 @@ const message =
'(e.g. with `.then(common.mustCall())`)';

module.exports = {
meta: {
fixable: 'code'
},
create: function(context) {
let hasCommonModule = false;
return {
Expand Down
4 changes: 4 additions & 0 deletions tools/eslint-rules/crypto-check.js
Expand Up @@ -120,3 +120,7 @@ module.exports = function(context) {
'Program:exit': () => reportIfMissingCheck()
};
};

module.exports.meta = {
fixable: 'code'
};
4 changes: 4 additions & 0 deletions tools/eslint-rules/eslint-check.js
Expand Up @@ -58,3 +58,7 @@ module.exports = function(context) {
'Program:exit': () => reportIfMissing(context)
};
};

module.exports.meta = {
fixable: 'code'
};
4 changes: 4 additions & 0 deletions tools/eslint-rules/inspector-check.js
Expand Up @@ -59,3 +59,7 @@ module.exports = function(context) {
'Program:exit': () => reportIfMissing(context)
};
};

module.exports.meta = {
fixable: 'code'
};
4 changes: 4 additions & 0 deletions tools/eslint-rules/lowercase-name-for-primitive.js
Expand Up @@ -53,3 +53,7 @@ module.exports = function(context) {
[astSelector]: (node) => checkNamesArgument(node)
};
};

module.exports.meta = {
fixable: 'code'
};
4 changes: 4 additions & 0 deletions tools/eslint-rules/non-ascii-character.js
Expand Up @@ -59,3 +59,7 @@ module.exports = (context) => {
Program: (node) => reportIfError(node, context.getSourceCode())
};
};

module.exports.meta = {
fixable: 'code'
};
3 changes: 3 additions & 0 deletions tools/eslint-rules/prefer-assert-iferror.js
Expand Up @@ -8,6 +8,9 @@
const utils = require('./rules-utils.js');

module.exports = {
meta: {
fixable: 'code'
},
create(context) {
const sourceCode = context.getSourceCode();
let assertImported = false;
Expand Down
4 changes: 4 additions & 0 deletions tools/eslint-rules/prefer-assert-methods.js
Expand Up @@ -42,3 +42,7 @@ module.exports = function(context) {
}
};
};

module.exports.meta = {
fixable: 'code'
};

0 comments on commit ee0b44f

Please sign in to comment.