eslint-config-seek 0.0.0-eslint-9-etc-20240804104033 → 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.
- package/README.md +12 -16
- package/base.js +16 -3
- package/index.js +0 -13
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -5,35 +5,31 @@
|
|
|
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
|
-
The easiest way to use this configuration is with [sku](https://github.com/seek-oss/sku)
|
|
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
|
|
|
12
|
-
**You don’t need to install it separately in sku projects.**
|
|
12
|
+
**You don’t need to install it separately in sku and skuba projects.**
|
|
13
13
|
|
|
14
|
-
## Usage Outside of sku
|
|
14
|
+
## Usage Outside of sku and skuba
|
|
15
15
|
|
|
16
|
-
If you want to use this ESLint configuration in a project not built with sku, you can install it with following steps.
|
|
16
|
+
If you want to use this ESLint configuration in a project not built with sku or skuba, you can install it with following steps.
|
|
17
17
|
|
|
18
|
-
First, install this package,
|
|
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
|
|
20
|
+
Then create a file named `eslint.config.js` with the following contents in the root folder of your project:
|
|
21
21
|
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
"extends": "seek"
|
|
25
|
-
}
|
|
22
|
+
```js
|
|
23
|
+
module.exports = require('eslint-config-seek');
|
|
26
24
|
```
|
|
27
25
|
|
|
28
26
|
The default configuration includes support for React projects. For projects that are not based on React, the "base" configuration should be used instead:
|
|
29
27
|
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
"extends": "seek/base"
|
|
33
|
-
}
|
|
28
|
+
```js
|
|
29
|
+
module.exports = require('eslint-config-seek/base');
|
|
34
30
|
```
|
|
35
31
|
|
|
36
|
-
You can override the settings from `eslint-config-seek` by editing the
|
|
32
|
+
You can override the settings from `eslint-config-seek` by editing the `eslint.config.js` file. Learn more about [configuring ESLint](https://eslint.org/docs/latest/use/configure/) on the ESLint website.
|
|
37
33
|
|
|
38
34
|
## License
|
|
39
35
|
|
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
|
-
|
|
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: {
|
|
@@ -145,19 +152,25 @@ module.exports = [
|
|
|
145
152
|
sourceType: 'module',
|
|
146
153
|
|
|
147
154
|
parserOptions: {
|
|
148
|
-
|
|
155
|
+
projectService: true,
|
|
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
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-seek",
|
|
3
|
-
"version": "0.0.0-eslint-9-etc-
|
|
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": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@eslint/compat": "^1.1.1",
|
|
26
26
|
"@eslint/eslintrc": "^3.1.0",
|
|
27
27
|
"@eslint/js": "^9.8.0",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^8.0.
|
|
29
|
-
"@typescript-eslint/parser": "^8.0.
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
29
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
30
30
|
"eslint-config-prettier": "^9.1.0",
|
|
31
31
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
32
32
|
"eslint-plugin-cypress": "^3.4.0",
|
|
@@ -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
|
|
60
|
+
"test": "eslint --config index.js . && eslint --config base.js .",
|
|
60
61
|
"changeset-version": "changeset version && prettier --write ."
|
|
61
62
|
}
|
|
62
63
|
}
|