Skip to content

Commit fa64144

Browse files
committed
[eslint] change comma-dangle to always-multiline
1 parent 8383a09 commit fa64144

File tree

216 files changed

+10709
-10709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+10709
-10709
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceType": "script",
1515
},
1616
"rules": {
17-
"comma-dangle": [2, "never"],
17+
"comma-dangle": [2, "always-multiline"],
1818
"object-curly-spacing": [2, "never"],
1919
"object-shorthand": [2, "always"],
2020
"array-bracket-spacing": [2, "never"],

index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const allRules = {
9898
'state-in-constructor': require('./lib/rules/state-in-constructor'),
9999
'static-property-placement': require('./lib/rules/static-property-placement'),
100100
'style-prop-object': require('./lib/rules/style-prop-object'),
101-
'void-dom-elements-no-children': require('./lib/rules/void-dom-elements-no-children')
101+
'void-dom-elements-no-children': require('./lib/rules/void-dom-elements-no-children'),
102102
};
103103
/* eslint-enable */
104104

@@ -121,12 +121,12 @@ module.exports = {
121121
configs: {
122122
recommended: {
123123
plugins: [
124-
'react'
124+
'react',
125125
],
126126
parserOptions: {
127127
ecmaFeatures: {
128-
jsx: true
129-
}
128+
jsx: true,
129+
},
130130
},
131131
rules: {
132132
'react/display-name': 2,
@@ -150,34 +150,34 @@ module.exports = {
150150
'react/no-unsafe': 0,
151151
'react/prop-types': 2,
152152
'react/react-in-jsx-scope': 2,
153-
'react/require-render-return': 2
154-
}
153+
'react/require-render-return': 2,
154+
},
155155
},
156156
all: {
157157
plugins: [
158-
'react'
158+
'react',
159159
],
160160
parserOptions: {
161161
ecmaFeatures: {
162-
jsx: true
163-
}
162+
jsx: true,
163+
},
164164
},
165-
rules: activeRulesConfig
165+
rules: activeRulesConfig,
166166
},
167167
'jsx-runtime': {
168168
plugins: [
169-
'react'
169+
'react',
170170
],
171171
parserOptions: {
172172
ecmaFeatures: {
173-
jsx: true
173+
jsx: true,
174174
},
175-
jsxPragma: null // for @typescript/eslint-parser
175+
jsxPragma: null, // for @typescript/eslint-parser
176176
},
177177
rules: {
178178
'react/react-in-jsx-scope': 0,
179-
'react/jsx-uses-react': 0
180-
}
181-
}
182-
}
179+
'react/jsx-uses-react': 0,
180+
},
181+
},
182+
},
183183
};

lib/rules/boolean-prop-naming.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const report = require('../util/report');
1616
// ------------------------------------------------------------------------------
1717

1818
const messages = {
19-
patternMismatch: 'Prop name ({{propName}}) doesn\'t match rule ({{pattern}})'
19+
patternMismatch: 'Prop name ({{propName}}) doesn\'t match rule ({{pattern}})',
2020
};
2121

2222
module.exports = {
@@ -25,7 +25,7 @@ module.exports = {
2525
category: 'Stylistic Issues',
2626
description: 'Enforces consistent naming for boolean props',
2727
recommended: false,
28-
url: docsUrl('boolean-prop-naming')
28+
url: docsUrl('boolean-prop-naming'),
2929
},
3030

3131
messages,
@@ -35,28 +35,28 @@ module.exports = {
3535
properties: {
3636
propTypeNames: {
3737
items: {
38-
type: 'string'
38+
type: 'string',
3939
},
4040
minItems: 1,
4141
type: 'array',
42-
uniqueItems: true
42+
uniqueItems: true,
4343
},
4444
rule: {
4545
default: '^(is|has)[A-Z]([A-Za-z0-9]?)+',
4646
minLength: 1,
47-
type: 'string'
47+
type: 'string',
4848
},
4949
message: {
5050
minLength: 1,
51-
type: 'string'
51+
type: 'string',
5252
},
5353
validateNested: {
5454
default: false,
55-
type: 'boolean'
56-
}
55+
type: 'boolean',
56+
},
5757
},
58-
type: 'object'
59-
}]
58+
type: 'object',
59+
}],
6060
},
6161

6262
create: Components.detect((context, components, utils) => {
@@ -199,7 +199,7 @@ module.exports = {
199199
});
200200

201201
components.set(node, {
202-
invalidProps
202+
invalidProps,
203203
});
204204
}
205205

@@ -215,8 +215,8 @@ module.exports = {
215215
data: {
216216
component: propName,
217217
propName,
218-
pattern: config.rule
219-
}
218+
pattern: config.rule,
219+
},
220220
});
221221
});
222222
}
@@ -348,7 +348,7 @@ module.exports = {
348348

349349
// Reset cache
350350
objectTypeAnnotations.clear();
351-
}
351+
},
352352
};
353-
})
353+
}),
354354
};

