Skip to content

Commit fbaf8e3

Browse files
committed
[refactor] Delete Spaces and fix lint
1 parent 49fda12 commit fbaf8e3

31 files changed

+35
-38
lines changed

lib/rules/button-has-type.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const messages = {
2828
forbiddenValue: '"{{value}}" is an invalid value for button type attribute',
2929
};
3030

31-
/** @type { import('eslint').Rule.RuleModule } */
31+
/** @type {import('eslint').Rule.RuleModule} */
3232
module.exports = {
3333
meta: {
3434
docs: {

lib/rules/checked-requires-onchange-or-readonly.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function extractTargetProps(properties, keyName) {
4141
);
4242
}
4343

44-
/** @type { import('eslint').Rule.RuleModule } */
44+
/** @type {import('eslint').Rule.RuleModule} */
4545
module.exports = {
4646
meta: {
4747
docs: {

lib/rules/forbid-elements.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const messages = {
2020
forbiddenElement_message: '<{{element}}> is forbidden, {{message}}',
2121
};
2222

23-
/** @type { import('eslint').Rule.RuleModule } */
23+
/** @type {import('eslint').Rule.RuleModule} */
2424
module.exports = {
2525
meta: {
2626
docs: {

lib/rules/forbid-foreign-prop-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const messages = {
1313
forbiddenPropType: 'Using propTypes from another component is not safe because they may be removed in production builds',
1414
};
1515

16-
/** @type { import('eslint').Rule.RuleModule } */
16+
/** @type {import('eslint').Rule.RuleModule} */
1717
module.exports = {
1818
meta: {
1919
docs: {

lib/rules/forbid-prop-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const messages = {
2626
forbiddenPropType: 'Prop type "{{target}}" is forbidden',
2727
};
2828

29-
/** @type { import('eslint').Rule.RuleModule } */
29+
/** @type {import('eslint').Rule.RuleModule} */
3030
module.exports = {
3131
meta: {
3232
docs: {

lib/rules/hook-use-state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const messages = {
2626
suggestMemo: 'Replace useState call with useMemo',
2727
};
2828

29-
/** @type { import('eslint').Rule.RuleModule } */
29+
/** @type {import('eslint').Rule.RuleModule} */
3030
module.exports = {
3131
meta: {
3232
docs: {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const messages = {
2020
bracketLocation: 'The closing bracket must be {{location}}{{details}}',
2121
};
2222

23-
/** @type { import('eslint').Rule.RuleModule } */
23+
/** @type {import('eslint').Rule.RuleModule} */
2424
module.exports = {
2525
meta: {
2626
docs: {

lib/rules/jsx-curly-spacing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const messages = {
3535
spaceNeededBefore: 'A space is required before \'{{token}}\'',
3636
};
3737

38-
/** @type { import('eslint').Rule.RuleModule } */
38+
/** @type {import('eslint').Rule.RuleModule} */
3939
module.exports = {
4040
meta: {
4141
docs: {

lib/rules/jsx-equals-spacing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const messages = {
2020
needSpaceAfter: 'A space is required after \'=\'',
2121
};
2222

23-
/** @type { import('eslint').Rule.RuleModule } */
23+
/** @type {import('eslint').Rule.RuleModule} */
2424
module.exports = {
2525
meta: {
2626
docs: {

lib/rules/jsx-fragments.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const messages = {
2828
preferFragment: 'Prefer fragment shorthand over {{react}}.{{fragment}}',
2929
};
3030

31-
/** @type { import('eslint').Rule.RuleModule } */
31+
/** @type {import('eslint').Rule.RuleModule} */
3232
module.exports = {
3333
meta: {
3434
docs: {
@@ -171,7 +171,7 @@ module.exports = {
171171
ImportDeclaration(node) {
172172
if (node.source && node.source.value === 'react') {
173173
node.specifiers.forEach((spec) => {
174-
if (spec.type === "ImportSpecifier" && spec.imported && spec.imported.name === fragmentPragma) {
174+
if (spec.type === 'ImportSpecifier' && spec.imported && spec.imported.name === fragmentPragma) {
175175
if (spec.local) {
176176
fragmentNames.add(spec.local.name);
177177
}

lib/rules/jsx-indent-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const messages = {
4545
wrongIndent: 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.',
4646
};
4747

48-
/** @type { import('eslint').Rule.RuleModule } */
48+
/** @type {import('eslint').Rule.RuleModule} */
4949
module.exports = {
5050
meta: {
5151
docs: {

lib/rules/jsx-indent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const messages = {
5050
wrongIndent: 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.',
5151
};
5252

53-
/** @type { import('eslint').Rule.RuleModule } */
53+
/** @type {import('eslint').Rule.RuleModule} */
5454
module.exports = {
5555
meta: {
5656
docs: {

lib/rules/jsx-no-bind.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const messages = {
2525
func: 'JSX props should not use functions',
2626
};
2727

28-
/** @type { import('eslint').Rule.RuleModule } */
28+
/** @type {import('eslint').Rule.RuleModule} */
2929
module.exports = {
3030
meta: {
3131
docs: {

lib/rules/jsx-no-leaked-render.js

-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNod
109109
throw new TypeError('Invalid value for "validStrategies" option');
110110
}
111111

112-
/**
113-
* @type {import('eslint').Rule.RuleModule}
114-
*/
115112
/** @type {import('eslint').Rule.RuleModule} */
116113
module.exports = {
117114
meta: {

lib/rules/jsx-sort-default-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const messages = {
2525
propsNotSorted: 'Default prop types declarations should be sorted alphabetically',
2626
};
2727

28-
/** @type { import('eslint').Rule.RuleModule } */
28+
/** @type {import('eslint').Rule.RuleModule} */
2929
module.exports = {
3030
meta: {
3131
deprecated: true,

lib/rules/jsx-space-before-closing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const messages = {
2323
needSpaceBeforeClose: 'A space is required before closing bracket',
2424
};
2525

26-
/** @type { import('eslint').Rule.RuleModule } */
26+
/** @type {import('eslint').Rule.RuleModule} */
2727
module.exports = {
2828
meta: {
2929
deprecated: true,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const messages = {
1919
useCallback: 'Use callback in setState when referencing the previous state.',
2020
};
2121

22-
/** @type { import('eslint').Rule.RuleModule } */
22+
/** @type {import('eslint').Rule.RuleModule} */
2323
module.exports = {
2424
meta: {
2525
docs: {
@@ -77,7 +77,7 @@ module.exports = {
7777
if (node.callee.type === 'Identifier' && node.callee.name === method.methodName) {
7878
let current = node.parent;
7979
while (current.type !== 'Program') {
80-
if (current.type === 'MethodDefinition' && current.key.type === 'PrivateIdentifier') {
80+
if (current.type === 'MethodDefinition' && current.key.type === 'Identifier') {
8181
methods.push({
8282
methodName: current.key.name,
8383
node: method.node,

lib/rules/no-adjacent-inline-elements.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const messages = {
7777
inlineElement: 'Child elements which render as inline HTML elements should be separated by a space or wrapped in block level elements.',
7878
};
7979

80-
/** @type { import('eslint').Rule.RuleModule } */
80+
/** @type {import('eslint').Rule.RuleModule} */
8181
module.exports = {
8282
meta: {
8383
docs: {
@@ -119,8 +119,8 @@ module.exports = {
119119
if (node.arguments.length < 2 || !node.arguments[2]) {
120120
return;
121121
}
122-
if(node.arguments[2].type !== "ArrayExpression") {
123-
return
122+
if (node.arguments[2].type !== 'ArrayExpression') {
123+
return;
124124
}
125125
const children = node.arguments[2].elements;
126126
validate(node, children);

lib/rules/no-children-prop.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const messages = {
3737
passFunctionAsArgs: 'Do not pass a function as an additional argument to React.createElement. Instead, pass it as a prop.',
3838
};
3939

40-
/** @type { import('eslint').Rule.RuleModule } */
40+
/** @type {import('eslint').Rule.RuleModule} */
4141
module.exports = {
4242
meta: {
4343
docs: {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const messages = {
1717
dangerWithChildren: 'Only set one of `children` or `props.dangerouslySetInnerHTML`',
1818
};
1919

20-
/** @type { import('eslint').Rule.RuleModule } */
20+
/** @type {import('eslint').Rule.RuleModule} */
2121
module.exports = {
2222
meta: {
2323
docs: {

lib/rules/no-deprecated.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const messages = {
115115
deprecated: '{{oldMethod}} is deprecated since React {{version}}{{newMethod}}{{refs}}',
116116
};
117117

118-
/** @type { import('eslint').Rule.RuleModule } */
118+
/** @type {import('eslint').Rule.RuleModule} */
119119
module.exports = {
120120
meta: {
121121
docs: {

lib/rules/no-find-dom-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const messages = {
1616
noFindDOMNode: 'Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode',
1717
};
1818

19-
/** @type { import('eslint').Rule.RuleModule } */
19+
/** @type {import('eslint').Rule.RuleModule} */
2020
module.exports = {
2121
meta: {
2222
docs: {

lib/rules/no-invalid-html-attribute.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ function checkCreateProps(context, node, attribute) {
589589
}
590590
}
591591

592-
/** @type { import('eslint').Rule.RuleModule } */
592+
/** @type {import('eslint').Rule.RuleModule} */
593593
module.exports = {
594594
meta: {
595595
docs: {

lib/rules/no-is-mounted.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const messages = {
1717
noIsMounted: 'Do not use isMounted',
1818
};
1919

20-
/** @type { import('eslint').Rule.RuleModule } */
20+
/** @type {import('eslint').Rule.RuleModule} */
2121
module.exports = {
2222
meta: {
2323
docs: {
@@ -41,7 +41,7 @@ module.exports = {
4141
}
4242
if (
4343
callee.object.type !== 'ThisExpression'
44-
|| (callee.property.type === 'PrivateIdentifier' || callee.property.type === 'Identifier')
44+
&& callee.property.type === 'Identifier'
4545
&& callee.property.name !== 'isMounted') {
4646
return;
4747
}

lib/rules/no-render-return-value.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const messages = {
1717
noReturnValue: 'Do not depend on the return value from {{node}}.render',
1818
};
1919

20-
/** @type { import('eslint').Rule.RuleModule } */
20+
/** @type {import('eslint').Rule.RuleModule} */
2121
module.exports = {
2222
meta: {
2323
docs: {

lib/rules/no-unknown-property.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ const messages = {
517517
dataLowercaseRequired: 'React does not recognize data-* props with uppercase characters on a DOM element. Found \'{{name}}\', use \'{{lowerCaseName}}\' instead',
518518
};
519519

520-
/** @type { import('eslint').Rule.RuleModule } */
520+
/** @type {import('eslint').Rule.RuleModule} */
521521
module.exports = {
522522
meta: {
523523
docs: {

lib/rules/no-unused-class-component-methods.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const messages = {
9898
unusedWithClass: 'Unused method or property "{{name}}" of class "{{className}}"',
9999
};
100100

101-
/** @type { import('eslint').Rule.RuleModule } */
101+
/** @type {import('eslint').Rule.RuleModule} */
102102
module.exports = {
103103
meta: {
104104
docs: {

lib/rules/no-unused-state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const messages = {
7878
unusedStateField: 'Unused state field: \'{{name}}\'',
7979
};
8080

81-
/** @type { import('eslint').Rule.RuleModule } */
81+
/** @type {import('eslint').Rule.RuleModule} */
8282
module.exports = {
8383
meta: {
8484
docs: {

lib/rules/sort-default-props.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const messages = {
2222
propsNotSorted: 'Default prop types declarations should be sorted alphabetically',
2323
};
2424

25-
/** @type { import('eslint').Rule.RuleModule } */
25+
/** @type {import('eslint').Rule.RuleModule} */
2626
module.exports = {
2727
meta: {
2828
docs: {

lib/rules/style-prop-object.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const messages = {
1818
stylePropNotObject: 'Style prop value must be an object',
1919
};
2020

21-
/** @type { import('eslint').Rule.RuleModule } */
21+
/** @type {import('eslint').Rule.RuleModule} */
2222
module.exports = {
2323
meta: {
2424
docs: {

lib/rules/void-dom-elements-no-children.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function isVoidDOMElement(elementName) {
4747

4848
const noChildrenInVoidEl = 'Void DOM element <{{element}} /> cannot receive children.';
4949

50-
/** @type { import('eslint').Rule.RuleModule } */
50+
/** @type {import('eslint').Rule.RuleModule} */
5151
module.exports = {
5252
meta: {
5353
docs: {

0 commit comments

Comments
 (0)