eslint-config-seek 0.0.0-eslint-9-etc-20240810051715 → 0.0.0-eslint-9-etc-20240819093637

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 (4) hide show
  1. package/README.md +2 -2
  2. package/base.js +15 -2
  3. package/index.js +0 -13
  4. package/package.json +3 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  This package includes the shareable ESLint configuration used by [SEEK](https://github.com/seek-oss/).
7
7
 
8
- ## Usage in sku Projects
8
+ ## Usage in sku and skuba Projects
9
9
 
10
10
  The easiest way to use this configuration is with [sku](https://github.com/seek-oss/sku) or [skuba](https://github.com/seek-oss/skuba).
11
11
 
@@ -17,7 +17,7 @@ If you want to use this ESLint configuration in a project not built with sku or
17
17
 
18
18
  First, install this package, and the necessary peer dependencies listed in this project's [package.json](package.json).
19
19
 
20
- Then create a file named `eslint.config.js` with following contents in the root folder of your project:
20
+ Then create a file named `eslint.config.js` with the following contents in the root folder of your project:
21
21
 
22
22
  ```js
23
23
  module.exports = require('eslint-config-seek');
package/base.js CHANGED
@@ -6,6 +6,7 @@ const tsParser = require('@typescript-eslint/parser');
6
6
  const jestPlugin = require('eslint-plugin-jest');
7
7
  const cypress = require('eslint-plugin-cypress');
8
8
  const js = require('@eslint/js');
9
+ const unusedImports = require('eslint-plugin-unused-imports');
9
10
 
10
11
  const { FlatCompat } = require('@eslint/eslintrc');
11
12
 
@@ -64,10 +65,15 @@ const baseRules = {
64
65
  'no-label-var': ERROR,
65
66
  'no-shadow': ERROR,
66
67
  'no-undef-init': ERROR,
67
- 'no-unused-vars': [
68
+
69
+ // Use unused-imports instead of no-unused-vars for autofix support
70
+ 'no-unused-vars': OFF,
71
+ 'unused-imports/no-unused-imports': ERROR,
72
+ 'unused-imports/no-unused-vars': [
68
73
  ERROR,
69
74
  { argsIgnorePattern: '^_', ignoreRestSiblings: true },
70
75
  ],
76
+
71
77
  'handle-callback-err': ERROR,
72
78
  'no-new-require': ERROR,
73
79
  'no-path-concat': ERROR,
@@ -108,6 +114,7 @@ module.exports = [
108
114
  {
109
115
  plugins: {
110
116
  'import-x': importX,
117
+ 'unused-imports': unusedImports,
111
118
  },
112
119
 
113
120
  languageOptions: {
@@ -149,15 +156,21 @@ module.exports = [
149
156
  warnOnUnsupportedTypeScriptVersion: false,
150
157
  },
151
158
  },
159
+ plugins: { 'unused-imports': unusedImports },
152
160
  settings,
153
161
  rules: {
154
162
  '@typescript-eslint/array-type': [ERROR, { default: 'array-simple' }],
155
163
  '@typescript-eslint/consistent-type-definitions': OFF,
156
164
  '@typescript-eslint/no-unused-expressions': ERROR,
157
- '@typescript-eslint/no-unused-vars': [
165
+
166
+ // Use unused-imports instead of no-unused-vars for autofix support
167
+ '@typescript-eslint/no-unused-vars': [OFF],
168
+ 'unused-imports/no-unused-imports': ERROR,
169
+ 'unused-imports/no-unused-vars': [
158
170
  ERROR,
159
171
  { argsIgnorePattern: '^_', ignoreRestSiblings: true },
160
172
  ],
173
+
161
174
  '@typescript-eslint/no-use-before-define': OFF,
162
175
  '@typescript-eslint/no-non-null-assertion': OFF,
163
176
  '@typescript-eslint/ban-ts-comment': OFF,
package/index.js CHANGED
@@ -64,17 +64,4 @@ module.exports = [
64
64
 
65
65
  rules: reactRules,
66
66
  },
67
- {
68
- files: ['**/*.tsx'],
69
-
70
- rules: {
71
- '@typescript-eslint/no-unused-vars': [
72
- ERROR,
73
- {
74
- argsIgnorePattern: '^_',
75
- ignoreRestSiblings: true,
76
- },
77
- ],
78
- },
79
- },
80
67
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-seek",
3
- "version": "0.0.0-eslint-9-etc-20240810051715",
3
+ "version": "0.0.0-eslint-9-etc-20240819093637",
4
4
  "description": "ESLint configuration used by SEEK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -34,6 +34,7 @@
34
34
  "eslint-plugin-jest": "^28.7.0",
35
35
  "eslint-plugin-react": "^7.35.0",
36
36
  "eslint-plugin-react-hooks": "^4.6.2",
37
+ "eslint-plugin-unused-imports": "^4.1.3",
37
38
  "find-root": "^1.1.0",
38
39
  "globals": "^15.9.0"
39
40
  },
@@ -56,7 +57,7 @@
56
57
  },
57
58
  "scripts": {
58
59
  "release": "changeset publish",
59
- "test": "eslint --config eslint.config.js . && eslint --config eslint.config.base.js .",
60
+ "test": "eslint --config index.js . && eslint --config base.js .",
60
61
  "changeset-version": "changeset version && prettier --write ."
61
62
  }
62
63
  }