Skip to content

Commit 6e0c30f

Browse files
committed
[refactor] Delete Spaces and fix lint
1 parent 98d8159 commit 6e0c30f

31 files changed

+36
-38
lines changed

lib/rules/button-has-type.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const messages = {
2424
func: 'JSX props should not use functions',
2525
};
2626

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

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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const messages = {
1818
useCallback: 'Use callback in setState when referencing the previous state.',
1919
};
2020

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

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

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

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

lib/rules/no-children-prop.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ function tagNameHasDot(node) {
483483
);
484484
}
485485

486+
// eslint-disable-next-line valid-jsdoc
486487
/**
487488
* Get the standard name of the attribute.
488489
* @param {String} name - Name of the attribute.
@@ -512,7 +513,7 @@ const messages = {
512513
dataLowercaseRequired: 'React does not recognize data-* props with uppercase characters on a DOM element. Found \'{{name}}\', use \'{{lowerCaseName}}\' instead',
513514
};
514515

515-
/** @type { import('eslint').Rule.RuleModule } */
516+
/** @type {import('eslint').Rule.RuleModule} */
516517
module.exports = {
517518
meta: {
518519
docs: {

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy