@pplancq/eslint-config 5.0.22 → 6.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/CHANGELOG.md +15 -0
- package/bin/init.mjs +18 -0
- package/main.js +10 -13
- package/package.json +7 -6
- package/rules/base.js +2 -6
- package/rules/import.js +3 -7
- package/rules/playwright.js +3 -7
- package/rules/prettier.js +2 -6
- package/rules/react-jsx-a11y.js +2 -6
- package/rules/react.js +7 -13
- package/rules/typescript.js +3 -7
- package/rules/vitest.js +2 -6
- package/bin/init.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## @pplancq/eslint-config [6.0.0](https://github.com/pplancq/dev-tools/compare/@pplancq/eslint-config@5.0.22...@pplancq/eslint-config@6.0.0) (2026-01-29)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* **eslint-config:** Drop CommonJS support. See the [README](https://github.com/pplancq/dev-tools/blob/main/packages/eslint-config/MIGRATION.md) for migration instructions.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **eslint-config:** migrate to ESM and update configuration files ([e7f7e99](https://github.com/pplancq/dev-tools/commit/e7f7e991a542e19291da678f5b577be4823c1a97))
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency globals to ^17.1.0 ([56a94ba](https://github.com/pplancq/dev-tools/commit/56a94bae889f75a38127f85e83b0151d9274882a))
|
|
14
|
+
* **deps:** update typescript-eslint mono repo to ^8.53.1 ([e412c90](https://github.com/pplancq/dev-tools/commit/e412c90a67dcc790e8b45979523327cc8ed820ba))
|
|
15
|
+
|
|
1
16
|
## @pplancq/eslint-config [5.0.22](https://github.com/pplancq/dev-tools/compare/@pplancq/eslint-config@5.0.21...@pplancq/eslint-config@5.0.22) (2026-01-20)
|
|
2
17
|
|
|
3
18
|
### Bug Fixes
|
package/bin/init.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { writeFileSync } from 'node:fs';
|
|
3
|
+
|
|
4
|
+
console.info('Add eslint config in eslint.config.mjs');
|
|
5
|
+
|
|
6
|
+
writeFileSync(
|
|
7
|
+
'eslint.config.mjs',
|
|
8
|
+
`import { defineConfig } from '@pplancq/eslint-config';
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
enableReact: true,
|
|
12
|
+
enableVitest: true,
|
|
13
|
+
});
|
|
14
|
+
`,
|
|
15
|
+
{
|
|
16
|
+
encoding: 'utf-8',
|
|
17
|
+
},
|
|
18
|
+
);
|
package/main.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import { baseRules } from './rules/base.js';
|
|
3
|
+
import { importRules } from './rules/import.js';
|
|
4
|
+
import { reactJsxA11yRules } from './rules/react-jsx-a11y.js';
|
|
5
|
+
import { reactRules, reactTypescriptRules, reactTestRules } from './rules/react.js';
|
|
6
|
+
import { typescriptRules } from './rules/typescript.js';
|
|
7
|
+
import { prettierRules } from './rules/prettier.js';
|
|
8
|
+
import { vitestRules } from './rules/vitest.js';
|
|
9
|
+
import { playwrightRules } from './rules/playwright.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* define eslint flat config.
|
|
@@ -22,7 +23,7 @@ const { playwrightRules } = require('./rules/playwright');
|
|
|
22
23
|
*
|
|
23
24
|
* @returns {import('eslint').Linter.Config}
|
|
24
25
|
*/
|
|
25
|
-
const defineConfig = ({
|
|
26
|
+
export const defineConfig = ({
|
|
26
27
|
tsFiles = ['**/*.ts?(x)'],
|
|
27
28
|
unitTestFiles = ['**/*.{test,spec,steps}.{js,jsx,ts,tsx}'],
|
|
28
29
|
unitE2eFiles = ['tests/**/*.{test,spec}.{js,jsx,ts,tsx}'],
|
|
@@ -63,7 +64,3 @@ const defineConfig = ({
|
|
|
63
64
|
...extendConfig,
|
|
64
65
|
].filter(Boolean);
|
|
65
66
|
};
|
|
66
|
-
|
|
67
|
-
module.exports = {
|
|
68
|
-
defineConfig,
|
|
69
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pplancq/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "pplancq eslint config",
|
|
6
6
|
"author": "pplancq <paul.plancq@outlook.fr>",
|
|
@@ -27,17 +27,18 @@
|
|
|
27
27
|
"bugs": {
|
|
28
28
|
"url": "https://github.com/pplancq/dev-tools/issues"
|
|
29
29
|
},
|
|
30
|
+
"type": "module",
|
|
30
31
|
"main": "main.js",
|
|
31
32
|
"bin": {
|
|
32
|
-
"init-eslint-config": "bin/init.
|
|
33
|
+
"init-eslint-config": "bin/init.mjs"
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|
|
35
36
|
"eslint",
|
|
36
37
|
"config"
|
|
37
38
|
],
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.53.
|
|
40
|
-
"@typescript-eslint/parser": "^8.53.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
|
41
|
+
"@typescript-eslint/parser": "^8.53.1",
|
|
41
42
|
"@vitest/eslint-plugin": "^1.6.6",
|
|
42
43
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
43
44
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"eslint-plugin-react": "^7.37.5",
|
|
48
49
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
49
50
|
"eslint-plugin-testing-library": "^7.15.4",
|
|
50
|
-
"globals": "^17.
|
|
51
|
+
"globals": "^17.1.0"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"eslint": "^9.14.0",
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
"eslint": "^9.39.2",
|
|
67
68
|
"eslint-plugin-prettier": "^5.5.5",
|
|
68
69
|
"lint-staged": "^16.2.7",
|
|
69
|
-
"prettier": "^3.8.
|
|
70
|
+
"prettier": "^3.8.1"
|
|
70
71
|
},
|
|
71
72
|
"engines": {
|
|
72
73
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
package/rules/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import globals from 'globals';
|
|
2
2
|
|
|
3
|
-
const baseRules = {
|
|
3
|
+
export const baseRules = {
|
|
4
4
|
languageOptions: {
|
|
5
5
|
ecmaVersion: 'latest',
|
|
6
6
|
sourceType: 'module',
|
|
@@ -1456,7 +1456,3 @@ const baseRules = {
|
|
|
1456
1456
|
'yield-star-spacing': ['error', 'after'],
|
|
1457
1457
|
},
|
|
1458
1458
|
};
|
|
1459
|
-
|
|
1460
|
-
module.exports = {
|
|
1461
|
-
baseRules,
|
|
1462
|
-
};
|
package/rules/import.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import importPlugin from 'eslint-plugin-import';
|
|
2
2
|
|
|
3
|
-
const importRules = {
|
|
3
|
+
export const importRules = {
|
|
4
4
|
plugins: {
|
|
5
5
|
import: importPlugin,
|
|
6
6
|
},
|
|
@@ -268,7 +268,7 @@ const importRules = {
|
|
|
268
268
|
settings: {
|
|
269
269
|
'import/extensions': ['.js', '.mjs', '.jsx'],
|
|
270
270
|
'import/core-modules': [],
|
|
271
|
-
'import/ignore': ['node_modules',
|
|
271
|
+
'import/ignore': ['node_modules', String.raw`\.(coffee|scss|css|less|hbs|svg|json)$`],
|
|
272
272
|
'import/resolver': {
|
|
273
273
|
node: {
|
|
274
274
|
extensions: ['.js'],
|
|
@@ -276,7 +276,3 @@ const importRules = {
|
|
|
276
276
|
},
|
|
277
277
|
},
|
|
278
278
|
};
|
|
279
|
-
|
|
280
|
-
module.exports = {
|
|
281
|
-
importRules,
|
|
282
|
-
};
|
package/rules/playwright.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import playwrightPlugin from 'eslint-plugin-playwright';
|
|
2
|
+
import globals from 'globals';
|
|
3
3
|
|
|
4
|
-
const playwrightRules = {
|
|
4
|
+
export const playwrightRules = {
|
|
5
5
|
plugins: {
|
|
6
6
|
playwright: playwrightPlugin,
|
|
7
7
|
},
|
|
@@ -221,7 +221,3 @@ const playwrightRules = {
|
|
|
221
221
|
'playwright/valid-title': 'error',
|
|
222
222
|
},
|
|
223
223
|
};
|
|
224
|
-
|
|
225
|
-
module.exports = {
|
|
226
|
-
playwrightRules,
|
|
227
|
-
};
|
package/rules/prettier.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
2
2
|
|
|
3
|
-
const prettierRules = {
|
|
3
|
+
export const prettierRules = {
|
|
4
4
|
plugins: {
|
|
5
5
|
prettier: prettierPlugin,
|
|
6
6
|
},
|
|
@@ -135,7 +135,3 @@ const prettierRules = {
|
|
|
135
135
|
'yield-star-spacing': 'off',
|
|
136
136
|
},
|
|
137
137
|
};
|
|
138
|
-
|
|
139
|
-
module.exports = {
|
|
140
|
-
prettierRules,
|
|
141
|
-
};
|
package/rules/react-jsx-a11y.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
2
2
|
|
|
3
|
-
const reactJsxA11yRules = {
|
|
3
|
+
export const reactJsxA11yRules = {
|
|
4
4
|
plugins: {
|
|
5
5
|
'jsx-a11y': jsxA11yPlugin,
|
|
6
6
|
},
|
|
@@ -218,7 +218,3 @@ const reactJsxA11yRules = {
|
|
|
218
218
|
'jsx-a11y/tabindex-no-positive': 'error',
|
|
219
219
|
},
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
module.exports = {
|
|
223
|
-
reactJsxA11yRules,
|
|
224
|
-
};
|
package/rules/react.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
2
|
+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
3
|
+
import testingLibraryPlugin from 'eslint-plugin-testing-library';
|
|
4
|
+
import jestDom from 'eslint-plugin-jest-dom';
|
|
5
5
|
|
|
6
|
-
const reactRules = {
|
|
6
|
+
export const reactRules = {
|
|
7
7
|
plugins: {
|
|
8
8
|
react: reactPlugin,
|
|
9
9
|
'react-hooks': reactHooksPlugin,
|
|
@@ -650,7 +650,7 @@ const reactRules = {
|
|
|
650
650
|
},
|
|
651
651
|
};
|
|
652
652
|
|
|
653
|
-
const reactTypescriptRules = {
|
|
653
|
+
export const reactTypescriptRules = {
|
|
654
654
|
settings: {
|
|
655
655
|
'import/resolver': {
|
|
656
656
|
node: {
|
|
@@ -696,7 +696,7 @@ const reactTypescriptRules = {
|
|
|
696
696
|
},
|
|
697
697
|
};
|
|
698
698
|
|
|
699
|
-
const reactTestRules = {
|
|
699
|
+
export const reactTestRules = {
|
|
700
700
|
plugins: {
|
|
701
701
|
'testing-library': testingLibraryPlugin,
|
|
702
702
|
'jest-dom': jestDom,
|
|
@@ -859,9 +859,3 @@ const reactTestRules = {
|
|
|
859
859
|
'testing-library/render-result-naming-convention': 'error',
|
|
860
860
|
},
|
|
861
861
|
};
|
|
862
|
-
|
|
863
|
-
module.exports = {
|
|
864
|
-
reactRules,
|
|
865
|
-
reactTypescriptRules,
|
|
866
|
-
reactTestRules,
|
|
867
|
-
};
|
package/rules/typescript.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable import/no-unresolved */
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
|
|
3
|
+
import typescriptEslintParser from '@typescript-eslint/parser';
|
|
4
4
|
|
|
5
|
-
const typescriptRules = {
|
|
5
|
+
export const typescriptRules = {
|
|
6
6
|
plugins: {
|
|
7
7
|
'@typescript-eslint': typescriptEslintPlugin,
|
|
8
8
|
},
|
|
@@ -564,7 +564,3 @@ const typescriptRules = {
|
|
|
564
564
|
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
|
|
565
565
|
},
|
|
566
566
|
};
|
|
567
|
-
|
|
568
|
-
module.exports = {
|
|
569
|
-
typescriptRules,
|
|
570
|
-
};
|
package/rules/vitest.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import vitestPlugin from '@vitest/eslint-plugin';
|
|
2
2
|
|
|
3
|
-
const vitestRules = {
|
|
3
|
+
export const vitestRules = {
|
|
4
4
|
plugins: {
|
|
5
5
|
'@vitest': vitestPlugin,
|
|
6
6
|
},
|
|
@@ -231,7 +231,3 @@ const vitestRules = {
|
|
|
231
231
|
'@vitest/valid-title': 'warn',
|
|
232
232
|
},
|
|
233
233
|
};
|
|
234
|
-
|
|
235
|
-
module.exports = {
|
|
236
|
-
vitestRules,
|
|
237
|
-
};
|
package/bin/init.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const { writeFileSync } = require('fs');
|
|
3
|
-
|
|
4
|
-
console.info('Add eslint config in eslint.config.mjs');
|
|
5
|
-
|
|
6
|
-
writeFileSync(
|
|
7
|
-
'eslint.config.mjs',
|
|
8
|
-
"import { defineConfig } from '@pplancq/eslint-config';\n" +
|
|
9
|
-
'\n' +
|
|
10
|
-
'export default defineConfig({\n' +
|
|
11
|
-
' enableReact: true,\n' +
|
|
12
|
-
' enableVitest: true,\n' +
|
|
13
|
-
'});\n',
|
|
14
|
-
{
|
|
15
|
-
encoding: 'utf-8',
|
|
16
|
-
},
|
|
17
|
-
);
|