@interface-technologies/eslint-config 4.3.12 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,3 @@
1
- ## 4.3.4
2
-
3
- - Disable `@typescript-eslint/no-misused-promises`
1
+ ## 4.3.4
2
+
3
+ - Disable `@typescript-eslint/no-misused-promises`
package/README.md CHANGED
@@ -1 +1 @@
1
- See https://srmagura.github.io/iti-react/.
1
+ See https://srmagura.github.io/iti-react/.
package/index.cjs CHANGED
@@ -1,182 +1,182 @@
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', '*.d.ts', 'dist/'],
23
- settings: {
24
- 'import/resolver': {
25
- typescript: {},
26
- },
27
- 'testing-library/custom-renders': 'off',
28
- },
29
- rules: {
30
- 'default-case': 'off',
31
- 'default-case-last': 'off',
32
- 'max-classes-per-file': 'off',
33
- 'no-console': ['error', { allow: ['warn', 'error'] }],
34
- 'no-continue': 'off',
35
- 'no-param-reassign': 'off',
36
- 'no-plusplus': 'off',
37
- 'no-restricted-syntax': [
38
- 'error',
39
- // Options from https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
40
- // with for-of removed
41
- {
42
- selector: 'ForInStatement',
43
- message:
44
- '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.',
45
- },
46
- {
47
- selector: 'LabeledStatement',
48
- message:
49
- 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
50
- },
51
- {
52
- selector: 'WithStatement',
53
- message:
54
- '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
55
- },
56
- ],
57
- 'no-shadow': 'off',
58
- 'no-underscore-dangle': 'off',
59
- 'no-void': 'off',
60
- radix: 'off',
61
-
62
- 'no-restricted-imports': [
63
- 'error',
64
- {
65
- paths: [
66
- {
67
- name: 'react-router-dom',
68
- importNames: ['useLocation'],
69
- message: 'Use location from useReady instead.',
70
- },
71
- ],
72
- },
73
- ],
74
-
75
- '@typescript-eslint/explicit-function-return-type': [
76
- 'warn',
77
- { allowExpressions: true },
78
- ],
79
-
80
- // Annoying without adding much real value
81
- '@typescript-eslint/no-misused-promises': 'off',
82
-
83
- '@typescript-eslint/no-non-null-assertion': 'off',
84
- '@typescript-eslint/no-shadow': 'off',
85
- '@typescript-eslint/no-use-before-define': [
86
- 'error',
87
- { functions: false, classes: false },
88
- ],
89
- '@typescript-eslint/unbound-method': 'off',
90
- '@typescript-eslint/naming-convention': [
91
- 'error',
92
- {
93
- selector: 'variable',
94
- format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
95
- leadingUnderscore: 'allow',
96
- },
97
- {
98
- selector: 'function',
99
- format: ['camelCase', 'PascalCase'],
100
- leadingUnderscore: 'allow',
101
- },
102
- {
103
- selector: 'typeLike',
104
- format: ['PascalCase'],
105
- },
106
- ],
107
-
108
- // TypeScript already checks these things, see:
109
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
110
- 'import/named': 'off',
111
- 'import/namespace': 'off',
112
- 'import/default': 'off',
113
- 'import/no-named-as-default-member': 'off',
114
-
115
- 'import/no-extraneous-dependencies': [
116
- 'error',
117
- {
118
- devDependencies: [
119
- '**/*.test.ts?(x)',
120
- '**/*.stories.ts?(x)',
121
- '**/__devHelpers__/**/*',
122
- '**/__testHelpers__/**/*',
123
- ],
124
- },
125
- ],
126
-
127
- 'import/prefer-default-export': 'off',
128
-
129
- 'jsx-a11y/label-has-associated-control': [
130
- 'error',
131
- {
132
- controlComponents: [
133
- 'DateInput',
134
- 'PhoneInput',
135
- 'TimeZoneInput',
136
- 'ValidatedInput',
137
- 'ValidatedAsyncSelect',
138
- 'ValidatedSelect',
139
- 'ValidatedMultiSelect',
140
- ],
141
- },
142
- ],
143
-
144
- 'react/destructuring-assignment': 'off',
145
- 'react/jsx-props-no-spreading': 'off',
146
- 'react/prop-types': 'off',
147
- 'react/function-component-definition': [
148
- 'error',
149
- { unnamedComponents: 'arrow-function' },
150
- ],
151
- 'react/require-default-props': 'off',
152
- 'react/state-in-constructor': 'off',
153
- 'react/static-property-placement': ['error', 'static public field'],
154
- 'react/no-did-update-set-state': 'off',
155
- 'react/jsx-no-bind': 'off',
156
-
157
- // Unnecessary because of new JSX transform
158
- 'react/jsx-uses-react': 'off',
159
- 'react/react-in-jsx-scope': 'off',
160
-
161
- 'jest/expect-expect': [
162
- 'error',
163
- {
164
- assertFunctionNames: ['expect', 'expect*'],
165
- },
166
- ],
167
-
168
- 'testing-library/no-node-access': 'off',
169
- 'testing-library/prefer-user-event': 'warn',
170
- 'testing-library/no-await-sync-events': 'error',
171
- 'testing-library/prefer-explicit-assert': 'warn',
172
- },
173
- overrides: [
174
- // Allow using `const Basic: React.VFC = () => <div />` syntax in stories
175
- {
176
- files: ['*.stories.tsx'],
177
- rules: {
178
- 'react/function-component-definition': 'off',
179
- },
180
- },
181
- ],
182
- }
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', '*.d.ts', 'dist/'],
23
+ settings: {
24
+ 'import/resolver': {
25
+ typescript: {},
26
+ },
27
+ 'testing-library/custom-renders': 'off',
28
+ },
29
+ rules: {
30
+ 'default-case': 'off',
31
+ 'default-case-last': 'off',
32
+ 'max-classes-per-file': 'off',
33
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
34
+ 'no-continue': 'off',
35
+ 'no-param-reassign': 'off',
36
+ 'no-plusplus': 'off',
37
+ 'no-restricted-syntax': [
38
+ 'error',
39
+ // Options from https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
40
+ // with for-of removed
41
+ {
42
+ selector: 'ForInStatement',
43
+ message:
44
+ '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.',
45
+ },
46
+ {
47
+ selector: 'LabeledStatement',
48
+ message:
49
+ 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
50
+ },
51
+ {
52
+ selector: 'WithStatement',
53
+ message:
54
+ '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
55
+ },
56
+ ],
57
+ 'no-shadow': 'off',
58
+ 'no-underscore-dangle': 'off',
59
+ 'no-void': 'off',
60
+ radix: 'off',
61
+
62
+ 'no-restricted-imports': [
63
+ 'error',
64
+ {
65
+ paths: [
66
+ {
67
+ name: 'react-router-dom',
68
+ importNames: ['useLocation'],
69
+ message: 'Use location from useReady instead.',
70
+ },
71
+ ],
72
+ },
73
+ ],
74
+
75
+ '@typescript-eslint/explicit-function-return-type': [
76
+ 'warn',
77
+ { allowExpressions: true },
78
+ ],
79
+
80
+ // Annoying without adding much real value
81
+ '@typescript-eslint/no-misused-promises': 'off',
82
+
83
+ '@typescript-eslint/no-non-null-assertion': 'off',
84
+ '@typescript-eslint/no-shadow': 'off',
85
+ '@typescript-eslint/no-use-before-define': [
86
+ 'error',
87
+ { functions: false, classes: false },
88
+ ],
89
+ '@typescript-eslint/unbound-method': 'off',
90
+ '@typescript-eslint/naming-convention': [
91
+ 'error',
92
+ {
93
+ selector: 'variable',
94
+ format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
95
+ leadingUnderscore: 'allow',
96
+ },
97
+ {
98
+ selector: 'function',
99
+ format: ['camelCase', 'PascalCase'],
100
+ leadingUnderscore: 'allow',
101
+ },
102
+ {
103
+ selector: 'typeLike',
104
+ format: ['PascalCase'],
105
+ },
106
+ ],
107
+
108
+ // TypeScript already checks these things, see:
109
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
110
+ 'import/named': 'off',
111
+ 'import/namespace': 'off',
112
+ 'import/default': 'off',
113
+ 'import/no-named-as-default-member': 'off',
114
+
115
+ 'import/no-extraneous-dependencies': [
116
+ 'error',
117
+ {
118
+ devDependencies: [
119
+ '**/*.test.ts?(x)',
120
+ '**/*.stories.ts?(x)',
121
+ '**/__devHelpers__/**/*',
122
+ '**/__testHelpers__/**/*',
123
+ ],
124
+ },
125
+ ],
126
+
127
+ 'import/prefer-default-export': 'off',
128
+
129
+ 'jsx-a11y/label-has-associated-control': [
130
+ 'error',
131
+ {
132
+ controlComponents: [
133
+ 'DateInput',
134
+ 'PhoneInput',
135
+ 'TimeZoneInput',
136
+ 'ValidatedInput',
137
+ 'ValidatedAsyncSelect',
138
+ 'ValidatedSelect',
139
+ 'ValidatedMultiSelect',
140
+ ],
141
+ },
142
+ ],
143
+
144
+ 'react/destructuring-assignment': 'off',
145
+ 'react/jsx-props-no-spreading': 'off',
146
+ 'react/prop-types': 'off',
147
+ 'react/function-component-definition': [
148
+ 'error',
149
+ { unnamedComponents: 'arrow-function' },
150
+ ],
151
+ 'react/require-default-props': 'off',
152
+ 'react/state-in-constructor': 'off',
153
+ 'react/static-property-placement': ['error', 'static public field'],
154
+ 'react/no-did-update-set-state': 'off',
155
+ 'react/jsx-no-bind': 'off',
156
+
157
+ // Unnecessary because of new JSX transform
158
+ 'react/jsx-uses-react': 'off',
159
+ 'react/react-in-jsx-scope': 'off',
160
+
161
+ 'jest/expect-expect': [
162
+ 'error',
163
+ {
164
+ assertFunctionNames: ['expect', 'expect*'],
165
+ },
166
+ ],
167
+
168
+ 'testing-library/no-node-access': 'off',
169
+ 'testing-library/prefer-user-event': 'warn',
170
+ 'testing-library/no-await-sync-events': 'error',
171
+ 'testing-library/prefer-explicit-assert': 'warn',
172
+ },
173
+ overrides: [
174
+ // Allow using `const Basic: React.VFC = () => <div />` syntax in stories
175
+ {
176
+ files: ['*.stories.tsx'],
177
+ rules: {
178
+ 'react/function-component-definition': 'off',
179
+ },
180
+ },
181
+ ],
182
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interface-technologies/eslint-config",
3
- "version": "4.3.12",
3
+ "version": "4.6.0",
4
4
  "description": "ESLint config for projects using TypeScript and React.",
5
5
  "homepage": "https://github.com/srmagura/iti-react",
6
6
  "license": "MIT",