@oriflame/config-eslint 4.2.1 → 5.0.3
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/LICENSE +1 -1
- package/README.md +2 -81
- package/dts/index.d.ts +10 -0
- package/lib/index.js +45 -40
- package/lib/index.js.map +1 -0
- package/package.json +37 -30
- package/src/index.ts +21 -27
- package/CHANGELOG.md +0 -3589
- package/lib/index.d.ts +0 -10
- package/lib/index.d.ts.map +0 -1
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts +0 -4
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts.map +0 -1
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.js +0 -32
- package/lib/presets/base.d.ts +0 -4
- package/lib/presets/base.d.ts.map +0 -1
- package/lib/presets/base.js +0 -120
- package/lib/presets/future.d.ts +0 -4
- package/lib/presets/future.d.ts.map +0 -1
- package/lib/presets/future.js +0 -13
- package/lib/presets/nextjs.d.ts +0 -4
- package/lib/presets/nextjs.d.ts.map +0 -1
- package/lib/presets/nextjs.js +0 -13
- package/lib/presets/node.d.ts +0 -4
- package/lib/presets/node.d.ts.map +0 -1
- package/lib/presets/node.js +0 -26
- package/lib/presets/prettier.d.ts +0 -4
- package/lib/presets/prettier.d.ts.map +0 -1
- package/lib/presets/prettier.js +0 -13
- package/lib/presets/typescript.d.ts +0 -4
- package/lib/presets/typescript.d.ts.map +0 -1
- package/lib/presets/typescript.js +0 -40
- package/lib/resolvers/graphql.d.ts +0 -6
- package/lib/resolvers/graphql.d.ts.map +0 -1
- package/lib/resolvers/graphql.js +0 -12
- package/lib/rules/a11y.d.ts +0 -4
- package/lib/rules/a11y.d.ts.map +0 -1
- package/lib/rules/a11y.js +0 -45
- package/lib/rules/eslint-comments.d.ts +0 -4
- package/lib/rules/eslint-comments.d.ts.map +0 -1
- package/lib/rules/eslint-comments.js +0 -14
- package/lib/rules/eslint.d.ts +0 -4
- package/lib/rules/eslint.d.ts.map +0 -1
- package/lib/rules/eslint.js +0 -385
- package/lib/rules/import.d.ts +0 -4
- package/lib/rules/import.d.ts.map +0 -1
- package/lib/rules/import.js +0 -76
- package/lib/rules/jest.d.ts +0 -4
- package/lib/rules/jest.d.ts.map +0 -1
- package/lib/rules/jest.js +0 -59
- package/lib/rules/nextjs.d.ts +0 -4
- package/lib/rules/nextjs.d.ts.map +0 -1
- package/lib/rules/nextjs.js +0 -17
- package/lib/rules/node.d.ts +0 -4
- package/lib/rules/node.d.ts.map +0 -1
- package/lib/rules/node.js +0 -45
- package/lib/rules/prettier.d.ts +0 -4
- package/lib/rules/prettier.d.ts.map +0 -1
- package/lib/rules/prettier.js +0 -6
- package/lib/rules/promise.d.ts +0 -4
- package/lib/rules/promise.d.ts.map +0 -1
- package/lib/rules/promise.js +0 -24
- package/lib/rules/react-hooks.d.ts +0 -4
- package/lib/rules/react-hooks.d.ts.map +0 -1
- package/lib/rules/react-hooks.js +0 -7
- package/lib/rules/react.d.ts +0 -4
- package/lib/rules/react.d.ts.map +0 -1
- package/lib/rules/react.js +0 -143
- package/lib/rules/testing-library.d.ts +0 -4
- package/lib/rules/testing-library.d.ts.map +0 -1
- package/lib/rules/testing-library.js +0 -31
- package/lib/rules/typescript.d.ts +0 -4
- package/lib/rules/typescript.d.ts.map +0 -1
- package/lib/rules/typescript.js +0 -369
- package/lib/rules/unicorn.d.ts +0 -4
- package/lib/rules/unicorn.d.ts.map +0 -1
- package/lib/rules/unicorn.js +0 -105
- package/src/presets/SECRET_CONFIG_DO_NOT_USE_THIS.ts +0 -34
- package/src/presets/base.ts +0 -143
- package/src/presets/future.ts +0 -13
- package/src/presets/nextjs.ts +0 -13
- package/src/presets/node.ts +0 -27
- package/src/presets/prettier.ts +0 -13
- package/src/presets/typescript.ts +0 -45
- package/src/resolvers/graphql.ts +0 -11
- package/src/rules/a11y.ts +0 -47
- package/src/rules/eslint-comments.ts +0 -16
- package/src/rules/eslint.ts +0 -384
- package/src/rules/import.ts +0 -79
- package/src/rules/jest.ts +0 -64
- package/src/rules/nextjs.ts +0 -19
- package/src/rules/node.ts +0 -47
- package/src/rules/prettier.ts +0 -8
- package/src/rules/promise.ts +0 -26
- package/src/rules/react-hooks.ts +0 -9
- package/src/rules/react.ts +0 -145
- package/src/rules/testing-library.ts +0 -33
- package/src/rules/typescript.ts +0 -377
- package/src/rules/unicorn.ts +0 -108
- package/test/index.test.ts +0 -46
- package/test/lint-files/combo.ts +0 -10
- package/test/lint-files/errors/combo.ts +0 -3
- package/test/lint-files/errors/javascript.js +0 -2
- package/test/lint-files/errors/next.js +0 -11
- package/test/lint-files/errors/node.js +0 -3
- package/test/lint-files/errors/prettier.js +0 -5
- package/test/lint-files/errors/test.js +0 -3
- package/test/lint-files/errors/typescript.ts +0 -3
- package/test/lint-files/javascript.js +0 -1
- package/test/lint-files/next.ts +0 -5
- package/test/lint-files/node.js +0 -2
- package/test/lint-files/prettier.js +0 -1
- package/test/lint-files/test.js +0 -5
- package/test/lint-files/typescript.ts +0 -20
- package/test/tsconfig.json +0 -19
- package/test/utils/getErrors.ts +0 -16
- package/tools/check-rules/allRules.ts +0 -99
- package/tools/check-rules/index.ts +0 -90
- package/tools/check-rules/tsconfig.json +0 -17
- package/tsconfig.json +0 -22
- package/tsconfig.tsbuildinfo +0 -1
package/lib/rules/promise.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const config = {
|
|
3
|
-
// eslint-plugin-promise rules
|
|
4
|
-
'promise/always-return': 'off',
|
|
5
|
-
'promise/avoid-new': 'off',
|
|
6
|
-
'promise/catch-or-return': 'off',
|
|
7
|
-
'promise/no-callback-in-promise': 'error',
|
|
8
|
-
'promise/no-native': 'off',
|
|
9
|
-
'promise/no-nesting': 'warn',
|
|
10
|
-
'promise/no-new-statics': 'error',
|
|
11
|
-
'promise/no-promise-in-callback': 'error',
|
|
12
|
-
'promise/no-return-in-finally': 'error',
|
|
13
|
-
'promise/no-return-wrap': [
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
allowReject: true,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
'promise/param-names': 'error',
|
|
20
|
-
'promise/prefer-await-to-callbacks': 'off',
|
|
21
|
-
'promise/prefer-await-to-then': 'off',
|
|
22
|
-
'promise/valid-params': 'error', // ensures the proper number of arguments are passed to Promise functions
|
|
23
|
-
};
|
|
24
|
-
module.exports = config;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../../src/rules/react-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAA,MAAM,MAAM,EAAE,YAAY,CAAC,OAAO,CAIjC,CAAC;AAEF,SAAS,MAAM,CAAC"}
|
package/lib/rules/react-hooks.js
DELETED
package/lib/rules/react.d.ts
DELETED
package/lib/rules/react.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/rules/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAA,MAAM,MAAM,EAAE,YAAY,CAAC,OAAO,CA4IjC,CAAC;AAEF,SAAS,MAAM,CAAC"}
|
package/lib/rules/react.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const config = {
|
|
3
|
-
// eslint-plugin-react rules
|
|
4
|
-
'react/boolean-prop-naming': 'off',
|
|
5
|
-
'react/button-has-type': ['error', { reset: false }],
|
|
6
|
-
'react/default-props-match-prop-types': 'error',
|
|
7
|
-
'react/destructuring-assignment': 'warn',
|
|
8
|
-
'react/display-name': 'off',
|
|
9
|
-
'react/forbid-component-props': 'off',
|
|
10
|
-
'react/forbid-dom-props': 'off',
|
|
11
|
-
'react/forbid-elements': 'off',
|
|
12
|
-
'react/forbid-foreign-prop-types': 'error',
|
|
13
|
-
'react/forbid-prop-types': [
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
forbid: ['any', 'array', 'object'],
|
|
17
|
-
checkContextTypes: true,
|
|
18
|
-
checkChildContextTypes: true,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
'react/function-component-definition': 'off',
|
|
22
|
-
'react/jsx-boolean-value': ['error', 'never'],
|
|
23
|
-
'react/jsx-child-element-spacing': 'error',
|
|
24
|
-
'react/jsx-closing-bracket-location': 'off',
|
|
25
|
-
'react/jsx-closing-tag-location': 'off',
|
|
26
|
-
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
|
27
|
-
'react/jsx-curly-newline': 'off',
|
|
28
|
-
'react/jsx-curly-spacing': 'off',
|
|
29
|
-
'react/jsx-equals-spacing': 'off',
|
|
30
|
-
'react/jsx-filename-extension': ['error', { allow: 'as-needed', extensions: ['.jsx', '.tsx'] }],
|
|
31
|
-
'react/jsx-first-prop-new-line': 'off',
|
|
32
|
-
'react/jsx-fragments': ['error', 'syntax'],
|
|
33
|
-
'react/jsx-handler-names': 'error',
|
|
34
|
-
'react/jsx-indent': 'off',
|
|
35
|
-
'react/jsx-indent-props': 'off',
|
|
36
|
-
'react/jsx-key': 'error',
|
|
37
|
-
'react/jsx-max-depth': 'off',
|
|
38
|
-
'react/jsx-max-props-per-line': 'off',
|
|
39
|
-
'react/jsx-newline': 'off',
|
|
40
|
-
'react/jsx-no-bind': ['warn', { ignoreDOMComponents: true }],
|
|
41
|
-
'react/jsx-no-constructed-context-values': 'warn',
|
|
42
|
-
'react/jsx-no-comment-textnodes': 'warn',
|
|
43
|
-
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
|
|
44
|
-
'react/jsx-no-literals': 'off',
|
|
45
|
-
'react/jsx-no-script-url': 'error',
|
|
46
|
-
'react/jsx-no-target-blank': 'error',
|
|
47
|
-
'react/jsx-no-undef': 'error',
|
|
48
|
-
'react/jsx-no-useless-fragment': 'error',
|
|
49
|
-
'react/jsx-one-expression-per-line': 'off',
|
|
50
|
-
'react/jsx-pascal-case': 'error',
|
|
51
|
-
'react/jsx-props-no-multi-spaces': 'off',
|
|
52
|
-
'react/jsx-props-no-spreading': 'off',
|
|
53
|
-
'react/jsx-sort-default-props': 'off',
|
|
54
|
-
'react/jsx-sort-props': [
|
|
55
|
-
'warn',
|
|
56
|
-
{
|
|
57
|
-
callbacksLast: true,
|
|
58
|
-
shorthandFirst: true,
|
|
59
|
-
noSortAlphabetically: true,
|
|
60
|
-
reservedFirst: true,
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
'react/jsx-tag-spacing': 'off',
|
|
64
|
-
'react/jsx-uses-react': 'off',
|
|
65
|
-
'react/jsx-uses-vars': 'error',
|
|
66
|
-
'react/jsx-wrap-multilines': 'off',
|
|
67
|
-
'react/no-access-state-in-setstate': 'error',
|
|
68
|
-
'react/no-adjacent-inline-elements': 'off',
|
|
69
|
-
'react/no-array-index-key': 'error',
|
|
70
|
-
'react/no-children-prop': 'error',
|
|
71
|
-
'react/no-danger': 'warn',
|
|
72
|
-
'react/no-danger-with-children': 'error',
|
|
73
|
-
'react/no-deprecated': 'error',
|
|
74
|
-
'react/no-did-mount-set-state': 'error',
|
|
75
|
-
'react/no-did-update-set-state': 'error',
|
|
76
|
-
'react/no-direct-mutation-state': 'error',
|
|
77
|
-
'react/no-find-dom-node': 'error',
|
|
78
|
-
'react/no-is-mounted': 'error',
|
|
79
|
-
'react/no-multi-comp': 'off',
|
|
80
|
-
'react/no-redundant-should-component-update': 'error',
|
|
81
|
-
'react/no-render-return-value': 'error',
|
|
82
|
-
'react/no-set-state': 'off',
|
|
83
|
-
'react/no-string-refs': 'error',
|
|
84
|
-
'react/no-this-in-sfc': 'error',
|
|
85
|
-
'react/no-typos': 'error',
|
|
86
|
-
'react/no-unescaped-entities': 'error',
|
|
87
|
-
'react/no-unknown-property': 'warn',
|
|
88
|
-
'react/no-unsafe': 'error',
|
|
89
|
-
'react/no-unstable-nested-components': 'error',
|
|
90
|
-
'react/no-unused-prop-types': 'off',
|
|
91
|
-
'react/no-unused-state': 'error',
|
|
92
|
-
'react/no-will-update-set-state': 'error',
|
|
93
|
-
'react/prefer-es6-class': 'error',
|
|
94
|
-
'react/prefer-read-only-props': 'off',
|
|
95
|
-
'react/prefer-stateless-function': 'error',
|
|
96
|
-
'react/react-in-jsx-scope': 'off',
|
|
97
|
-
'react/require-default-props': 'off',
|
|
98
|
-
'react/require-optimization': 'off',
|
|
99
|
-
'react/require-render-return': 'error',
|
|
100
|
-
'react/self-closing-comp': 'error',
|
|
101
|
-
'react/sort-comp': [
|
|
102
|
-
'warn',
|
|
103
|
-
{
|
|
104
|
-
order: ['statics', 'properties', 'lifecycle', 'everything-else', 'handlers', 'renderers'],
|
|
105
|
-
groups: {
|
|
106
|
-
statics: ['propTypes', 'defaultProps', 'contextType', 'contextTypes', 'childContextTypes'],
|
|
107
|
-
properties: ['/^(?!on).+$/', '/^(?!handle).+$/', '/^(?!render).+$/', '/^.+Ref$/', 'state'],
|
|
108
|
-
lifecycle: [
|
|
109
|
-
'constructor',
|
|
110
|
-
'getDerivedStateFromProps',
|
|
111
|
-
'componentWillMount',
|
|
112
|
-
'UNSAFE_componentWillMount',
|
|
113
|
-
'componentDidMount',
|
|
114
|
-
'componentWillReceiveProps',
|
|
115
|
-
'UNSAFE_componentWillReceiveProps',
|
|
116
|
-
'shouldComponentUpdate',
|
|
117
|
-
'componentWillUpdate',
|
|
118
|
-
'UNSAFE_componentWillUpdate',
|
|
119
|
-
'getSnapshotBeforeUpdate',
|
|
120
|
-
'componentDidUpdate',
|
|
121
|
-
'componentDidCatch',
|
|
122
|
-
'componentWillUnmount',
|
|
123
|
-
],
|
|
124
|
-
handlers: ['/^on.+$/', '/^handle.+$/'],
|
|
125
|
-
renderers: ['/^render.+$/', 'render'],
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
'react/sort-prop-types': [
|
|
130
|
-
'warn',
|
|
131
|
-
{
|
|
132
|
-
ignoreCase: true,
|
|
133
|
-
callbacksLast: true,
|
|
134
|
-
requiredFirst: false,
|
|
135
|
-
sortShapeProp: true,
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
'react/state-in-constructor': ['warn', 'never'],
|
|
139
|
-
'react/static-property-placement': 'off',
|
|
140
|
-
'react/style-prop-object': 'warn',
|
|
141
|
-
'react/void-dom-elements-no-children': 'error', // prevent passing of children to void DOM elements (e.g. <br />)
|
|
142
|
-
};
|
|
143
|
-
module.exports = config;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing-library.d.ts","sourceRoot":"","sources":["../../src/rules/testing-library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAA,MAAM,MAAM,EAAE,YAAY,CAAC,OAAO,CA4BjC,CAAC;AAEF,SAAS,MAAM,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const config = {
|
|
3
|
-
// eslint-plugin-testing-library
|
|
4
|
-
'testing-library/await-async-query': 'error',
|
|
5
|
-
'testing-library/await-async-utils': 'error',
|
|
6
|
-
'testing-library/await-fire-event': 'off',
|
|
7
|
-
'testing-library/consistent-data-testid': 'off',
|
|
8
|
-
'testing-library/no-await-sync-events': 'error',
|
|
9
|
-
'testing-library/no-await-sync-query': 'error',
|
|
10
|
-
'testing-library/no-container': 'warn',
|
|
11
|
-
'testing-library/no-debugging-utils': 'warn',
|
|
12
|
-
'testing-library/no-dom-import': ['error', 'react'],
|
|
13
|
-
'testing-library/no-manual-cleanup': 'off',
|
|
14
|
-
'testing-library/no-node-access': 'error',
|
|
15
|
-
'testing-library/no-promise-in-fire-event': 'error',
|
|
16
|
-
'testing-library/no-render-in-setup': 'off',
|
|
17
|
-
'testing-library/no-unnecessary-act': 'error',
|
|
18
|
-
'testing-library/no-wait-for-empty-callback': 'off',
|
|
19
|
-
'testing-library/no-wait-for-multiple-assertions': 'warn',
|
|
20
|
-
'testing-library/no-wait-for-side-effects': 'warn',
|
|
21
|
-
'testing-library/no-wait-for-snapshot': 'warn',
|
|
22
|
-
'testing-library/prefer-explicit-assert': 'warn',
|
|
23
|
-
'testing-library/prefer-find-by': 'warn',
|
|
24
|
-
'testing-library/prefer-presence-queries': 'off',
|
|
25
|
-
'testing-library/prefer-query-by-disappearance': 'warn',
|
|
26
|
-
'testing-library/prefer-user-event': 'warn',
|
|
27
|
-
'testing-library/prefer-screen-queries': 'off',
|
|
28
|
-
'testing-library/prefer-wait-for': 'error',
|
|
29
|
-
'testing-library/render-result-naming-convention': 'warn', // enforce a valid naming for return value from render
|
|
30
|
-
};
|
|
31
|
-
module.exports = config;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/rules/typescript.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,QAAA,MAAM,MAAM,EAAE,YAAY,CAAC,OAAO,CAiXjC,CAAC;AAEF,SAAS,MAAM,CAAC"}
|
package/lib/rules/typescript.js
DELETED
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable id-denylist -- we have to use identifiers like "String" in rule definitions */
|
|
3
|
-
const lumos_common_1 = require("@oriflame/lumos-common");
|
|
4
|
-
const config = {
|
|
5
|
-
// override ESLint rules
|
|
6
|
-
camelcase: 'off',
|
|
7
|
-
'default-param-last': 'off',
|
|
8
|
-
'dot-notation': 'off',
|
|
9
|
-
'lines-between-class-members': 'off',
|
|
10
|
-
'no-array-constructor': 'off',
|
|
11
|
-
'no-dupe-class-members': 'off',
|
|
12
|
-
'no-duplicate-imports': 'off',
|
|
13
|
-
'no-empty-function': 'off',
|
|
14
|
-
'no-implied-eval': 'off',
|
|
15
|
-
'no-invalid-this': 'off',
|
|
16
|
-
'no-loop-func': 'off',
|
|
17
|
-
'no-loss-of-precision': 'off',
|
|
18
|
-
'no-magic-numbers': 'off',
|
|
19
|
-
'no-redeclare': 'off',
|
|
20
|
-
'no-shadow': 'off',
|
|
21
|
-
'no-throw-literal': 'off',
|
|
22
|
-
'no-return-await': 'off',
|
|
23
|
-
'no-undef': 'off',
|
|
24
|
-
'no-underscore-dangle': 'off',
|
|
25
|
-
'no-unused-expressions': 'off',
|
|
26
|
-
'no-unused-vars': 'off',
|
|
27
|
-
'no-use-before-define': 'off',
|
|
28
|
-
'no-useless-constructor': 'off',
|
|
29
|
-
quotes: 'off',
|
|
30
|
-
'require-await': 'off',
|
|
31
|
-
'space-infix-ops': 'off',
|
|
32
|
-
// override eslint-plugin-node rules
|
|
33
|
-
'node/file-extension-in-import': [
|
|
34
|
-
'error',
|
|
35
|
-
'always',
|
|
36
|
-
{ '.js': 'never', '.jsx': 'never', '.ts': 'never', '.tsx': 'never' },
|
|
37
|
-
],
|
|
38
|
-
'node/no-missing-import': 'off',
|
|
39
|
-
// override eslint-plugin-react rules
|
|
40
|
-
'react/forbid-prop-types': 'off',
|
|
41
|
-
'react/forbid-foreign-prop-types': 'off',
|
|
42
|
-
'react/no-unused-prop-types': 'off',
|
|
43
|
-
'react/prop-types': 'off',
|
|
44
|
-
'react/sort-prop-types': 'off',
|
|
45
|
-
// override eslint-plugin-import rules
|
|
46
|
-
'import/extensions': [
|
|
47
|
-
'error',
|
|
48
|
-
'always',
|
|
49
|
-
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
|
|
50
|
-
],
|
|
51
|
-
'import/no-extraneous-dependencies': [
|
|
52
|
-
'error',
|
|
53
|
-
{
|
|
54
|
-
devDependencies: [
|
|
55
|
-
`test/**/*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
56
|
-
`tests/**/*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
57
|
-
`**/*.test.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
58
|
-
`__tests__/**/*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
59
|
-
`**/__tests__/**/*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
60
|
-
`**/jest.config.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
61
|
-
`**/webpack.config.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
62
|
-
`**/webpack.config.*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
63
|
-
`tools/**/*.${lumos_common_1.TJSX_EXTS_GROUP}`,
|
|
64
|
-
],
|
|
65
|
-
optionalDependencies: false,
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
// @typescript-eslint/eslint-plugin rules
|
|
69
|
-
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
70
|
-
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
|
71
|
-
'@typescript-eslint/await-thenable': 'error',
|
|
72
|
-
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
73
|
-
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
74
|
-
'@typescript-eslint/ban-types': [
|
|
75
|
-
'error',
|
|
76
|
-
{
|
|
77
|
-
types: {
|
|
78
|
-
Function: "Don't use Function as a type. Use explicit types like `(...args: any[]) => void`.",
|
|
79
|
-
String: { message: 'Use string instead.', fixWith: 'string' },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
'@typescript-eslint/brace-style': 'off',
|
|
84
|
-
'@typescript-eslint/class-literal-property-style': 'off',
|
|
85
|
-
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
86
|
-
'@typescript-eslint/comma-dangle': 'off',
|
|
87
|
-
'@typescript-eslint/comma-spacing': 'off',
|
|
88
|
-
'@typescript-eslint/consistent-type-assertions': [
|
|
89
|
-
'error',
|
|
90
|
-
{
|
|
91
|
-
assertionStyle: 'as',
|
|
92
|
-
objectLiteralTypeAssertions: 'allow-as-parameter',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
|
|
96
|
-
'@typescript-eslint/consistent-type-imports': 'off',
|
|
97
|
-
'@typescript-eslint/default-param-last': 'warn',
|
|
98
|
-
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
|
|
99
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
100
|
-
'@typescript-eslint/explicit-member-accessibility': ['warn', { accessibility: 'no-public' }],
|
|
101
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
102
|
-
'@typescript-eslint/func-call-spacing': 'off',
|
|
103
|
-
'@typescript-eslint/indent': 'off',
|
|
104
|
-
'@typescript-eslint/init-declarations': 'off',
|
|
105
|
-
'@typescript-eslint/keyword-spacing': 'off',
|
|
106
|
-
'@typescript-eslint/lines-between-class-members': [
|
|
107
|
-
'warn',
|
|
108
|
-
'always',
|
|
109
|
-
{ exceptAfterSingleLine: true },
|
|
110
|
-
],
|
|
111
|
-
'@typescript-eslint/member-delimiter-style': 'off',
|
|
112
|
-
'@typescript-eslint/member-ordering': [
|
|
113
|
-
'warn',
|
|
114
|
-
{
|
|
115
|
-
default: {
|
|
116
|
-
memberTypes: ['field', 'constructor', 'method'],
|
|
117
|
-
order: 'as-written',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
'@typescript-eslint/method-signature-style': ['error', 'property'],
|
|
122
|
-
'@typescript-eslint/naming-convention': [
|
|
123
|
-
'warn',
|
|
124
|
-
// interfaces cannot start with "I"
|
|
125
|
-
{
|
|
126
|
-
selector: 'interface',
|
|
127
|
-
format: ['PascalCase'],
|
|
128
|
-
custom: {
|
|
129
|
-
regex: '^I[A-Z]',
|
|
130
|
-
match: false,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
// variables and parameters must use camel case, pascal case or upper case with no leading and trailing underscores - exceptions are names that are only underscores (used e.g. for placeholder parameters)
|
|
134
|
-
{
|
|
135
|
-
selector: 'variableLike',
|
|
136
|
-
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
137
|
-
leadingUnderscore: 'forbid',
|
|
138
|
-
trailingUnderscore: 'forbid',
|
|
139
|
-
filter: {
|
|
140
|
-
regex: '^(_+|__webpack_public_path__)$',
|
|
141
|
-
match: false,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
// functions must use camel case or pascal case with no leading and trailing underscores
|
|
145
|
-
{
|
|
146
|
-
selector: 'function',
|
|
147
|
-
format: ['camelCase', 'PascalCase'],
|
|
148
|
-
leadingUnderscore: 'forbid',
|
|
149
|
-
trailingUnderscore: 'forbid',
|
|
150
|
-
},
|
|
151
|
-
/* TODO [@jakubmazanec]: enable this when we can discern things defined in external packages and other stuff - {
|
|
152
|
-
selector: 'variable',
|
|
153
|
-
types: ['boolean'],
|
|
154
|
-
format: ['PascalCase'],
|
|
155
|
-
prefix: [
|
|
156
|
-
'is',
|
|
157
|
-
'are',
|
|
158
|
-
'was',
|
|
159
|
-
'should',
|
|
160
|
-
'has',
|
|
161
|
-
'can',
|
|
162
|
-
'does',
|
|
163
|
-
'did',
|
|
164
|
-
'will',
|
|
165
|
-
'use',
|
|
166
|
-
'allow',
|
|
167
|
-
],
|
|
168
|
-
leadingUnderscore: 'forbid',
|
|
169
|
-
trailingUnderscore: 'forbid',
|
|
170
|
-
},
|
|
171
|
-
// this allows destructured boolean variable names to retain their original name
|
|
172
|
-
{
|
|
173
|
-
selector: 'variable',
|
|
174
|
-
types: ['boolean'],
|
|
175
|
-
modifiers: ['destructured'],
|
|
176
|
-
format: null,
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
selector: 'property',
|
|
180
|
-
types: ['boolean'],
|
|
181
|
-
format: ['PascalCase'],
|
|
182
|
-
prefix: ['is', 'are', 'was', 'should', 'has', 'can', 'did', 'will', 'use', 'allow'],
|
|
183
|
-
leadingUnderscore: 'allow',
|
|
184
|
-
trailingUnderscore: 'forbid',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
selector: 'parameterProperty',
|
|
188
|
-
types: ['boolean'],
|
|
189
|
-
format: ['PascalCase'],
|
|
190
|
-
prefix: [
|
|
191
|
-
'is',
|
|
192
|
-
'are',
|
|
193
|
-
'was',
|
|
194
|
-
'should',
|
|
195
|
-
'has',
|
|
196
|
-
'can',
|
|
197
|
-
'does',
|
|
198
|
-
'did',
|
|
199
|
-
'will',
|
|
200
|
-
'use',
|
|
201
|
-
'allow',
|
|
202
|
-
],
|
|
203
|
-
leadingUnderscore: 'forbid',
|
|
204
|
-
trailingUnderscore: 'forbid',
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
selector: 'accessor',
|
|
208
|
-
types: ['boolean'],
|
|
209
|
-
format: ['PascalCase'],
|
|
210
|
-
prefix: [
|
|
211
|
-
'is',
|
|
212
|
-
'are',
|
|
213
|
-
'was',
|
|
214
|
-
'should',
|
|
215
|
-
'has',
|
|
216
|
-
'can',
|
|
217
|
-
'does',
|
|
218
|
-
'did',
|
|
219
|
-
'will',
|
|
220
|
-
'use',
|
|
221
|
-
'allow',
|
|
222
|
-
],
|
|
223
|
-
leadingUnderscore: 'forbid',
|
|
224
|
-
trailingUnderscore: 'forbid',
|
|
225
|
-
}, */
|
|
226
|
-
// "member-like" (i.e. properties, methods, etc.) must use camel case, pascal case or upper case with only leading underscore allowed
|
|
227
|
-
{
|
|
228
|
-
selector: 'memberLike',
|
|
229
|
-
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
230
|
-
leadingUnderscore: 'allow',
|
|
231
|
-
trailingUnderscore: 'forbid',
|
|
232
|
-
filter: {
|
|
233
|
-
regex: '__typename',
|
|
234
|
-
match: false,
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
// "type-like" (i.e. interface, enum, etc.) must use pascal case
|
|
238
|
-
{
|
|
239
|
-
selector: 'typeLike',
|
|
240
|
-
format: ['PascalCase'],
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
'@typescript-eslint/no-base-to-string': 'off',
|
|
244
|
-
'@typescript-eslint/no-array-constructor': 'error',
|
|
245
|
-
'@typescript-eslint/no-confusing-non-null-assertion': 'off',
|
|
246
|
-
'@typescript-eslint/no-confusing-void-expression': [
|
|
247
|
-
'warn',
|
|
248
|
-
{
|
|
249
|
-
ignoreArrowShorthand: true,
|
|
250
|
-
ignoreVoidOperator: true,
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
|
-
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
254
|
-
'@typescript-eslint/no-duplicate-imports': 'error',
|
|
255
|
-
'@typescript-eslint/no-dynamic-delete': 'off',
|
|
256
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
257
|
-
'@typescript-eslint/no-empty-interface': 'warn',
|
|
258
|
-
'@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }],
|
|
259
|
-
'@typescript-eslint/no-extra-non-null-assertion': 'warn',
|
|
260
|
-
'@typescript-eslint/no-extra-parens': 'off',
|
|
261
|
-
'@typescript-eslint/no-extra-semi': 'off',
|
|
262
|
-
'@typescript-eslint/no-extraneous-class': [
|
|
263
|
-
'warn',
|
|
264
|
-
{
|
|
265
|
-
allowConstructorOnly: true,
|
|
266
|
-
allowEmpty: false,
|
|
267
|
-
allowStaticOnly: true,
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
'@typescript-eslint/no-floating-promises': 'off',
|
|
271
|
-
'@typescript-eslint/no-for-in-array': 'error',
|
|
272
|
-
'@typescript-eslint/no-implicit-any-catch': 'error',
|
|
273
|
-
'@typescript-eslint/no-implied-eval': 'error',
|
|
274
|
-
'@typescript-eslint/no-inferrable-types': [
|
|
275
|
-
'error',
|
|
276
|
-
{ ignoreParameters: false, ignoreProperties: false },
|
|
277
|
-
],
|
|
278
|
-
'@typescript-eslint/no-invalid-this': 'warn',
|
|
279
|
-
'@typescript-eslint/no-invalid-void-type': 'warn',
|
|
280
|
-
'@typescript-eslint/no-loop-func': 'warn',
|
|
281
|
-
'@typescript-eslint/no-loss-of-precision': 'warn',
|
|
282
|
-
'@typescript-eslint/no-magic-numbers': 'off',
|
|
283
|
-
'@typescript-eslint/no-misused-new': 'error',
|
|
284
|
-
'@typescript-eslint/no-misused-promises': ['error'],
|
|
285
|
-
'@typescript-eslint/no-namespace': 'warn',
|
|
286
|
-
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
287
|
-
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
288
|
-
'@typescript-eslint/no-parameter-properties': 'error',
|
|
289
|
-
'@typescript-eslint/no-redeclare': 'error',
|
|
290
|
-
'@typescript-eslint/no-require-imports': 'error',
|
|
291
|
-
'@typescript-eslint/no-shadow': ['warn', { allow: ['resolve, reject'] }],
|
|
292
|
-
'@typescript-eslint/no-this-alias': 'warn',
|
|
293
|
-
'@typescript-eslint/no-throw-literal': 'error',
|
|
294
|
-
'@typescript-eslint/no-type-alias': 'off',
|
|
295
|
-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
296
|
-
'@typescript-eslint/no-unnecessary-condition': ['error', { allowConstantLoopConditions: true }],
|
|
297
|
-
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
298
|
-
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
299
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
300
|
-
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
|
|
301
|
-
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
302
|
-
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
303
|
-
'@typescript-eslint/no-unsafe-call': 'error',
|
|
304
|
-
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
305
|
-
'@typescript-eslint/no-unsafe-return': 'error',
|
|
306
|
-
'@typescript-eslint/no-unused-expressions': 'error',
|
|
307
|
-
'@typescript-eslint/no-unused-vars': [
|
|
308
|
-
'error',
|
|
309
|
-
{ vars: 'all', args: 'none', ignoreRestSiblings: true },
|
|
310
|
-
],
|
|
311
|
-
'@typescript-eslint/no-use-before-define': [
|
|
312
|
-
'error',
|
|
313
|
-
{
|
|
314
|
-
functions: false,
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
318
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
319
|
-
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
|
|
320
|
-
'@typescript-eslint/object-curly-spacing': 'off',
|
|
321
|
-
'@typescript-eslint/prefer-as-const': 'error',
|
|
322
|
-
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
323
|
-
'@typescript-eslint/prefer-for-of': 'warn',
|
|
324
|
-
'@typescript-eslint/prefer-function-type': 'warn',
|
|
325
|
-
'@typescript-eslint/prefer-includes': 'warn',
|
|
326
|
-
'@typescript-eslint/prefer-literal-enum-member': 'warn',
|
|
327
|
-
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
328
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
329
|
-
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
330
|
-
'@typescript-eslint/prefer-readonly': 'warn',
|
|
331
|
-
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
332
|
-
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
333
|
-
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
334
|
-
'@typescript-eslint/prefer-return-this-type': 'warn',
|
|
335
|
-
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
|
|
336
|
-
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
337
|
-
'@typescript-eslint/promise-function-async': 'warn',
|
|
338
|
-
'@typescript-eslint/quotes': [
|
|
339
|
-
'error',
|
|
340
|
-
'single',
|
|
341
|
-
{ avoidEscape: true, allowTemplateLiterals: false },
|
|
342
|
-
],
|
|
343
|
-
'@typescript-eslint/require-array-sort-compare': 'warn',
|
|
344
|
-
'@typescript-eslint/require-await': 'error',
|
|
345
|
-
'@typescript-eslint/restrict-plus-operands': ['error', { checkCompoundAssignments: true }],
|
|
346
|
-
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
347
|
-
'@typescript-eslint/return-await': 'error',
|
|
348
|
-
'@typescript-eslint/semi': 'off',
|
|
349
|
-
'@typescript-eslint/sort-type-union-intersection-members': 'warn',
|
|
350
|
-
'@typescript-eslint/space-before-function-paren': 'off',
|
|
351
|
-
'@typescript-eslint/space-infix-ops': 'off',
|
|
352
|
-
'@typescript-eslint/strict-boolean-expressions': [
|
|
353
|
-
'warn',
|
|
354
|
-
{
|
|
355
|
-
allowNullableBoolean: true,
|
|
356
|
-
allowNullableString: true,
|
|
357
|
-
},
|
|
358
|
-
],
|
|
359
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
360
|
-
'@typescript-eslint/triple-slash-reference': [
|
|
361
|
-
'error',
|
|
362
|
-
{ path: 'never', types: 'never', lib: 'never' },
|
|
363
|
-
],
|
|
364
|
-
'@typescript-eslint/type-annotation-spacing': 'off',
|
|
365
|
-
'@typescript-eslint/typedef': 'off',
|
|
366
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
367
|
-
'@typescript-eslint/unified-signatures': 'error', // warns for any two overloads that could be unified into one by using a union or an optional/rest parameter
|
|
368
|
-
};
|
|
369
|
-
module.exports = config;
|
package/lib/rules/unicorn.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/rules/unicorn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,QAAA,MAAM,MAAM,EAAE,YAAY,CAAC,OAAO,CAuGjC,CAAC;AAEF,SAAS,MAAM,CAAC"}
|