@ethberry/eslint-config 5.0.8 → 6.0.3

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.
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  # BEGIN INSTALL
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@v6
13
13
 
14
14
  - name: Install Packages npm i
15
15
  run: npm i
@@ -36,7 +36,7 @@ jobs:
36
36
  - name: Version by NPM
37
37
  run: npm version patch -m "[Manual release] [skip ci] %s"
38
38
 
39
- - uses: JS-DevTools/npm-publish@v3
39
+ - uses: JS-DevTools/npm-publish@v4
40
40
  with:
41
41
  token: ${{ secrets.GITHUBTOKEN }}
42
42
  registry: "https://npm.pkg.github.com"
@@ -59,7 +59,7 @@ jobs:
59
59
  - name: Authenticate check via npm NPM
60
60
  run: npm whoami --registry=https://registry.npmjs.org/
61
61
 
62
- - uses: JS-DevTools/npm-publish@v3
62
+ - uses: JS-DevTools/npm-publish@v4
63
63
  with:
64
64
  registry: "https://registry.npmjs.org"
65
65
  token: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -2,14 +2,47 @@
2
2
 
3
3
  This is sharable ESLint config which we use across of all our repositories. It is amazing.
4
4
 
5
+ ### Requirements
6
+
7
+ - **ESLint 10** and **Node.js** [supported by ESLint 10](https://eslint.org/docs/latest/use/migrate-to-10.0.0#nodejs--v2019-v21-v23-are-no-longer-supported) (this package declares `engines.node` `>=22.13.0`).
8
+ - **Flat config only** — `.eslintrc` / `ESLINT_USE_FLAT_CONFIG=false` are not supported in ESLint 10.
9
+
10
+ ### Prettier at lint time
11
+
12
+ Presets include [`eslint-plugin-prettier`](https://github.com/prettier/eslint-plugin-prettier) (`prettier/prettier` as `error`) plus [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) so formatting rules do not fight Prettier. Run **`eslint --fix`** (this repo’s `npm run lint`) to apply Prettier’s output. Add a [Prettier config](https://prettier.io/docs/configuration) in consuming projects when you need options beyond defaults.
13
+
14
+ ### ESLint 10 notes for consumers
15
+
16
+ - **Config lookup** starts from each **linted file’s directory** and walks up (not from the current working directory). In monorepos, put an `eslint.config.*` in each package or pass `--config` explicitly when needed.
17
+ - **`eslint:recommended`** enables [`no-unassigned-vars`](https://eslint.org/docs/latest/rules/no-unassigned-vars), [`no-useless-assignment`](https://eslint.org/docs/latest/rules/no-useless-assignment), and [`preserve-caught-error`](https://eslint.org/docs/latest/rules/preserve-caught-error). Fix new findings or turn rules off in your overlay config if you need stricter control.
18
+ - Remove **`/* eslint-env … */`** comments; ESLint 10 reports them as errors. Use `languageOptions.globals` (e.g. from the [`globals`](https://www.npmjs.com/package/globals) package) instead.
19
+ - **Type-checked TypeScript** (`recommendedTypeChecked` in this preset): merge a block that sets parser options, for example:
20
+
21
+ ```js
22
+ import {defineConfig} from "eslint/config";
23
+ import typescriptRules from "./presets/ts.mjs"; // or your path to this preset
24
+
25
+ export default defineConfig([
26
+ ...typescriptRules,
27
+ {
28
+ files: ["**/*.{ts,mts,tsx,mtsx}"],
29
+ languageOptions: {
30
+ parserOptions: {
31
+ projectService: true,
32
+ tsconfigRootDir: import.meta.dirname,
33
+ },
34
+ },
35
+ },
36
+ ]);
37
+ ```
38
+
5
39
  ### Usage
6
40
 
7
41
  eslint.config.mjs
8
42
 
9
43
  ```js
44
+ import {defineConfig} from "eslint/config";
10
45
  import typescriptRules from "./presets/tsx.mjs";
11
46
 
12
- export default [
13
- ...typescriptRules,
14
- ];
47
+ export default defineConfig([...typescriptRules]);
15
48
  ```
package/package.json CHANGED
@@ -8,26 +8,26 @@
8
8
  "url": "https://github.com/ethberry/eslint-config/issues"
9
9
  },
10
10
  "dependencies": {
11
- "@eslint/js": "9.32.0",
12
- "@stylistic/eslint-plugin": "5.2.2",
13
- "eslint": "9.32.0",
11
+ "@eslint/js": "10.0.1",
12
+ "@stylistic/eslint-plugin": "5.10.0",
13
+ "eslint": "10.0.3",
14
14
  "eslint-config-prettier": "10.1.8",
15
15
  "eslint-import-resolver-typescript": "4.4.4",
16
16
  "eslint-plugin-import": "2.32.0",
17
- "eslint-plugin-jest": "29.0.1",
18
- "eslint-plugin-mocha": "11.1.0",
19
- "eslint-plugin-n": "17.21.3",
20
- "eslint-plugin-prettier": "5.5.3",
17
+ "eslint-plugin-jest": "29.15.0",
18
+ "eslint-plugin-mocha": "11.2.0",
19
+ "eslint-plugin-n": "17.24.0",
20
+ "eslint-plugin-prettier": "5.5.5",
21
21
  "eslint-plugin-promise": "7.2.1",
22
22
  "eslint-plugin-react": "7.37.5",
23
- "eslint-plugin-testing-library": "7.6.3",
24
- "globals": "16.3.0",
25
- "prettier": "3.6.2",
26
- "typescript": "5.8.3",
27
- "typescript-eslint": "8.38.0"
23
+ "eslint-plugin-testing-library": "7.16.1",
24
+ "globals": "17.4.0",
25
+ "prettier": "3.8.1",
26
+ "typescript": "5.9.3",
27
+ "typescript-eslint": "8.57.1"
28
28
  },
29
29
  "engines": {
30
- "node": ">=22"
30
+ "node": ">=22.13.0"
31
31
  },
32
32
  "keywords": [],
33
33
  "license": "MIT",
@@ -46,5 +46,5 @@
46
46
  },
47
47
  "sideEffects": false,
48
48
  "title": "EthBerry ESLint config",
49
- "version": "5.0.8"
49
+ "version": "6.0.3"
50
50
  }
package/presets/js.mjs CHANGED
@@ -8,4 +8,4 @@ export default [
8
8
  ...promiseRules,
9
9
  ...nodeRules,
10
10
  ...prettierRules,
11
- ]
11
+ ];
package/presets/jsx.mjs CHANGED
@@ -10,4 +10,4 @@ export default [
10
10
  ...nodeRules,
11
11
  ...reactRules,
12
12
  ...prettierRules,
13
- ]
13
+ ];
package/presets/ts.mjs CHANGED
@@ -10,6 +10,6 @@ export default [
10
10
  ...typescriptRules,
11
11
  ...promiseRules,
12
12
  ...nodeRules,
13
- ...prettierRules,
14
13
  ...importRules,
15
- ]
14
+ ...prettierRules,
15
+ ];
package/presets/tsx.mjs CHANGED
@@ -12,7 +12,6 @@ export default [
12
12
  ...promiseRules,
13
13
  ...nodeRules,
14
14
  ...reactRules,
15
- ...prettierRules,
16
15
  ...importRules,
16
+ ...prettierRules,
17
17
  ];
