@dfds-ui/eslint-config 2.0.29-alpha.87e7918e → 2.0.29-alpha.9a0ea182
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/eslint.config.js +80 -129
- package/package.json +2 -2
package/eslint.config.js
CHANGED
|
@@ -1,138 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// ESLint 9 flat config style exported via CommonJS for consumers still using require()
|
|
2
|
+
// This replaces the legacy object config with an array.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const js = require('@eslint/js')
|
|
5
|
+
const tsPlugin = require('@typescript-eslint/eslint-plugin')
|
|
6
|
+
const tsParser = require('@typescript-eslint/parser')
|
|
7
|
+
const react = require('eslint-plugin-react')
|
|
8
|
+
const reactHooks = require('eslint-plugin-react-hooks')
|
|
9
|
+
const importPlugin = require('eslint-plugin-import')
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
module.exports = [
|
|
12
|
+
{
|
|
13
|
+
ignores: [
|
|
14
|
+
'**/dist/**',
|
|
15
|
+
'**/coverage/**',
|
|
16
|
+
'**/storybook-static/**',
|
|
17
|
+
'**/*.d.ts',
|
|
18
|
+
'node_modules/**',
|
|
15
19
|
],
|
|
16
|
-
'no-extra-boolean-cast': 'off', // TODO: this will trigger in a few files. Consider enabling
|
|
17
20
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
js.configs.recommended,
|
|
22
|
+
{
|
|
23
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
24
|
+
languageOptions: {
|
|
25
|
+
parser: tsParser,
|
|
26
|
+
parserOptions: {
|
|
27
|
+
ecmaVersion: 'latest',
|
|
28
|
+
sourceType: 'module',
|
|
29
|
+
ecmaFeatures: { jsx: true },
|
|
30
|
+
},
|
|
22
31
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
32
|
+
plugins: {
|
|
33
|
+
'@typescript-eslint': tsPlugin,
|
|
34
|
+
react,
|
|
35
|
+
'react-hooks': reactHooks,
|
|
36
|
+
import: importPlugin,
|
|
27
37
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
typescript: { alwaysTryTypes: true },
|
|
38
|
+
settings: {
|
|
39
|
+
react: { version: 'detect' },
|
|
40
|
+
'import/resolver': { typescript: { alwaysTryTypes: true } },
|
|
31
41
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
rules: {
|
|
43
|
+
'no-irregular-whitespace': ['warn', { skipComments: true, skipRegExps: true, skipTemplates: true }],
|
|
44
|
+
'no-extra-boolean-cast': 'off',
|
|
45
|
+
'prefer-rest-params': 'off',
|
|
46
|
+
'no-console': 'warn',
|
|
47
|
+
'no-restricted-imports': ['error', { patterns: ['../**/src'] }],
|
|
48
|
+
'sort-imports': 'off',
|
|
49
|
+
'import/order': 'off',
|
|
50
|
+
'import/no-extraneous-dependencies': 'error',
|
|
51
|
+
'import/no-named-as-default-member': 'off',
|
|
52
|
+
'import/no-named-as-default': 'off',
|
|
53
|
+
'import/default': 'off',
|
|
54
|
+
'import/export': 'error',
|
|
55
|
+
'import/no-unresolved': 'error',
|
|
56
|
+
'import/namespace': ['error', { allowComputed: true }],
|
|
57
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
58
|
+
'@typescript-eslint/member-delimiter-style': [
|
|
59
|
+
'warn',
|
|
60
|
+
{ multiline: { delimiter: 'none', requireLast: false }, singleline: { delimiter: 'semi', requireLast: false } },
|
|
43
61
|
],
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'import/namespace': ['error', { allowComputed: true }],
|
|
66
|
-
|
|
67
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
68
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
69
|
-
'warn',
|
|
70
|
-
{
|
|
71
|
-
multiline: {
|
|
72
|
-
delimiter: 'none',
|
|
73
|
-
requireLast: false,
|
|
74
|
-
},
|
|
75
|
-
singleline: {
|
|
76
|
-
delimiter: 'semi',
|
|
77
|
-
requireLast: false,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
'@typescript-eslint/interface-name-prefix': ['warn', { prefixWithI: 'always' }],
|
|
82
|
-
'@typescript-eslint/no-use-before-define': 'off', // TODO: maybe enable this?
|
|
83
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
84
|
-
//TODO: use naming-convention
|
|
85
|
-
//'@typescript-eslint/camelcase': 'warn',
|
|
86
|
-
'@typescript-eslint/type-annotation-spacing': 'warn',
|
|
87
|
-
//TODO: use ban-ts-comment
|
|
88
|
-
//'@typescript-eslint/ban-ts-ignore': 'error',
|
|
89
|
-
|
|
90
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off', // TODO: TS4 consider enabling
|
|
91
|
-
'@typescript-eslint/no-unsafe-argument': 'off', // TODO: Consider eabling
|
|
92
|
-
'@typescript-eslint/no-unsafe-assignment': 'off', // TODO: TS4 consider enabling
|
|
93
|
-
'@typescript-eslint/no-unsafe-call': 'off', // TODO: TS4 consider enabling
|
|
94
|
-
'@typescript-eslint/no-unsafe-member-access': 'off', // TODO: TS4 consider enabling
|
|
95
|
-
'@typescript-eslint/no-unsafe-return': 'off', // TODO: TS4 consider enabling
|
|
96
|
-
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
97
|
-
'@typescript-eslint/no-misused-promises': 'error',
|
|
98
|
-
|
|
99
|
-
// TODO: enable this again when babel-lint supports it
|
|
100
|
-
// Using babel-eslint (v11 beta ATTOW) as the parser have issues with this rule so it's disabled
|
|
101
|
-
// The rule is currently covered by 'noUnusedLocals' in tsconfig.json
|
|
102
|
-
// https://github.com/babel/babel-eslint/milestone/1
|
|
103
|
-
'@typescript-eslint/no-unused-vars': [
|
|
104
|
-
'off',
|
|
105
|
-
{
|
|
106
|
-
vars: 'all',
|
|
107
|
-
args: 'after-used',
|
|
108
|
-
ignoreRestSiblings: false,
|
|
109
|
-
argsIgnorePattern: '^_',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
'react/display-name': 'off',
|
|
114
|
-
'react/prop-types': 'off',
|
|
115
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
116
|
-
'react-hooks/exhaustive-deps': 'warn',
|
|
117
|
-
'react/no-unescaped-entities': 'off', // TODO: maybe enable this?
|
|
118
|
-
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
119
|
-
'react/jsx-no-literals': 'off', // TODO: maybe enable this?
|
|
120
|
-
|
|
121
|
-
'deprecation/deprecation': 'warn',
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
// javascript overrides
|
|
125
|
-
{
|
|
126
|
-
files: ['*.js'],
|
|
127
|
-
env: {
|
|
128
|
-
node: true,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
files: ['scripts/jest/setup.js'],
|
|
133
|
-
env: {
|
|
134
|
-
browser: true,
|
|
135
|
-
},
|
|
62
|
+
'@typescript-eslint/interface-name-prefix': ['warn', { prefixWithI: 'always' }],
|
|
63
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
64
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
65
|
+
'@typescript-eslint/type-annotation-spacing': 'warn',
|
|
66
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
67
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
68
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
69
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
70
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
71
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
72
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
73
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
74
|
+
'@typescript-eslint/no-unused-vars': ['off'],
|
|
75
|
+
'react/display-name': 'off',
|
|
76
|
+
'react/prop-types': 'off',
|
|
77
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
78
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
79
|
+
'react/no-unescaped-entities': 'off',
|
|
80
|
+
'react/no-unknown-property': ['error', { ignore: ['css'] }],
|
|
81
|
+
'react/jsx-no-literals': 'off',
|
|
82
|
+
// deprecation plugin temporarily removed pending ESLint 9 compatible release
|
|
136
83
|
},
|
|
137
|
-
|
|
138
|
-
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
files: ['**/*.js'],
|
|
87
|
+
languageOptions: { ecmaVersion: 'latest', sourceType: 'module' },
|
|
88
|
+
},
|
|
89
|
+
]
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.0.29-alpha.
|
|
8
|
+
"version": "2.0.29-alpha.9a0ea182",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
|
11
11
|
"@typescript-eslint/parser": "^5.40.1",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
23
23
|
"prettier": "2.7.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "9a0ea1821df447249363a38ea548ce565163e1c3"
|
|
26
26
|
}
|