lib/rules/button-has-type.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const report = require('../util/report');
1818
const optionDefaults = {
1919
button: true,
2020
submit: true,
21-
reset: true
21+
reset: true,
2222
};
2323

2424
const messages = {
2525
missingType: 'Missing an explicit type attribute for button',
2626
complexType: 'The button type attribute must be specified by a static string or a trivial ternary expression',
2727
invalidValue: '"{{value}}" is an invalid value for button type attribute',
28-
forbiddenValue: '"{{value}}" is an invalid value for button type attribute'
28+
forbiddenValue: '"{{value}}" is an invalid value for button type attribute',
2929
};
3030

3131
module.exports = {
@@ -34,7 +34,7 @@ module.exports = {
3434
description: 'Forbid "button" element without an explicit "type" attribute',
3535
category: 'Possible Errors',
3636
recommended: false,
37-
url: docsUrl('button-has-type')
37+
url: docsUrl('button-has-type'),
3838
},
3939

4040
messages,
@@ -44,33 +44,33 @@ module.exports = {
4444
properties: {
4545
button: {
4646
default: optionDefaults.button,
47-
type: 'boolean'
47+
type: 'boolean',
4848
},
4949
submit: {
5050
default: optionDefaults.submit,
51-
type: 'boolean'
51+
type: 'boolean',
5252
},
5353
reset: {
5454
default: optionDefaults.reset,
55-
type: 'boolean'
56-
}
55+
type: 'boolean',
56+
},
5757
},
58-
additionalProperties: false
59-
}]
58+
additionalProperties: false,
59+
}],
6060
},
6161

6262
create(context) {
6363
const configuration = Object.assign({}, optionDefaults, context.options[0]);
6464

6565
function reportMissing(node) {
6666
report(context, messages.missingType, 'missingType', {
67-
node
67+
node,
6868
});
6969
}
7070

7171
function reportComplex(node) {
7272
report(context, messages.complexType, 'complexType', {
73-
node
73+
node,
7474
});
7575
}
7676

@@ -79,15 +79,15 @@ module.exports = {
7979
report(context, messages.invalidValue, 'invalidValue', {
8080
node,
8181
data: {
82-
value
83-
}
82+
value,
83+
},
8484
});
8585
} else if (!configuration[value]) {
8686
report(context, messages.forbiddenValue, 'forbiddenValue', {
8787
node,
8888
data: {
89-
value
90-
}
89+
value,
90+
},
9191
});
9292
}
9393
}
@@ -157,7 +157,7 @@ module.exports = {
157157
}
158158

159159
checkExpression(node, typeProp.value);
160-
}
160+
},
161161
};
162-
}
162+
},
163163
};

lib/rules/default-props-match-prop-types.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ const report = require('../util/report');
1616

1717
const messages = {
1818
requiredHasDefault: 'defaultProp "{{name}}" defined for isRequired propType.',
19-
defaultHasNoType: 'defaultProp "{{name}}" has no corresponding propTypes declaration.'
19+
defaultHasNoType: 'defaultProp "{{name}}" has no corresponding propTypes declaration.',
2020
};
2121

2222
module.exports = {
2323
meta: {
2424
docs: {
2525
description: 'Enforce all defaultProps are defined and not "required" in propTypes.',
2626
category: 'Best Practices',
27-
url: docsUrl('default-props-match-prop-types')
27+
url: docsUrl('default-props-match-prop-types'),
2828
},
2929

3030
messages,
@@ -34,11 +34,11 @@ module.exports = {
3434
properties: {
3535
allowRequiredDefaults: {
3636
default: false,
37-
type: 'boolean'
38-
}
37+
type: 'boolean',
38+
},
3939
},
40-
additionalProperties: false
41-
}]
40+
additionalProperties: false,
41+
}],
4242
},
4343

4444
create: Components.detect((context, components) => {
@@ -71,15 +71,15 @@ module.exports = {
7171
report(context, messages.requiredHasDefault, 'requiredHasDefault', {
7272
node: defaultProp.node,
7373
data: {
74-
name: defaultPropName
75-
}
74+
name: defaultPropName,
75+
},
7676
});
7777
} else {
7878
report(context, messages.defaultHasNoType, 'defaultHasNoType', {
7979
node: defaultProp.node,
8080
data: {
81-
name: defaultPropName
82-
}
81+
name: defaultPropName,
82+
},
8383
});
8484
}
8585
});
@@ -100,7 +100,7 @@ module.exports = {
100100
list[component].defaultProps || {}
101101
);
102102
});
103-
}
103+
},
104104
};
105-
})
105+
}),
106106
};

0 commit comments

Comments
 (0)