18
-
package/rules/common.mjs CHANGED
@@ -8,6 +8,7 @@ export default [
8
8
  // overrides
9
9
  {
10
10
  rules: {
11
+ curly: ["error", "all"],
11
12
  "no-console": [
12
13
  "error",
13
14
  {
@@ -24,7 +25,7 @@ export default [
24
25
  },
25
26
  ],
26
27
  "no-void": "off",
27
- }
28
+ },
28
29
  },
29
30
 
30
31
  // stylistic
@@ -39,7 +40,7 @@ export default [
39
40
  code: 120,
40
41
  ignoreRegExpLiterals: true,
41
42
  ignoreTemplateLiterals: true,
42
- ignorePattern: "^\\s+d=\"", // ignore path in svg icons
43
+ ignorePattern: '^\\s+d="', // ignore path in svg icons
43
44
  },
44
45
  ],
45
46
  "arrow-parens": ["error", "as-needed"],
@@ -67,4 +68,4 @@ export default [
67
68
  semi: ["error", "always"],
68
69
  },
69
70
  },
70
- ]
71
+ ];
package/rules/import.mjs CHANGED
@@ -5,10 +5,10 @@ export default [
5
5
  importPlugin.flatConfigs.typescript,
6
6
  {
7
7
  rules: {
8
- 'import/order': [
8
+ "import/order": [
9
9
  "error",
10
10
  {
11
- "groups": [
11
+ groups: [
12
12
  "builtin",
13
13
  "external",
14
14
  "internal",
@@ -16,17 +16,17 @@ export default [
16
16
  "index",
17
17
  "object",
18
18
  ],
19
- "pathGroups": [
19
+ pathGroups: [
20
20
  {
21
- "pattern": "@{ethberry,framework}/**",
22
- "group": "external",
23
- "position": "after"
24
- }
21
+ pattern: "@{ethberry,framework}/**",
22
+ group: "external",
23
+ position: "after",
24
+ },
25
25
  ],
26
- "pathGroupsExcludedImportTypes": ["builtin"],
27
- 'newlines-between': 'always',
26
+ pathGroupsExcludedImportTypes: ["builtin"],
27
+ "newlines-between": "always",
28
28
  },
29
29
  ],
30
- }
31
- }
32
- ]
30
+ },
31
+ },
32
+ ];
@@ -1,5 +1,3 @@
1
- import eslintConfigPrettier from "eslint-config-prettier";
1
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
2
2
 
