Skip to content

Commit 9c03a78

Browse files
authored
Update eslint-plugin-eslint-plugin (#1563)
1 parent d4ce499 commit 9c03a78

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"enquirer": "2.3.6",
6666
"eslint": "^8.0.0",
6767
"eslint-ava-rule-tester": "^4.0.0",
68-
"eslint-plugin-eslint-plugin": "^4.0.1",
68+
"eslint-plugin-eslint-plugin": "^4.0.2",
6969
"eslint-remote-tester": "^2.0.1",
7070
"eslint-remote-tester-repositories": "^0.0.3",
7171
"execa": "^5.1.1",
@@ -134,8 +134,7 @@
134134
],
135135
"eslint-plugin/require-meta-docs-url": "off",
136136
"eslint-plugin/require-meta-has-suggestions": "off",
137-
"eslint-plugin/require-meta-schema": "off",
138-
"eslint-plugin/no-deprecated-context-methods": "off"
137+
"eslint-plugin/require-meta-schema": "off"
139138
}
140139
}
141140
]

rules/no-unused-properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const create = context => {
9090
return property.key.value;
9191
}
9292

93-
return context.getSource(property.key);
93+
return context.getSourceCode().getText(property.key);
9494
};
9595

9696
const checkProperty = (property, references, path) => {

rules/no-useless-undefined.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const create = context => {
172172
start = previousArgument.range[1];
173173
} else {
174174
// If all arguments removed, and there is trailing comma, we need remove it.
175-
const tokenAfter = context.getTokenAfter(lastUndefined);
175+
const tokenAfter = sourceCode.getTokenAfter(lastUndefined);
176176
if (isCommaToken(tokenAfter)) {
177177
end = tokenAfter.range[1];
178178
}

rules/prefer-optional-catch-binding.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ const create = context => ({
3030
messageId: type === 'Identifier' ? MESSAGE_ID_WITH_NAME : MESSAGE_ID_WITHOUT_NAME,
3131
data: {name},
3232
* fix(fixer) {
33-
const tokenBefore = context.getTokenBefore(node);
33+
const sourceCode = context.getSourceCode();
34+
const tokenBefore = sourceCode.getTokenBefore(node);
3435
assertToken(tokenBefore, {
3536
test: isOpeningParenToken,
3637
expected: '(',
3738
ruleId: 'prefer-optional-catch-binding',
3839
});
3940

40-
const tokenAfter = context.getTokenAfter(node);
41+
const tokenAfter = sourceCode.getTokenAfter(node);
4142
assertToken(tokenAfter, {
4243
test: isClosingParenToken,
4344
expected: ')',
@@ -50,7 +51,7 @@ const create = context => ({
5051

5152
const [, endOfClosingParenthesis] = tokenAfter.range;
5253
const [startOfCatchClauseBody] = parent.body.range;
53-
const text = context.getSourceCode().text.slice(endOfClosingParenthesis, startOfCatchClauseBody);
54+
const text = sourceCode.text.slice(endOfClosingParenthesis, startOfCatchClauseBody);
5455
const leadingSpacesLength = text.length - text.trimStart().length;
5556
if (leadingSpacesLength !== 0) {
5657
yield fixer.removeRange([endOfClosingParenthesis, endOfClosingParenthesis + leadingSpacesLength]);

0 commit comments

Comments
 (0)