Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-04-26 16:51:56 +0300
committerMichaƫl Zasso <targos@protonmail.com>2021-04-29 14:45:42 +0300
commit6350d35b3c6ee47ecc210a3bd071a3b4c45fe33b (patch)
tree7428660f1fb99671f102be56d0ef0334081208f7 /tools
parent620ee42ab419c57e81c188adcea48087030429a4 (diff)
tools: remove fixer for non-ascii-character ESLint custom rule
The fixer for non-ascii-character does not typidally do the right thing. It removes the entire node, not the offending character. I discovered this when it removed the entire contents of a file and I wasn't sure which auto-fix rule was doing it. This commit adds a minimal test for the rule. The tests require that auto-fix results be supplied, so if someone wants to re-add auto-fixing to the rule, we'll have tests that it does the right thing. PR-URL: https://github.com/nodejs/node/pull/38413 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/eslint-rules/non-ascii-character.js10
1 files changed, 0 insertions, 10 deletions
diff --git a/tools/eslint-rules/non-ascii-character.js b/tools/eslint-rules/non-ascii-character.js
index 6588125d33d..f9ee24273fd 100644
--- a/tools/eslint-rules/non-ascii-character.js
+++ b/tools/eslint-rules/non-ascii-character.js
@@ -46,12 +46,6 @@ module.exports = (context) => {
node,
message,
loc: sourceCode.getLocFromIndex(offendingCharacterPosition),
- fix: (fixer) => {
- return fixer.replaceText(
- node,
- suggestion ? `${suggestion}` : ''
- );
- }
});
};
@@ -59,7 +53,3 @@ module.exports = (context) => {
Program: (node) => reportIfError(node, context.getSourceCode())
};
};
-
-module.exports.meta = {
- fixable: 'code'
-};