@allthings/eslint-config 1.1.0 → 2.1.0

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/index.js +49 -1
  2. package/node.js +40 -0
  3. package/package.json +16 -14
package/index.js CHANGED
@@ -30,6 +30,7 @@ sortedPaths.push(...keptPaths)
30
30
 
31
31
  const hookPropertyMap = new Map(
32
32
  [
33
+ ['eslint-plugin-unicorn', 'eslint-plugin-unicorn'],
33
34
  ['eslint-plugin-jest', 'eslint-plugin-jest'],
34
35
  ['eslint-plugin-import', 'eslint-plugin-import'],
35
36
  ['eslint-plugin-react', 'eslint-plugin-react'],
@@ -61,6 +62,7 @@ require('@rushstack/eslint-patch/modern-module-resolution')
61
62
 
62
63
  module.exports = {
63
64
  extends: [
65
+ 'plugin:unicorn/recommended',
64
66
  'plugin:import/recommended',
65
67
  'plugin:import/typescript',
66
68
  'eslint:recommended',
@@ -73,6 +75,7 @@ module.exports = {
73
75
  'plugin:prettier/recommended',
74
76
  ],
75
77
  plugins: [
78
+ 'unicorn',
76
79
  'jest',
77
80
  'import',
78
81
  'react',
@@ -175,7 +178,10 @@ module.exports = {
175
178
  ],
176
179
  '@typescript-eslint/no-this-alias': 'error',
177
180
  '@typescript-eslint/no-unused-expressions': 'error',
178
- '@typescript-eslint/no-unused-vars': 'error',
181
+ '@typescript-eslint/no-unused-vars': [
182
+ 'error',
183
+ { varsIgnorePattern: '^jsx$' },
184
+ ],
179
185
  '@typescript-eslint/no-use-before-define': 'error',
180
186
  '@typescript-eslint/no-var-requires': 'error',
181
187
  '@typescript-eslint/prefer-for-of': 'error',
@@ -303,6 +309,9 @@ module.exports = {
303
309
  },
304
310
  ],
305
311
  'react/react-in-jsx-scope': 'off',
312
+ 'react/no-unknown-property': ['error', { ignore: ['css'] }],
313
+ 'react/jsx-uses-react': 'error',
314
+ 'react/jsx-uses-vars': 'error',
306
315
  'simple-import-sort/imports': 'error',
307
316
  'simple-import-sort/exports': 'error',
308
317
  'sort-keys': 'error',
@@ -313,6 +322,44 @@ module.exports = {
313
322
  markers: ['/'],
314
323
  },
315
324
  ],
325
+ 'unicorn/better-regex': 'off',
326
+ 'unicorn/expiring-todo-comments': 'off',
327
+ 'unicorn/filename-case': [
328
+ 'warn',
329
+ {
330
+ cases: {
331
+ camelCase: true,
332
+ pascalCase: true,
333
+ },
334
+ },
335
+ ],
336
+ 'unicorn/import-style': 'warn',
337
+ 'unicorn/no-array-reduce': 'off',
338
+ 'unicorn/no-console-spaces': 'off',
339
+ 'unicorn/no-document-cookie': 'warn',
340
+ 'unicorn/no-empty-file': 'off',
341
+ 'unicorn/no-hex-escape': 'warn',
342
+ 'unicorn/no-invalid-remove-event-listener': 'warn',
343
+ 'unicorn/no-nested-ternary': 'off',
344
+ 'unicorn/no-object-as-default-parameter': 'warn',
345
+ 'unicorn/no-unreadable-array-destructuring': 'off',
346
+ 'unicorn/no-unsafe-regex': 'off',
347
+ 'unicorn/no-unused-properties': 'warn',
348
+ 'unicorn/no-zero-fractions': 'off',
349
+ 'unicorn/prefer-export-from': 'off',
350
+ 'unicorn/prefer-includes': 'off',
351
+ 'unicorn/prefer-module': 'warn',
352
+ 'unicorn/prefer-optional-catch-binding': 'off',
353
+ 'unicorn/prefer-prototype-methods': 'off',
354
+ 'unicorn/prefer-query-selector': 'off',
355
+ 'unicorn/prefer-regexp-test': 'off',
356
+ 'unicorn/prefer-set-has': 'off',
357
+ 'unicorn/prefer-set-size': 'off',
358
+ 'unicorn/prefer-string-replace-all': 'off',
359
+ 'unicorn/prefer-node-protocol': 'off',
360
+ 'unicorn/relative-url-style': 'off',
361
+ 'unicorn/switch-case-braces': 'off',
362
+ 'unicorn/template-indent': 'off',
316
363
  'use-isnan': 'error',
317
364
  },
318
365
  parser: '@typescript-eslint/parser',
@@ -321,6 +368,7 @@ module.exports = {
321
368
  jsx: true,
322
369
  },
323
370
  ecmaVersion: 2021,
371
+ project: 'tsconfig.json',
324
372
  sourceType: 'module',
325
373
  warnOnUnsupportedTypeScriptVersion: false,
326
374
  },
package/node.js CHANGED
@@ -28,6 +28,7 @@ sortedPaths.push(...keptPaths.reverse())
28
28
 
29
29
  const hookPropertyMap = new Map(
30
30
  [
31
+ ['eslint-plugin-unicorn', 'eslint-plugin-unicorn'],
31
32
  ['eslint-plugin-jest', 'eslint-plugin-jest'],
32
33
  ['eslint-plugin-import', 'eslint-plugin-import'],
33
34
  [
@@ -56,6 +57,7 @@ require('@rushstack/eslint-patch/modern-module-resolution')
56
57
 
57
58
  module.exports = {
58
59
  extends: [
60
+ 'plugin:unicorn/recommended',
59
61
  'plugin:import/recommended',
60
62
  'plugin:import/typescript',
61
63
  'eslint:recommended',
@@ -65,6 +67,7 @@ module.exports = {
65
67
  'plugin:prettier/recommended',
66
68
  ],
67
69
  plugins: [
70
+ 'unicorn',
68
71
  'jest',
69
72
  'import',
70
73
  'typescript-sort-keys',
@@ -288,6 +291,43 @@ module.exports = {
288
291
  markers: ['/'],
289
292
  },
290
293
  ],
294
+ 'unicorn/better-regex': 'off',
295
+ 'unicorn/expiring-todo-comments': 'off',
296
+ 'unicorn/filename-case': [
297
+ 'warn',
298
+ {
299
+ cases: {
300
+ camelCase: true,
301
+ pascalCase: true,
302
+ },
303
+ },
304
+ ],
305
+ 'unicorn/import-style': 'warn',
306
+ 'unicorn/no-array-reduce': 'off',
307
+ 'unicorn/no-console-spaces': 'off',
308
+ 'unicorn/no-document-cookie': 'warn',
309
+ 'unicorn/no-empty-file': 'off',
310
+ 'unicorn/no-hex-escape': 'warn',
311
+ 'unicorn/no-invalid-remove-event-listener': 'warn',
312
+ 'unicorn/no-nested-ternary': 'off',
313
+ 'unicorn/no-object-as-default-parameter': 'warn',
314
+ 'unicorn/no-unreadable-array-destructuring': 'off',
315
+ 'unicorn/no-unsafe-regex': 'off',
316
+ 'unicorn/no-unused-properties': 'warn',
317
+ 'unicorn/no-zero-fractions': 'off',
318
+ 'unicorn/prefer-export-from': 'off',
319
+ 'unicorn/prefer-includes': 'off',
320
+ 'unicorn/prefer-module': 'warn',
321
+ 'unicorn/prefer-optional-catch-binding': 'off',
322
+ 'unicorn/prefer-prototype-methods': 'off',
323
+ 'unicorn/prefer-query-selector': 'off',
324
+ 'unicorn/prefer-regexp-test': 'off',
325
+ 'unicorn/prefer-set-has': 'off',
326
+ 'unicorn/prefer-set-size': 'off',
327
+ 'unicorn/prefer-string-replace-all': 'off',
328
+ 'unicorn/relative-url-style': 'off',
329
+ 'unicorn/switch-case-braces': 'off',
330
+ 'unicorn/template-indent': 'off',
291
331
  'use-isnan': 'error',
292
332
  },
293
333
  parser: '@typescript-eslint/parser',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/eslint-config",
3
- "version": "1.1.0",
3
+ "version": "2.1.0",
4
4
  "description": "ESlint shareable config for Allthings style",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -12,34 +12,36 @@
12
12
  "test": "eslint test/",
13
13
  "predeploy": "yarn test",
14
14
  "deploy": "yarn publish --new-version $npm_package_version --tag latest --access public",
15
- "postdeploy": "git push --tags origin HEAD"
15
+ "postdeploy": "git push --tags origin HEAD",
16
+ "deps": "yarn upgrade-interactive --latest"
16
17
  },
17
18
  "dependencies": {
18
- "@rushstack/eslint-patch": "^1.3.3",
19
- "@typescript-eslint/eslint-plugin": "^6.6.0",
20
- "@typescript-eslint/parser": "^6.6.0",
19
+ "@rushstack/eslint-patch": "^1.5.1",
20
+ "@typescript-eslint/eslint-plugin": "^6.11.0",
21
+ "@typescript-eslint/parser": "^6.11.0",
21
22
  "eslint-config-prettier": "^9.0.0",
22
23
  "eslint-import-resolver-node": "^0.3.9",
23
- "eslint-import-resolver-typescript": "^3.6.0",
24
- "eslint-plugin-import": "^2.28.1",
25
- "eslint-plugin-jest": "^27.4.0",
26
- "eslint-plugin-jsx-a11y": "^6.7.1",
27
- "eslint-plugin-n": "^16.0.2",
24
+ "eslint-import-resolver-typescript": "^3.6.1",
25
+ "eslint-plugin-import": "^2.29.0",
26
+ "eslint-plugin-jest": "^27.6.0",
27
+ "eslint-plugin-jsx-a11y": "^6.8.0",
28
+ "eslint-plugin-n": "^16.3.1",
28
29
  "eslint-plugin-prefer-arrow": "^1.2.3",
29
- "eslint-plugin-prettier": "^5.0.0",
30
+ "eslint-plugin-prettier": "^5.0.1",
30
31
  "eslint-plugin-react": "^7.33.2",
31
32
  "eslint-plugin-react-hooks": "^4.6.0",
32
33
  "eslint-plugin-simple-import-sort": "^10.0.0",
33
- "eslint-plugin-typescript-sort-keys": "^2.3.0"
34
+ "eslint-plugin-typescript-sort-keys": "^3.1.0",
35
+ "eslint-plugin-unicorn": "^49.0.0"
34
36
  },
35
37
  "peerDependencies": {
36
38
  "eslint": ">=8.22.0",
37
- "prettier": ">=3.0.0",
39
+ "prettier": ">=3.1.0",
38
40
  "typescript": ">=4"
39
41
  },
40
42
  "devDependencies": {
41
43
  "eslint": "^8.48.0",
42
- "prettier": "^3.0.0",
44
+ "prettier": "^3.1.0",
43
45
  "typescript": ">=4"
44
46
  },
45
47
  "keywords": [