Skip to content

Commit eb44ba7

Browse files
committed
1 parent 0ea8000 commit eb44ba7

7 files changed

+23
-24
lines changed

lib/rules/jsx-closing-bracket-location.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ module.exports = {
196196
*/
197197
function getTokensLocations(node) {
198198
const sourceCode = context.getSourceCode();
199-
// @ts-ignore
199+
// @ts-expect-error
200200
const opening = sourceCode.getFirstToken(node).loc.start;
201-
// @ts-ignore
201+
// @ts-expect-error
202202
const closing = sourceCode.getLastTokens(node, node.selfClosing ? 2 : 1)[0].loc.start;
203203
const tag = sourceCode.getFirstToken(node.name).loc.start;
204204
let lastProp;

lib/rules/jsx-equals-spacing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ module.exports = {
6262

6363
const sourceCode = context.getSourceCode();
6464
const equalToken = sourceCode.getTokenAfter(attrNode.name);
65-
// @ts-ignore
65+
// @ts-expect-error
6666
const spacedBefore = sourceCode.isSpaceBetweenTokens(attrNode.name, equalToken);
67-
// @ts-ignore
67+
// @ts-expect-error
6868
const spacedAfter = sourceCode.isSpaceBetweenTokens(equalToken, attrNode.value);
6969

7070
if (config === 'never') {

lib/rules/jsx-indent-props.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ module.exports = {
141141
* @return {Number} Indent
142142
*/
143143
function getNodeIndent(node) {
144-
// @ts-ignore
144+
// @ts-expect-error
145145
let src = context.getSourceCode().getText(node, node.loc.start.column + extraColumnStart);
146146
const lines = src.split('\n');
147147
src = lines[0];

lib/rules/no-access-state-in-setstate.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module.exports = {
108108
&& isClassComponent()
109109
) {
110110
let current = node;
111-
// @ts-ignore
111+
// @ts-expect-error
112112
while (current.type !== 'Program') {
113113
// Reporting if this.state is directly within this.setState
114114
if (isFirstArgumentInSetStateCall(current, node)) {
@@ -119,37 +119,37 @@ module.exports = {
119119
}
120120

121121
// Storing all functions and methods that contains this.state
122-
// @ts-ignore
122+
// @ts-expect-error
123123
if (current.type === 'MethodDefinition') {
124124
methods.push({
125-
// @ts-ignore
125+
// @ts-expect-error
126126
methodName: current.key.name,
127127
node,
128128
});
129129
break;
130-
// @ts-ignore
130+
// @ts-expect-error
131131
} else if (current.type === 'FunctionExpression' && current.parent.key) {
132132
methods.push({
133-
// @ts-ignore
133+
// @ts-expect-error
134134
methodName: current.parent.key.name,
135135
node,
136136
});
137137
break;
138138
}
139139

140140
// Storing all variables containing this.state
141-
// @ts-ignore
141+
// @ts-expect-error
142142
if (current.type === 'VariableDeclarator') {
143143
vars.push({
144144
node,
145145
scope: context.getScope(),
146-
// @ts-ignore
146+
// @ts-expect-error
147147
variableName: current.id.name,
148148
});
149149
break;
150150
}
151151

152-
// @ts-ignore
152+
// @ts-expect-error
153153
current = current.parent;
154154
}
155155
}
@@ -159,16 +159,16 @@ module.exports = {
159159
// Checks if the identifier is a variable within an object
160160
let current = node;
161161
while (current.parent.type === 'BinaryExpression') {
162-
// @ts-ignore
162+
// @ts-expect-error
163163
current = current.parent;
164164
}
165165
if (
166-
// @ts-ignore
166+
// @ts-expect-error
167167
current.parent.value === current
168-
// @ts-ignore
168+
// @ts-expect-error
169169
|| current.parent.object === current
170170
) {
171-
// @ts-ignore
171+
// @ts-expect-error
172172
while (current.type !== 'Program') {
173173
if (isFirstArgumentInSetStateCall(current, node)) {
174174
vars
@@ -179,7 +179,7 @@ module.exports = {
179179
});
180180
});
181181
}
182-
// @ts-ignore
182+
// @ts-expect-error
183183
current = current.parent;
184184
}
185185
}

lib/rules/no-danger-with-children.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module.exports = {
129129
let props = node.arguments[1];
130130

131131
if (props.type === 'Identifier') {
132-
// @ts-ignore
132+
// @ts-expect-error
133133
const variable = variableUtil.variablesInScope(context).find((item) => item.name === props.name);
134134
if (variable && variable.defs.length && variable.defs[0].node.init) {
135135
props = variable.defs[0].node.init;

lib/rules/no-deprecated.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ module.exports = {
236236

237237
VariableDeclarator(node) {
238238
const reactModuleName = getReactModuleName(node);
239-
// @ts-ignore
239+
// @ts-expect-error
240240
const isRequire = node.init && node.init.callee && node.init.callee.name === 'require';
241241
const isReactRequire = node.init
242-
// @ts-ignore
242+
// @ts-expect-error
243243
&& node.init.arguments
244-
// @ts-ignore
244+
// @ts-expect-error
245245
&& node.init.arguments.length
246-
// @ts-ignore
246+
// @ts-expect-error
247247
&& typeof MODULES[node.init.arguments[0].value] !== 'undefined';
248248
const isDestructuring = node.id && node.id.type === 'ObjectPattern';
249249

lib/rules/no-unused-state.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ module.exports = {
111111

112112
let scope = context.getScope();
113113
while (scope) {
114-
// @ts-ignore
115114
const parent = scope.block && scope.block.parent;
116115
if (
117116
parent

0 commit comments

Comments
 (0)