Skip to content

Commit

Permalink
feat: require eslint 8.40.0
Browse files Browse the repository at this point in the history
  • Loading branch information
freaktechnik committed May 6, 2023
1 parent bad3829 commit b087585
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -17,15 +17,15 @@
"@typescript-eslint/parser": "^5.59.1",
"ava": "^5.2.0",
"eclint": "^2.8.1",
"eslint": "^8.39.0",
"eslint": "^8.40.0",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-plugin-eslint-plugin": "^5.0.8",
"eslint-plugin-optimize-regex": "^1.2.1",
"nyc": "^15.1.0",
"typescript": "^5.0.4"
},
"peerDependencies": {
"eslint": ">=3.0.0"
"eslint": ">=8.40.0"
},
"keywords": [
"eslint",
Expand All @@ -38,7 +38,7 @@
]
},
"engines": {
"node": ">= 6.8.0"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion rules/from-map.js
Expand Up @@ -52,7 +52,7 @@ module.exports = {
const HAS_CBK = 2,
PARAM_SEPARATOR = ", ",
FUNCTION_END = ")",
sourceCode = context.getSourceCode();
{ sourceCode } = context;

// Merge the from and map callbacks
if(parent.arguments.length >= HAS_CBK) {
Expand Down
2 changes: 1 addition & 1 deletion rules/prefer-array-from.js
Expand Up @@ -30,7 +30,7 @@ module.exports = {
node,
messageId: 'preferArrayFrom',
fix(fixer) {
const sourceCode = context.getSourceCode();
const { sourceCode } = context;
return fixer.replaceText(node, `Array.from(${sourceCode.getText(firstElement(node.elements).argument)})`);
}
});
Expand Down
4 changes: 2 additions & 2 deletions rules/prefer-flat.js
Expand Up @@ -33,7 +33,7 @@ module.exports = {
node,
messageId: "preferFlat",
fix(fixer) {
const sourceCode = context.getSourceCode();
const { sourceCode } = context;
//TODO could be an iterable, so Array.from may be needed.
return fixer.replaceText(node, `${sourceCode.getText(firstElement(node.arguments).argument)}.flat()`);
}
Expand All @@ -52,7 +52,7 @@ module.exports = {
node: node.parent.parent,
messageId: "preferFlat",
fix(fixer) {
const sourceCode = context.getSourceCode();
const { sourceCode } = context;
return fixer.replaceText(node.parent.parent, `${sourceCode.getText(node.parent.parent.callee.object)}.flat()`);
}
});
Expand Down

0 comments on commit b087585

Please sign in to comment.