@interface-technologies/eslint-config 0.4.3 → 0.4.7
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 +1 -1
- package/{index.js → index.cjs} +153 -140
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
See https://srmagura.github.io/iti-react/.
|
|
1
|
+
See https://srmagura.github.io/iti-react/.
|
package/{index.js → index.cjs}
RENAMED
|
@@ -1,140 +1,153 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: './tsconfig.json',
|
|
5
|
-
tsconfigRootDir: '.',
|
|
6
|
-
ecmaVersion:
|
|
7
|
-
sourceType: 'module',
|
|
8
|
-
},
|
|
9
|
-
extends: [
|
|
10
|
-
'airbnb',
|
|
11
|
-
'airbnb-typescript',
|
|
12
|
-
'airbnb/hooks',
|
|
13
|
-
'plugin:promise/recommended',
|
|
14
|
-
'plugin:jest/recommended',
|
|
15
|
-
'plugin:jest-dom/recommended',
|
|
16
|
-
'plugin:testing-library/react',
|
|
17
|
-
'plugin:@typescript-eslint/recommended',
|
|
18
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
19
|
-
'prettier',
|
|
20
|
-
],
|
|
21
|
-
plugins: ['promise', '@typescript-eslint', 'jest', 'jest-dom', 'testing-library'],
|
|
22
|
-
ignorePatterns: ['*.js', '*.cjs'],
|
|
23
|
-
settings: {
|
|
24
|
-
'import/resolver': {
|
|
25
|
-
typescript: {},
|
|
26
|
-
},
|
|
27
|
-
'testing-library/custom-renders': 'off',
|
|
28
|
-
},
|
|
29
|
-
rules: {
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'no-
|
|
34
|
-
'no-
|
|
35
|
-
'no-
|
|
36
|
-
'no-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'no-
|
|
58
|
-
'no-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
'@typescript-eslint/no-
|
|
67
|
-
'@typescript-eslint/no-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'@typescript-eslint/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
'import/
|
|
94
|
-
'import/
|
|
95
|
-
'import/default': 'off',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
'
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
'
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
'
|
|
139
|
-
|
|
140
|
-
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: '@typescript-eslint/parser',
|
|
3
|
+
parserOptions: {
|
|
4
|
+
project: './tsconfig.json',
|
|
5
|
+
tsconfigRootDir: '.',
|
|
6
|
+
ecmaVersion: 2019,
|
|
7
|
+
sourceType: 'module',
|
|
8
|
+
},
|
|
9
|
+
extends: [
|
|
10
|
+
'airbnb',
|
|
11
|
+
'airbnb-typescript',
|
|
12
|
+
'airbnb/hooks',
|
|
13
|
+
'plugin:promise/recommended',
|
|
14
|
+
'plugin:jest/recommended',
|
|
15
|
+
'plugin:jest-dom/recommended',
|
|
16
|
+
'plugin:testing-library/react',
|
|
17
|
+
'plugin:@typescript-eslint/recommended',
|
|
18
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
19
|
+
'prettier',
|
|
20
|
+
],
|
|
21
|
+
plugins: ['promise', '@typescript-eslint', 'jest', 'jest-dom', 'testing-library'],
|
|
22
|
+
ignorePatterns: ['*.js', '*.cjs', 'dist/'],
|
|
23
|
+
settings: {
|
|
24
|
+
'import/resolver': {
|
|
25
|
+
typescript: {},
|
|
26
|
+
},
|
|
27
|
+
'testing-library/custom-renders': 'off',
|
|
28
|
+
},
|
|
29
|
+
rules: {
|
|
30
|
+
'default-case': 'off',
|
|
31
|
+
'max-classes-per-file': 'off',
|
|
32
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
33
|
+
'no-continue': 'off',
|
|
34
|
+
'no-param-reassign': 'off',
|
|
35
|
+
'no-plusplus': 'off',
|
|
36
|
+
'no-restricted-syntax': [
|
|
37
|
+
'error',
|
|
38
|
+
// Options from https://github.com/airbnb/javascript/blob/651280e5a22d08170187bea9a2b1697832c87ebc/packages/eslint-config-airbnb-base/rules/style.js
|
|
39
|
+
// with for-of removed
|
|
40
|
+
{
|
|
41
|
+
selector: 'ForInStatement',
|
|
42
|
+
message:
|
|
43
|
+
'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
selector: 'LabeledStatement',
|
|
47
|
+
message:
|
|
48
|
+
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
selector: 'WithStatement',
|
|
52
|
+
message:
|
|
53
|
+
'`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
'no-shadow': 'off',
|
|
57
|
+
'no-underscore-dangle': 'off',
|
|
58
|
+
'no-void': 'off',
|
|
59
|
+
radix: 'off',
|
|
60
|
+
|
|
61
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
62
|
+
'warn',
|
|
63
|
+
{ allowExpressions: true },
|
|
64
|
+
],
|
|
65
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
66
|
+
'@typescript-eslint/no-shadow': 'off',
|
|
67
|
+
'@typescript-eslint/no-use-before-define': [
|
|
68
|
+
'error',
|
|
69
|
+
{ functions: false, classes: false },
|
|
70
|
+
],
|
|
71
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
72
|
+
'@typescript-eslint/naming-convention': [
|
|
73
|
+
'error',
|
|
74
|
+
{
|
|
75
|
+
selector: 'variable',
|
|
76
|
+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
77
|
+
leadingUnderscore: 'allow',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
selector: 'function',
|
|
81
|
+
format: ['camelCase', 'PascalCase'],
|
|
82
|
+
leadingUnderscore: 'allow',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
selector: 'typeLike',
|
|
86
|
+
format: ['PascalCase'],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
|
|
90
|
+
// TypeScript already checks these things, see:
|
|
91
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
|
|
92
|
+
'import/named': 'off',
|
|
93
|
+
'import/namespace': 'off',
|
|
94
|
+
'import/default': 'off',
|
|
95
|
+
'import/no-named-as-default-member': 'off',
|
|
96
|
+
|
|
97
|
+
'import/no-extraneous-dependencies': [
|
|
98
|
+
'error',
|
|
99
|
+
{
|
|
100
|
+
devDependencies: [
|
|
101
|
+
'**/*.test.ts?(x)',
|
|
102
|
+
'**/*.stories.ts?(x)',
|
|
103
|
+
'**/__devHelpers__/**/*',
|
|
104
|
+
'**/__DevHelpers__/**/*',
|
|
105
|
+
'**/__testHelpers__/**/*',
|
|
106
|
+
'**/__TestHelpers__/**/*',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
|
|
111
|
+
'import/prefer-default-export': 'off',
|
|
112
|
+
|
|
113
|
+
'jsx-a11y/label-has-associated-control': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
controlComponents: [
|
|
117
|
+
'DateInput',
|
|
118
|
+
'PhoneInput',
|
|
119
|
+
'TimeZoneInput',
|
|
120
|
+
'ValidatedInput',
|
|
121
|
+
'ValidatedAsyncSelect',
|
|
122
|
+
'ValidatedSelect',
|
|
123
|
+
'ValidatedMultiSelect',
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
|
|
128
|
+
'react/destructuring-assignment': 'off',
|
|
129
|
+
'react/jsx-props-no-spreading': 'off',
|
|
130
|
+
'react/prop-types': 'off',
|
|
131
|
+
'react/require-default-props': 'off',
|
|
132
|
+
'react/state-in-constructor': 'off',
|
|
133
|
+
'react/static-property-placement': ['error', 'static public field'],
|
|
134
|
+
'react/no-did-update-set-state': 'off',
|
|
135
|
+
'react/jsx-no-bind': 'off',
|
|
136
|
+
|
|
137
|
+
// Unnecessary because of new JSX transform
|
|
138
|
+
'react/jsx-uses-react': 'off',
|
|
139
|
+
'react/react-in-jsx-scope': 'off',
|
|
140
|
+
|
|
141
|
+
'jest/expect-expect': [
|
|
142
|
+
'error',
|
|
143
|
+
{
|
|
144
|
+
assertFunctionNames: ['expect', 'expect*'],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
|
|
148
|
+
'testing-library/no-node-access': 'off',
|
|
149
|
+
'testing-library/prefer-user-event': 'warn',
|
|
150
|
+
'testing-library/no-await-sync-events': 'error',
|
|
151
|
+
'testing-library/prefer-explicit-assert': 'warn',
|
|
152
|
+
},
|
|
153
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interface-technologies/eslint-config",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "ESLint config for projects using TypeScript and React.",
|
|
5
5
|
"homepage": "https://github.com/srmagura/iti-react",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Interface Technologies, Inc."
|
|
9
9
|
},
|
|
10
|
-
"main": "index.
|
|
10
|
+
"main": "index.cjs",
|
|
11
11
|
"files": [
|
|
12
|
-
"index.
|
|
12
|
+
"index.cjs"
|
|
13
13
|
],
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@typescript-eslint/eslint-plugin": ">=4.33.0",
|
|
16
16
|
"@typescript-eslint/parser": ">=4.33.0",
|
|
17
17
|
"eslint": ">=7.32.0",
|
|
18
|
-
"eslint-config-airbnb": "
|
|
19
|
-
"eslint-config-airbnb-typescript": "
|
|
18
|
+
"eslint-config-airbnb": ">=18.2.1",
|
|
19
|
+
"eslint-config-airbnb-typescript": ">=14.0.0",
|
|
20
20
|
"eslint-config-prettier": ">=8.3.0",
|
|
21
21
|
"eslint-import-resolver-typescript": ">=2.5.0",
|
|
22
22
|
"eslint-plugin-import": ">=2.24.2",
|