3
- export default [
4
- eslintConfigPrettier
5
- ]
3
+ export default [eslintPluginPrettierRecommended];
package/rules/react.mjs CHANGED
@@ -37,6 +37,7 @@ export default [
37
37
 
38
38
  // stylistic
39
39
  {
40
+ files: ["**/*.{jsx,mjsx,tsx,mtsx}"],
40
41
  plugins: {
41
42
  "@stylistic": stylistic,
42
43
  },
@@ -44,4 +45,4 @@ export default [
44
45
  "@stylistic/jsx-indent": ["error", 2],
45
46
  },
46
47
  },
47
- ]
48
+ ];
@@ -58,4 +58,4 @@ export default [
58
58
  "@stylistic": stylistic,
59
59
  },
60
60
  },
61
- ]
61
+ ];
package/tests/mocha.mjs CHANGED
@@ -4,9 +4,9 @@ import mochaPlugin from "eslint-plugin-mocha";
4
4
  export default [
5
5
  {
6
6
  files: ["**/*.spec.ts", "**/*.spec.js"],
7
- ...mochaPlugin.configs.flat.recommended,
7
+ ...mochaPlugin.configs.recommended,
8
8
  rules: {
9
- ...mochaPlugin.configs.flat.recommended.rules,
9
+ ...mochaPlugin.configs.recommended.rules,
10
10
  "mocha/no-exports": "off",
11
11
  "mocha/no-hooks-for-single-case": "off",
12
12
  "mocha/no-skipped-tests": "off",
@@ -4,10 +4,10 @@ export default [
4
4
  {
5
5
  files: ["**/*.spec.tsx", "**/*.spec.jsx"],
6
6
  ...testingLibraryPlugin.configs["flat/dom"],
7
- ...testingLibraryPlugin.configs['flat/react'],
7
+ ...testingLibraryPlugin.configs["flat/react"],
8
8
  rules: {
9
9
  ...testingLibraryPlugin.configs["flat/dom"].rules,
10
- ...testingLibraryPlugin.configs['flat/react'].rules,
10
+ ...testingLibraryPlugin.configs["flat/react"].rules,
11
11
  "testing-library/await-async-queries": "error",
12
12
  "testing-library/no-await-sync-queries": "error",
13
13
  "testing-library/no-debugging-utils": "warn",