From 155f706ad05b291f5ebf6321d77df92a9233db76 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 1 Aug 2020 14:22:51 -0400 Subject: [PATCH] tools: add meta.fixable to fixable lint rules This commit adds the meta.fixable property to all fixable ESLint rules. This is required as of ESLint 7.6.0. PR-URL: https://github.com/nodejs/node/pull/34589 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca --- tools/eslint-rules/crypto-check.js | 4 ++++ tools/eslint-rules/eslint-check.js | 4 ++++ tools/eslint-rules/inspector-check.js | 4 ++++ tools/eslint-rules/lowercase-name-for-primitive.js | 4 ++++ tools/eslint-rules/non-ascii-character.js | 4 ++++ tools/eslint-rules/prefer-assert-iferror.js | 3 +++ tools/eslint-rules/prefer-assert-methods.js | 4 ++++ 7 files changed, 27 insertions(+) diff --git a/tools/eslint-rules/crypto-check.js b/tools/eslint-rules/crypto-check.js index 93a0c1ec865f38..4704b550a360e9 100644 --- a/tools/eslint-rules/crypto-check.js +++ b/tools/eslint-rules/crypto-check.js @@ -120,3 +120,7 @@ module.exports = function(context) { 'Program:exit': () => reportIfMissingCheck() }; }; + +module.exports.meta = { + fixable: 'code' +}; diff --git a/tools/eslint-rules/eslint-check.js b/tools/eslint-rules/eslint-check.js index fcfd7f3f9000fe..0edf7d2899cbf9 100644 --- a/tools/eslint-rules/eslint-check.js +++ b/tools/eslint-rules/eslint-check.js @@ -58,3 +58,7 @@ module.exports = function(context) { 'Program:exit': () => reportIfMissing(context) }; }; + +module.exports.meta = { + fixable: 'code' +}; diff --git a/tools/eslint-rules/inspector-check.js b/tools/eslint-rules/inspector-check.js index a56bb9be4c4ed4..bb5dc27bff5cef 100644 --- a/tools/eslint-rules/inspector-check.js +++ b/tools/eslint-rules/inspector-check.js @@ -59,3 +59,7 @@ module.exports = function(context) { 'Program:exit': () => reportIfMissing(context) }; }; + +module.exports.meta = { + fixable: 'code' +}; diff --git a/tools/eslint-rules/lowercase-name-for-primitive.js b/tools/eslint-rules/lowercase-name-for-primitive.js index cfe17c06c12535..274dcd1c9dce6e 100644 --- a/tools/eslint-rules/lowercase-name-for-primitive.js +++ b/tools/eslint-rules/lowercase-name-for-primitive.js @@ -53,3 +53,7 @@ module.exports = function(context) { [astSelector]: (node) => checkNamesArgument(node) }; }; + +module.exports.meta = { + fixable: 'code' +}; diff --git a/tools/eslint-rules/non-ascii-character.js b/tools/eslint-rules/non-ascii-character.js index e67aac7cd91e82..6588125d33d201 100644 --- a/tools/eslint-rules/non-ascii-character.js +++ b/tools/eslint-rules/non-ascii-character.js @@ -59,3 +59,7 @@ module.exports = (context) => { Program: (node) => reportIfError(node, context.getSourceCode()) }; }; + +module.exports.meta = { + fixable: 'code' +}; diff --git a/tools/eslint-rules/prefer-assert-iferror.js b/tools/eslint-rules/prefer-assert-iferror.js index 2129600e2d4eea..63430d70af93e4 100644 --- a/tools/eslint-rules/prefer-assert-iferror.js +++ b/tools/eslint-rules/prefer-assert-iferror.js @@ -8,6 +8,9 @@ const utils = require('./rules-utils.js'); module.exports = { + meta: { + fixable: 'code' + }, create(context) { const sourceCode = context.getSourceCode(); let assertImported = false; diff --git a/tools/eslint-rules/prefer-assert-methods.js b/tools/eslint-rules/prefer-assert-methods.js index 2917d40de40810..400a5d54759c86 100644 --- a/tools/eslint-rules/prefer-assert-methods.js +++ b/tools/eslint-rules/prefer-assert-methods.js @@ -42,3 +42,7 @@ module.exports = function(context) { } }; }; + +module.exports.meta = { + fixable: 'code' +};