@interface-technologies/eslint-config 0.4.6 → 4.0.0-alpha.1

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.cjs +32 -6
  3. package/package.json +13 -13
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
@@ -3,7 +3,7 @@ module.exports = {
3
3
  parserOptions: {
4
4
  project: './tsconfig.json',
5
5
  tsconfigRootDir: '.',
6
- ecmaVersion: 2017,
6
+ ecmaVersion: 2019,
7
7
  sourceType: 'module',
8
8
  },
9
9
  extends: [
@@ -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: {},
@@ -27,8 +27,8 @@ module.exports = {
27
27
  'testing-library/custom-renders': 'off',
28
28
  },
29
29
  rules: {
30
- 'consistent-return': 'off',
31
30
  'default-case': 'off',
31
+ 'default-case-last': 'off',
32
32
  'max-classes-per-file': 'off',
33
33
  'no-console': ['error', { allow: ['warn', 'error'] }],
34
34
  'no-continue': 'off',
@@ -36,7 +36,7 @@ module.exports = {
36
36
  'no-plusplus': 'off',
37
37
  'no-restricted-syntax': [
38
38
  'error',
39
- // 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
40
40
  // with for-of removed
41
41
  {
42
42
  selector: 'ForInStatement',
@@ -59,6 +59,19 @@ module.exports = {
59
59
  'no-void': 'off',
60
60
  radix: 'off',
61
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
+
62
75
  '@typescript-eslint/explicit-function-return-type': [
63
76
  'warn',
64
77
  { allowExpressions: true },
@@ -101,8 +114,8 @@ module.exports = {
101
114
  devDependencies: [
102
115
  '**/*.test.ts?(x)',
103
116
  '**/*.stories.ts?(x)',
104
- '**/__DevHelpers__/**/*',
105
- '**/__TestHelpers__/**/*',
117
+ '**/__devHelpers__/**/*',
118
+ '**/__testHelpers__/**/*',
106
119
  ],
107
120
  },
108
121
  ],
@@ -127,6 +140,10 @@ module.exports = {
127
140
  'react/destructuring-assignment': 'off',
128
141
  'react/jsx-props-no-spreading': 'off',
129
142
  'react/prop-types': 'off',
143
+ 'react/function-component-definition': [
144
+ 'error',
145
+ { unnamedComponents: 'arrow-function' },
146
+ ],
130
147
  'react/require-default-props': 'off',
131
148
  'react/state-in-constructor': 'off',
132
149
  'react/static-property-placement': ['error', 'static public field'],
@@ -149,4 +166,13 @@ module.exports = {
149
166
  'testing-library/no-await-sync-events': 'error',
150
167
  'testing-library/prefer-explicit-assert': 'warn',
151
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
+ ],
152
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interface-technologies/eslint-config",
3
- "version": "0.4.6",
3
+ "version": "4.0.0-alpha.1",
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
  }