@w5s/eslint-config 1.0.0-alpha.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/es.js +1 -20
- package/ignore.js +1 -0
- package/index.js +28 -14
- package/jest.js +15 -2
- package/json.js +8 -6
- package/lib/_rule.d.ts +2 -0
- package/lib/_rule.js +7 -0
- package/lib/es/base.d.ts +4 -0
- package/lib/es/base.js +68 -0
- package/lib/es/import.d.ts +3 -0
- package/lib/es/import.js +57 -0
- package/lib/es/jsdoc.d.ts +3 -0
- package/lib/es/jsdoc.js +20 -0
- package/lib/es/promise.d.ts +3 -0
- package/lib/es/promise.js +12 -0
- package/lib/es/unicorn.d.ts +3 -0
- package/lib/es/unicorn.js +73 -0
- package/lib/es.d.ts +3 -0
- package/lib/es.js +15 -0
- package/lib/ignore.d.ts +3 -0
- package/lib/ignore.js +40 -0
- package/lib/jest.d.ts +3 -0
- package/lib/jest.js +57 -0
- package/lib/jsonc.d.ts +3 -0
- package/lib/jsonc.js +183 -0
- package/lib/prettier.d.ts +3 -0
- package/lib/prettier.js +43 -0
- package/lib/typescript.d.ts +3 -0
- package/lib/typescript.js +248 -0
- package/lib/yml.d.ts +3 -0
- package/lib/yml.js +7 -0
- package/package.json +58 -39
- package/src/_rule.ts +5 -0
- package/src/es/base.ts +80 -0
- package/src/es/import.ts +61 -0
- package/src/es/jsdoc.ts +22 -0
- package/src/es/promise.ts +13 -0
- package/src/es/unicorn.ts +75 -0
- package/src/es.ts +18 -0
- package/src/ignore.ts +41 -0
- package/src/jest.ts +61 -0
- package/src/jsonc.ts +187 -0
- package/src/prettier.ts +47 -0
- package/{rules/typescript.js → src/typescript.ts} +112 -93
- package/src/yml.ts +8 -0
- package/ts.js +12 -33
- package/yml.js +9 -0
- package/functional.js +0 -51
- package/react.js +0 -10
- package/rules/_rule.js +0 -78
- package/rules/base.js +0 -45
- package/rules/import.js +0 -23
- package/rules/jest.js +0 -55
- package/rules/jsdoc.js +0 -20
- package/rules/prettier.js +0 -14
- package/rules/react.js +0 -176
- package/rules/unicorn.js +0 -61
package/rules/prettier.js
DELETED
package/rules/react.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
const { off, warn, error } = require('./_rule');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
plugins: ['react'],
|
|
5
|
-
rules: {
|
|
6
|
-
'react/boolean-prop-naming': off,
|
|
7
|
-
'react/button-has-type': error,
|
|
8
|
-
'react/default-props-match-prop-types': off,
|
|
9
|
-
'react/destructuring-assignment': off,
|
|
10
|
-
'react/display-name': off,
|
|
11
|
-
'react/forbid-component-props': off,
|
|
12
|
-
'react/forbid-dom-props': off,
|
|
13
|
-
'react/forbid-elements': off,
|
|
14
|
-
'react/forbid-foreign-prop-types': off,
|
|
15
|
-
'react/forbid-prop-types': off,
|
|
16
|
-
'react/jsx-boolean-value': [error, 'never'],
|
|
17
|
-
'react/jsx-child-element-spacing': off,
|
|
18
|
-
'react/jsx-closing-bracket-location': off,
|
|
19
|
-
'react/jsx-closing-tag-location': off,
|
|
20
|
-
'react/jsx-curly-brace-presence': off,
|
|
21
|
-
'react/jsx-curly-newline': error,
|
|
22
|
-
'react/jsx-curly-spacing': [
|
|
23
|
-
error,
|
|
24
|
-
'never',
|
|
25
|
-
{
|
|
26
|
-
allowMultiline: true,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'react/jsx-equals-spacing': [error, 'never'],
|
|
30
|
-
'react/jsx-first-prop-new-line': [error, 'multiline-multiprop'],
|
|
31
|
-
'react/jsx-fragments': [error, 'syntax'],
|
|
32
|
-
'react/jsx-handler-names': [
|
|
33
|
-
error,
|
|
34
|
-
{
|
|
35
|
-
checkInlineFunction: false,
|
|
36
|
-
checkLocalVariables: false,
|
|
37
|
-
eventHandlerPrefix: 'handle',
|
|
38
|
-
eventHandlerPropPrefix: 'on',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
'react/jsx-indent': [error, 2],
|
|
42
|
-
'react/jsx-indent-props': [error, 2],
|
|
43
|
-
'react/jsx-key': error,
|
|
44
|
-
'react/jsx-max-props-per-line': [
|
|
45
|
-
error,
|
|
46
|
-
{
|
|
47
|
-
maximum: 3,
|
|
48
|
-
when: 'multiline',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
'react/jsx-no-bind': [
|
|
52
|
-
'error',
|
|
53
|
-
{
|
|
54
|
-
allowArrowFunctions: true,
|
|
55
|
-
allowBind: false,
|
|
56
|
-
ignoreRefs: true,
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
'react/jsx-no-comment-textnodes': error,
|
|
60
|
-
'react/jsx-no-duplicate-props': error,
|
|
61
|
-
'react/jsx-no-literals': off,
|
|
62
|
-
'react/jsx-no-target-blank': error,
|
|
63
|
-
'react/jsx-no-undef': error,
|
|
64
|
-
'react/jsx-one-expression-per-line': off,
|
|
65
|
-
'react/jsx-pascal-case': error,
|
|
66
|
-
'react/jsx-props-no-multi-spaces': error,
|
|
67
|
-
'react/jsx-props-no-spreading': off,
|
|
68
|
-
'react/jsx-sort-default-props': error,
|
|
69
|
-
'react/jsx-sort-props': [
|
|
70
|
-
'error',
|
|
71
|
-
{
|
|
72
|
-
callbacksLast: false,
|
|
73
|
-
ignoreCase: true,
|
|
74
|
-
noSortAlphabetically: false,
|
|
75
|
-
reservedFirst: true,
|
|
76
|
-
shorthandFirst: false,
|
|
77
|
-
shorthandLast: false,
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
'react/jsx-tag-spacing': [
|
|
81
|
-
error,
|
|
82
|
-
{
|
|
83
|
-
afterOpening: 'never',
|
|
84
|
-
beforeSelfClosing: 'always',
|
|
85
|
-
closingSlash: 'never',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
'react/jsx-uses-react': warn,
|
|
89
|
-
'react/jsx-uses-vars': warn,
|
|
90
|
-
'react/jsx-wrap-multilines': off,
|
|
91
|
-
'react/no-access-state-in-setstate': error,
|
|
92
|
-
'react/no-array-index-key': error,
|
|
93
|
-
'react/no-children-prop': error,
|
|
94
|
-
'react/no-danger': error,
|
|
95
|
-
'react/no-danger-with-children': error,
|
|
96
|
-
'react/no-deprecated': error,
|
|
97
|
-
'react/no-did-mount-set-state': error,
|
|
98
|
-
'react/no-did-update-set-state': error,
|
|
99
|
-
'react/no-direct-mutation-state': error,
|
|
100
|
-
'react/no-find-dom-node': error,
|
|
101
|
-
'react/no-is-mounted': error,
|
|
102
|
-
'react/no-multi-comp': off,
|
|
103
|
-
'react/no-redundant-should-component-update': error,
|
|
104
|
-
'react/no-set-state': off,
|
|
105
|
-
'react/no-string-refs': error,
|
|
106
|
-
'react/no-this-in-sfc': error,
|
|
107
|
-
'react/no-typos': error,
|
|
108
|
-
'react/no-unescaped-entities': error,
|
|
109
|
-
'react/no-unknown-property': error,
|
|
110
|
-
'react/no-unsafe': error,
|
|
111
|
-
'react/no-unused-prop-types': error,
|
|
112
|
-
'react/no-unused-state': error,
|
|
113
|
-
'react/no-will-update-set-state': error,
|
|
114
|
-
'react/prefer-es6-class': error,
|
|
115
|
-
'react/prefer-read-only-props': warn,
|
|
116
|
-
'react/prefer-stateless-function': off,
|
|
117
|
-
'react/prop-types': off,
|
|
118
|
-
'react/react-in-jsx-scope': error,
|
|
119
|
-
'react/require-default-props': off,
|
|
120
|
-
'react/require-render-return': error,
|
|
121
|
-
'react/self-closing-comp': error,
|
|
122
|
-
'react/sort-comp': [
|
|
123
|
-
'error',
|
|
124
|
-
{
|
|
125
|
-
groups: {
|
|
126
|
-
lifecycle: [
|
|
127
|
-
'displayName',
|
|
128
|
-
'propTypes',
|
|
129
|
-
'contextTypes',
|
|
130
|
-
'childContextTypes',
|
|
131
|
-
'mixins',
|
|
132
|
-
'statics',
|
|
133
|
-
'defaultProps',
|
|
134
|
-
'constructor',
|
|
135
|
-
'getDefaultProps',
|
|
136
|
-
'getInitialState',
|
|
137
|
-
'state',
|
|
138
|
-
'getChildContext',
|
|
139
|
-
'getDerivedStateFromProps',
|
|
140
|
-
'componentWillMount',
|
|
141
|
-
'UNSAFE_componentWillMount',
|
|
142
|
-
'componentDidMount',
|
|
143
|
-
'componentWillReceiveProps',
|
|
144
|
-
'UNSAFE_componentWillReceiveProps',
|
|
145
|
-
'shouldComponentUpdate',
|
|
146
|
-
'componentWillUpdate',
|
|
147
|
-
'UNSAFE_componentWillUpdate',
|
|
148
|
-
'getSnapshotBeforeUpdate',
|
|
149
|
-
'componentDidUpdate',
|
|
150
|
-
'componentWillUnmount',
|
|
151
|
-
'componentDidCatch',
|
|
152
|
-
],
|
|
153
|
-
rendering: ['/^render.+$/', 'render'],
|
|
154
|
-
},
|
|
155
|
-
order: [
|
|
156
|
-
'static-variables',
|
|
157
|
-
'static-methods',
|
|
158
|
-
'instance-variables',
|
|
159
|
-
'lifecycle',
|
|
160
|
-
'/^on.+$/',
|
|
161
|
-
'getters',
|
|
162
|
-
'setters',
|
|
163
|
-
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
|
|
164
|
-
'instance-methods',
|
|
165
|
-
'everything-else',
|
|
166
|
-
'rendering',
|
|
167
|
-
],
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
'react/sort-prop-types': error,
|
|
171
|
-
'react/state-in-constructor': [error, 'never'],
|
|
172
|
-
'react/static-property-placement': error,
|
|
173
|
-
'react/style-prop-object': error,
|
|
174
|
-
'react/void-dom-elements-no-children': error,
|
|
175
|
-
},
|
|
176
|
-
};
|
package/rules/unicorn.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
const { off, warn, error, concatESConfig } = require('./_rule');
|
|
2
|
-
|
|
3
|
-
module.exports = concatESConfig(
|
|
4
|
-
{
|
|
5
|
-
extends: ['plugin:unicorn/recommended'],
|
|
6
|
-
plugins: ['unicorn'],
|
|
7
|
-
rules: {
|
|
8
|
-
'unicode-bom': [error, 'never'],
|
|
9
|
-
'unicorn/better-regex': error,
|
|
10
|
-
'unicorn/catch-error-name': [error, { name: error }],
|
|
11
|
-
'unicorn/custom-error-definition': error,
|
|
12
|
-
'unicorn/error-message': error,
|
|
13
|
-
'unicorn/explicit-length-check': [error, { 'non-zero': 'greater-than' }],
|
|
14
|
-
'unicorn/filename-case': off,
|
|
15
|
-
'unicorn/import-index': off, // Not playing well with ES Module
|
|
16
|
-
'unicorn/new-for-builtins': off, // error, @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/122
|
|
17
|
-
'unicorn/no-abusive-eslint-disable': error,
|
|
18
|
-
'unicorn/no-array-instanceof': error,
|
|
19
|
-
'unicorn/no-console-spaces': off,
|
|
20
|
-
'unicorn/no-fn-reference-in-iterator': off, // error ?
|
|
21
|
-
'unicorn/no-for-loop': error,
|
|
22
|
-
'unicorn/no-hex-escape': error,
|
|
23
|
-
'unicorn/no-new-buffer': error,
|
|
24
|
-
'unicorn/no-null': off, // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/612
|
|
25
|
-
'unicorn/no-process-exit': off,
|
|
26
|
-
'unicorn/no-unreadable-array-destructuring': off,
|
|
27
|
-
'unicorn/no-unsafe-regex': error,
|
|
28
|
-
'unicorn/no-unused-properties': warn,
|
|
29
|
-
'unicorn/no-useless-undefined': off,
|
|
30
|
-
'unicorn/no-zero-fractions': error,
|
|
31
|
-
'unicorn/number-literal-case': error,
|
|
32
|
-
'unicorn/prefer-add-event-listener': off,
|
|
33
|
-
'unicorn/prefer-event-key': error,
|
|
34
|
-
'unicorn/prefer-exponentiation-operator': error,
|
|
35
|
-
'unicorn/prefer-flat-map': error,
|
|
36
|
-
'unicorn/prefer-includes': error,
|
|
37
|
-
'unicorn/prefer-node-append': error,
|
|
38
|
-
'unicorn/prefer-node-remove': error,
|
|
39
|
-
'unicorn/prefer-number-properties': error,
|
|
40
|
-
'unicorn/prefer-query-selector': error,
|
|
41
|
-
'unicorn/prefer-set-has': off,
|
|
42
|
-
'unicorn/prefer-spread': off,
|
|
43
|
-
'unicorn/prefer-starts-ends-with': error,
|
|
44
|
-
'unicorn/prefer-text-content': error,
|
|
45
|
-
'unicorn/prefer-type-error': error,
|
|
46
|
-
'unicorn/throw-new-error': error,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
rules: {
|
|
51
|
-
'unicorn/consistent-destructuring': off,
|
|
52
|
-
'unicorn/no-array-callback-reference': off, // Many false positive reported
|
|
53
|
-
'unicorn/no-array-for-each': off, // This rule could change browser compatibility
|
|
54
|
-
'unicorn/no-array-method-this-argument': off, // Many false positive reported
|
|
55
|
-
'unicorn/no-array-reduce': off, // Array#reduce can be used
|
|
56
|
-
'unicorn/no-object-as-default-parameter': off,
|
|
57
|
-
'unicorn/prefer-default-parameters': off,
|
|
58
|
-
'unicorn/prevent-abbreviations': off, // This rule is so dangerous : it potentially break code while fixing in many cases !!
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
);
|