@tim-code/eslint-config 2.1.0 → 3.0.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.
- package/README.md +1 -1
- package/eslint.config.js +7 -16
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This config assumes that code can use Node globals unless it is in a `frontend` directory. See below to change this.
|
|
4
4
|
|
|
5
|
-
Version
|
|
5
|
+
Version 3.X.X of this package requires ESLint 10+ (flat config) and `eslint-plugin-import-x` as a peer dependency (replacing `eslint-plugin-import`). Use 2.1.X if you need ESLint 9 support, or 1.4.X if you are using ESLint 8.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
package/eslint.config.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import js from "@eslint/js"
|
|
2
2
|
import prettierConfig from "eslint-config-prettier/flat"
|
|
3
|
-
import
|
|
3
|
+
import { importX } from "eslint-plugin-import-x"
|
|
4
4
|
import { defineConfig, globalIgnores } from "eslint/config"
|
|
5
5
|
import globals from "globals"
|
|
6
6
|
|
|
7
7
|
export default defineConfig([
|
|
8
8
|
globalIgnores(["dist/**", "dist-old/**", ".aws-sam"]),
|
|
9
|
-
// base: ESLint core + prettier + import/recommended
|
|
9
|
+
// base: ESLint core + prettier + import-x/recommended
|
|
10
10
|
js.configs.all,
|
|
11
11
|
prettierConfig,
|
|
12
|
-
|
|
12
|
+
importX.flatConfigs.recommended,
|
|
13
13
|
{
|
|
14
14
|
files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
|
|
15
15
|
|
|
@@ -32,22 +32,13 @@ export default defineConfig([
|
|
|
32
32
|
reportUnusedDisableDirectives: true,
|
|
33
33
|
},
|
|
34
34
|
|
|
35
|
-
settings: {
|
|
36
|
-
"import/resolver": {
|
|
37
|
-
// default resolver provided by eslint-plugin-import
|
|
38
|
-
node: {},
|
|
39
|
-
// "eslint-import-resolver-exports" plugin
|
|
40
|
-
exports: {},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
|
|
44
35
|
rules: {
|
|
45
36
|
// .js extension needed for relative imports
|
|
46
|
-
"import/extensions": ["error", "ignorePackages"],
|
|
37
|
+
"import-x/extensions": ["error", "ignorePackages"],
|
|
47
38
|
// these rules have poor performance:
|
|
48
|
-
"import/namespace": "off",
|
|
49
|
-
"import/no-named-as-default-member": "off",
|
|
50
|
-
"import/no-named-as-default": "off",
|
|
39
|
+
"import-x/namespace": "off",
|
|
40
|
+
"import-x/no-named-as-default-member": "off",
|
|
41
|
+
"import-x/no-named-as-default": "off",
|
|
51
42
|
|
|
52
43
|
// functions that return JSX seem to trigger this but the functions aren't necessarily components themselves
|
|
53
44
|
"react/display-name": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tim-code/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "eslint.config.js",
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"eslint-config-prettier": ">=10",
|
|
11
|
-
"
|
|
11
|
+
"globals": ">=14"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"eslint": ">=
|
|
15
|
-
"eslint
|
|
14
|
+
"@eslint/js": ">=10",
|
|
15
|
+
"eslint": ">=10",
|
|
16
|
+
"eslint-plugin-import-x": ">=4"
|
|
16
17
|
},
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public"
|