@dfds-ui/eslint-config 2.0.29-alpha.9a0ea182 → 2.0.29-alpha.aacdeb08
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 +129 -80
- package/package.json +2 -2
package/eslint.config.js
CHANGED
|
@@ -1,89 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
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')
|
|
4
|
+
parser: '@typescript-eslint/parser',
|
|
5
|
+
extends: ['eslint:recommended'],
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
rules: {
|
|
8
|
+
'no-irregular-whitespace': [
|
|
9
|
+
'warn',
|
|
10
|
+
{
|
|
11
|
+
skipComments: true,
|
|
12
|
+
skipRegExps: true,
|
|
13
|
+
skipTemplates: true,
|
|
14
|
+
},
|
|
19
15
|
],
|
|
16
|
+
'no-extra-boolean-cast': 'off', // TODO: this will trigger in a few files. Consider enabling
|
|
20
17
|
},
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
parser: tsParser,
|
|
26
|
-
parserOptions: {
|
|
27
|
-
ecmaVersion: 'latest',
|
|
28
|
-
sourceType: 'module',
|
|
29
|
-
ecmaFeatures: { jsx: true },
|
|
30
|
-
},
|
|
18
|
+
|
|
19
|
+
settings: {
|
|
20
|
+
react: {
|
|
21
|
+
version: 'detect',
|
|
31
22
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
import: importPlugin,
|
|
23
|
+
'import/extensions': ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
|
|
24
|
+
|
|
25
|
+
'import/parsers': {
|
|
26
|
+
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
|
|
37
27
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
|
|
29
|
+
'import/resolver': {
|
|
30
|
+
typescript: { alwaysTryTypes: true },
|
|
41
31
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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 } },
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
overrides: [
|
|
35
|
+
// typescript overrides
|
|
36
|
+
{
|
|
37
|
+
files: ['*.ts', '*.tsx'],
|
|
38
|
+
plugins: ['@typescript-eslint', 'react-hooks', 'simple-import-sort', 'import', 'deprecation'],
|
|
39
|
+
extends: [
|
|
40
|
+
'plugin:@typescript-eslint/recommended',
|
|
41
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
42
|
+
'plugin:react/recommended',
|
|
61
43
|
],
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
44
|
+
rules: {
|
|
45
|
+
'prefer-rest-params': 'off',
|
|
46
|
+
'no-console': 'warn',
|
|
47
|
+
// prevent import of modules from other packages in the workspace using relative paths
|
|
48
|
+
'no-restricted-imports': [
|
|
49
|
+
'error',
|
|
50
|
+
{
|
|
51
|
+
patterns: ['../**/src'],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
|
|
55
|
+
// Ordering of imports
|
|
56
|
+
'sort-imports': 'off', // turned off since we use simple-import-sort to handle ordering
|
|
57
|
+
'import/order': 'off', // turned off since we use simple-import-sort to handle ordering
|
|
58
|
+
'simple-import-sort/sort': 'off',
|
|
59
|
+
'import/no-extraneous-dependencies': 'error',
|
|
60
|
+
'import/no-named-as-default-member': 'off', // TODO: consider enable this?
|
|
61
|
+
'import/no-named-as-default': 'off', // TODO: consider enable this?
|
|
62
|
+
'import/default': 'off',
|
|
63
|
+
'import/export': 'error',
|
|
64
|
+
'import/no-unresolved': ['error'],
|
|
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
|
+
},
|
|
83
123
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
+
},
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
}
|
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.aacdeb08",
|
|
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": "aacdeb08c6f57b4e911907e646cf4b19c13811f0"
|
|
26
26
|
}
|