@interface-technologies/eslint-config 0.4.7 → 4.0.0-alpha.2

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.cjs +29 -4
  2. package/package.json +13 -13
package/index.cjs CHANGED
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'prettier',
20
20
  ],
21
21
  plugins: ['promise', '@typescript-eslint', 'jest', 'jest-dom', 'testing-library'],
22
- ignorePatterns: ['*.js', '*.cjs', 'dist/'],
22
+ ignorePatterns: ['*.js', '*.cjs', '*.d.ts', 'dist/'],
23
23
  settings: {
24
24
  'import/resolver': {
25
25
  typescript: {},
@@ -28,6 +28,7 @@ module.exports = {
28
28
  },
29
29
  rules: {
30
30
  'default-case': 'off',
31
+ 'default-case-last': 'off',
31
32
  'max-classes-per-file': 'off',
32
33
  'no-console': ['error', { allow: ['warn', 'error'] }],
33
34
  'no-continue': 'off',
@@ -35,7 +36,7 @@ module.exports = {
35
36
  'no-plusplus': 'off',
36
37
  'no-restricted-syntax': [
37
38
  'error',
38
- // Options from https://github.com/airbnb/javascript/blob/651280e5a22d08170187bea9a2b1697832c87ebc/packages/eslint-config-airbnb-base/rules/style.js
39
+ // Options from https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
39
40
  // with for-of removed
40
41
  {
41
42
  selector: 'ForInStatement',
@@ -58,6 +59,19 @@ module.exports = {
58
59
  'no-void': 'off',
59
60
  radix: 'off',
60
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
+
61
75
  '@typescript-eslint/explicit-function-return-type': [
62
76
  'warn',
63
77
  { allowExpressions: true },
@@ -101,9 +115,7 @@ module.exports = {
101
115
  '**/*.test.ts?(x)',
102
116
  '**/*.stories.ts?(x)',
103
117
  '**/__devHelpers__/**/*',
104
- '**/__DevHelpers__/**/*',
105
118
  '**/__testHelpers__/**/*',
106
- '**/__TestHelpers__/**/*',
107
119
  ],
108
120
  },
109
121
  ],
@@ -128,6 +140,10 @@ module.exports = {
128
140
  'react/destructuring-assignment': 'off',
129
141
  'react/jsx-props-no-spreading': 'off',
130
142
  'react/prop-types': 'off',
143
+ 'react/function-component-definition': [
144
+ 'error',
145
+ { unnamedComponents: 'arrow-function' },
146
+ ],
131
147
  'react/require-default-props': 'off',
132
148
  'react/state-in-constructor': 'off',
133
149
  'react/static-property-placement': ['error', 'static public field'],
@@ -150,4 +166,13 @@ module.exports = {
150
166
  'testing-library/no-await-sync-events': 'error',
151
167
  'testing-library/prefer-explicit-assert': 'warn',
152
168
  },
169
+ overrides: [
170
+ // Allow using `const Basic: React.VFC = () => <div />` syntax in stories
171
+ {
172
+ files: ['*.stories.tsx'],
173
+ rules: {
174
+ 'react/function-component-definition': 'off',
175
+ },
176
+ },
177
+ ],
153
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interface-technologies/eslint-config",
3
- "version": "0.4.7",
3
+ "version": "4.0.0-alpha.2",
4
4
  "description": "ESLint config for projects using TypeScript and React.",
5
5
  "homepage": "https://github.com/srmagura/iti-react",
6
6
  "license": "MIT",
@@ -12,20 +12,20 @@
12
12
  "index.cjs"
13
13
  ],
14
14
  "peerDependencies": {
15
- "@typescript-eslint/eslint-plugin": ">=4.33.0",
16
- "@typescript-eslint/parser": ">=4.33.0",
17
- "eslint": ">=7.32.0",
18
- "eslint-config-airbnb": ">=18.2.1",
19
- "eslint-config-airbnb-typescript": ">=14.0.0",
15
+ "@typescript-eslint/eslint-plugin": ">=5.4.0",
16
+ "@typescript-eslint/parser": ">=5.4.0",
17
+ "eslint": ">=8.3.0",
18
+ "eslint-config-airbnb": ">=19.0.0",
19
+ "eslint-config-airbnb-typescript": ">=16.0.0",
20
20
  "eslint-config-prettier": ">=8.3.0",
21
21
  "eslint-import-resolver-typescript": ">=2.5.0",
22
- "eslint-plugin-import": ">=2.24.2",
23
- "eslint-plugin-jest": ">=24.5.2",
22
+ "eslint-plugin-import": ">=2.25.3",
23
+ "eslint-plugin-jest": ">=25.2.4",
24
24
  "eslint-plugin-jest-dom": ">=3.9.2",
25
- "eslint-plugin-jsx-a11y": ">=6.4.1",
26
- "eslint-plugin-promise": ">=5.1.0",
27
- "eslint-plugin-react": ">=7.26.1",
28
- "eslint-plugin-react-hooks": ">=4.2.0",
29
- "eslint-plugin-testing-library": ">=4.12.4"
25
+ "eslint-plugin-jsx-a11y": ">=6.5.1",
26
+ "eslint-plugin-promise": ">=5.1.1",
27
+ "eslint-plugin-react": ">=7.27.1",
28
+ "eslint-plugin-react-hooks": ">=4.3.0",
29
+ "eslint-plugin-testing-library": ">=5.0.0"
30
30
  }
31
31
  }