@interface-technologies/eslint-config 0.4.1 → 0.4.5

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.
Files changed (2) hide show
  1. package/index.js +152 -136
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -1,136 +1,152 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- project: './tsconfig.json',
5
- tsconfigRootDir: '.',
6
- ecmaVersion: 2017,
7
- sourceType: 'module',
8
- },
9
- extends: [
10
- 'airbnb',
11
- 'airbnb-typescript',
12
- 'airbnb/hooks',
13
- 'plugin:promise/recommended',
14
- 'plugin:jest/recommended',
15
- 'plugin:testing-library/react',
16
- 'plugin:@typescript-eslint/recommended',
17
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
18
- 'prettier',
19
- ],
20
- plugins: ['promise', '@typescript-eslint', 'jest', 'testing-library'],
21
- ignorePatterns: ['*.js', '*.cjs'],
22
- settings: {
23
- 'import/resolver': {
24
- typescript: {},
25
- },
26
- 'testing-library/custom-renders': 'off',
27
- },
28
- rules: {
29
- 'consistent-return': 'off',
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/prefer-default-export': 'off',
98
-
99
- 'jsx-a11y/label-has-associated-control': [
100
- 'error',
101
- {
102
- controlComponents: [
103
- 'DateInput',
104
- 'PhoneInput',
105
- 'TimeZoneInput',
106
- 'ValidatedInput',
107
- 'ValidatedAsyncSelect',
108
- 'ValidatedSelect',
109
- 'ValidatedMultiSelect',
110
- ],
111
- },
112
- ],
113
-
114
- 'react/destructuring-assignment': 'off',
115
- 'react/jsx-props-no-spreading': 'off',
116
- 'react/prop-types': 'off',
117
- 'react/require-default-props': 'off',
118
- 'react/state-in-constructor': 'off',
119
- 'react/static-property-placement': ['error', 'static public field'],
120
- 'react/no-did-update-set-state': 'off',
121
- 'react/jsx-no-bind': 'off',
122
-
123
- // Unnecessary because of new JSX transform
124
- 'react/jsx-uses-react': 'off',
125
- 'react/react-in-jsx-scope': 'off',
126
-
127
- 'jest/expect-expect': [
128
- 'error',
129
- {
130
- assertFunctionNames: ['expect', 'expect*'],
131
- },
132
- ],
133
-
134
- 'testing-library/no-node-access': 'off',
135
- },
136
- }
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ project: './tsconfig.json',
5
+ tsconfigRootDir: '.',
6
+ ecmaVersion: 2017,
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
+ 'consistent-return': 'off',
31
+ 'default-case': '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': ['error', { allowForLoopAfterthoughts: true }],
37
+ 'no-restricted-syntax': [
38
+ 'error',
39
+ // Options from https://github.com/airbnb/javascript/blob/651280e5a22d08170187bea9a2b1697832c87ebc/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
+ '@typescript-eslint/explicit-function-return-type': [
63
+ 'warn',
64
+ { allowExpressions: true },
65
+ ],
66
+ '@typescript-eslint/no-non-null-assertion': 'off',
67
+ '@typescript-eslint/no-shadow': 'off',
68
+ '@typescript-eslint/no-use-before-define': [
69
+ 'error',
70
+ { functions: false, classes: false },
71
+ ],
72
+ '@typescript-eslint/unbound-method': 'off',
73
+ '@typescript-eslint/naming-convention': [
74
+ 'error',
75
+ {
76
+ selector: 'variable',
77
+ format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
78
+ leadingUnderscore: 'allow',
79
+ },
80
+ {
81
+ selector: 'function',
82
+ format: ['camelCase', 'PascalCase'],
83
+ leadingUnderscore: 'allow',
84
+ },
85
+ {
86
+ selector: 'typeLike',
87
+ format: ['PascalCase'],
88
+ },
89
+ ],
90
+
91
+ // TypeScript already checks these things, see:
92
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
93
+ 'import/named': 'off',
94
+ 'import/namespace': 'off',
95
+ 'import/default': 'off',
96
+ 'import/no-named-as-default-member': 'off',
97
+
98
+ 'import/no-extraneous-dependencies': [
99
+ 'error',
100
+ {
101
+ devDependencies: [
102
+ '**/*.test.ts?(x)',
103
+ '**/*.stories.ts?(x)',
104
+ '**/__DevHelpers__/**/*',
105
+ '**/__TestHelpers__/**/*',
106
+ ],
107
+ },
108
+ ],
109
+
110
+ 'import/prefer-default-export': 'off',
111
+
112
+ 'jsx-a11y/label-has-associated-control': [
113
+ 'error',
114
+ {
115
+ controlComponents: [
116
+ 'DateInput',
117
+ 'PhoneInput',
118
+ 'TimeZoneInput',
119
+ 'ValidatedInput',
120
+ 'ValidatedAsyncSelect',
121
+ 'ValidatedSelect',
122
+ 'ValidatedMultiSelect',
123
+ ],
124
+ },
125
+ ],
126
+
127
+ 'react/destructuring-assignment': 'off',
128
+ 'react/jsx-props-no-spreading': 'off',
129
+ 'react/prop-types': 'off',
130
+ 'react/require-default-props': 'off',
131
+ 'react/state-in-constructor': 'off',
132
+ 'react/static-property-placement': ['error', 'static public field'],
133
+ 'react/no-did-update-set-state': 'off',
134
+ 'react/jsx-no-bind': 'off',
135
+
136
+ // Unnecessary because of new JSX transform
137
+ 'react/jsx-uses-react': 'off',
138
+ 'react/react-in-jsx-scope': 'off',
139
+
140
+ 'jest/expect-expect': [
141
+ 'error',
142
+ {
143
+ assertFunctionNames: ['expect', 'expect*'],
144
+ },
145
+ ],
146
+
147
+ 'testing-library/no-node-access': 'off',
148
+ 'testing-library/prefer-user-event': 'warn',
149
+ 'testing-library/no-await-sync-events': 'error',
150
+ 'testing-library/prefer-explicit-assert': 'warn',
151
+ },
152
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interface-technologies/eslint-config",
3
- "version": "0.4.1",
3
+ "version": "0.4.5",
4
4
  "description": "ESLint config for projects using TypeScript and React.",
5
5
  "homepage": "https://github.com/srmagura/iti-react",
6
6
  "license": "MIT",
@@ -21,6 +21,7 @@
21
21
  "eslint-import-resolver-typescript": ">=2.5.0",
22
22
  "eslint-plugin-import": ">=2.24.2",
23
23
  "eslint-plugin-jest": ">=24.5.2",
24
+ "eslint-plugin-jest-dom": ">=3.9.2",
24
25
  "eslint-plugin-jsx-a11y": ">=6.4.1",
25
26
  "eslint-plugin-promise": ">=5.1.0",
26
27
  "eslint-plugin-react": ">=7.26.1",