@pob/eslint-config 58.1.0 → 59.2.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 +28 -0
- package/lib/_base.js +2 -0
- package/lib/index.js +3 -13
- package/lib/plugins/import/import-base.js +13 -28
- package/lib/plugins/regexp.js +9 -0
- package/lib/plugins/unicorn.js +9 -3
- package/lib/rules/style.js +3 -0
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [59.2.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v59.1.2...v59.2.0) (2024-12-17)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **deps:** update typescript-eslint monorepo ([#706](https://github.com/christophehurpeau/eslint-config-pob/issues/706)) ([5c50d85](https://github.com/christophehurpeau/eslint-config-pob/commit/5c50d857bd2d4f93160cb70e594445a57f4d7fe9))
|
|
11
|
+
|
|
12
|
+
Version bump for dependency: @pob/eslint-plugin
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [59.0.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v58.1.0...v59.0.0) (2024-11-26)
|
|
16
|
+
|
|
17
|
+
### ⚠ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* drop node 18
|
|
20
|
+
* drop compat now that all used eslint plugins supports eslint 9
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* drop compat now that all used eslint plugins supports eslint 9 ([1f6031c](https://github.com/christophehurpeau/eslint-config-pob/commit/1f6031c7c22335044866b2fce15cd72c7c9af721))
|
|
25
|
+
* enable sort-imports ([d61be03](https://github.com/christophehurpeau/eslint-config-pob/commit/d61be03ceaedde94d6d95c518c8cdbbb13f7ef61))
|
|
26
|
+
|
|
27
|
+
### Miscellaneous Chores
|
|
28
|
+
|
|
29
|
+
* update dev deps and require node 20 ([cbe9fb1](https://github.com/christophehurpeau/eslint-config-pob/commit/cbe9fb15f719edb50251f925ff19b987a159b530))
|
|
30
|
+
|
|
31
|
+
Version bump for dependency: @pob/eslint-plugin
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [58.1.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v58.0.2...v58.1.0) (2024-09-09)
|
|
7
35
|
|
|
8
36
|
### Features
|
package/lib/_base.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import js from "@eslint/js";
|
|
2
2
|
import pobPlugin from "@pob/eslint-plugin";
|
|
3
|
+
import regexpPluginConfigs from "./plugins/regexp.js";
|
|
3
4
|
import unicornPluginConfigs from "./plugins/unicorn.js";
|
|
4
5
|
import bestPracticesConfig from "./rules/best-practices.js";
|
|
5
6
|
import codeQualityConfig from "./rules/code-quality.js";
|
|
@@ -30,6 +31,7 @@ export default [
|
|
|
30
31
|
js.configs.recommended,
|
|
31
32
|
pobPlugin.configs.base,
|
|
32
33
|
...unicornPluginConfigs,
|
|
34
|
+
...regexpPluginConfigs,
|
|
33
35
|
bestPracticesConfig,
|
|
34
36
|
codeQualityConfig,
|
|
35
37
|
errorsConfig,
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/* eslint-disable complexity */
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
2
|
import { isDeepStrictEqual } from "node:util";
|
|
5
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
3
|
import baseConfigs from "./_base.js";
|
|
7
4
|
import baseCommonjsConfig from "./base/commonjs.js";
|
|
8
5
|
import baseModuleConfig from "./base/module.js";
|
|
@@ -83,9 +80,7 @@ export const apply = ({
|
|
|
83
80
|
});
|
|
84
81
|
};
|
|
85
82
|
|
|
86
|
-
export default (
|
|
87
|
-
const __filename = fileURLToPath(url);
|
|
88
|
-
const __dirname = path.dirname(__filename);
|
|
83
|
+
export default () => {
|
|
89
84
|
const extensions = "{js,cjs,mjs}";
|
|
90
85
|
|
|
91
86
|
const testFiles = [
|
|
@@ -94,14 +89,10 @@ export default (url) => {
|
|
|
94
89
|
`**/__mocks__/**/*.${extensions}`,
|
|
95
90
|
];
|
|
96
91
|
|
|
97
|
-
const compat = new FlatCompat({
|
|
98
|
-
baseDirectory: __dirname,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
92
|
const nodeCommonjs = [
|
|
102
93
|
...baseConfigs,
|
|
103
94
|
baseCommonjsConfig,
|
|
104
|
-
...importPluginBaseConfigs
|
|
95
|
+
...importPluginBaseConfigs,
|
|
105
96
|
importPluginCommonjsConfig,
|
|
106
97
|
...nodePluginCommonjsConfigs,
|
|
107
98
|
|
|
@@ -123,7 +114,7 @@ export default (url) => {
|
|
|
123
114
|
const baseModule = [
|
|
124
115
|
...baseConfigs,
|
|
125
116
|
baseModuleConfig,
|
|
126
|
-
...importPluginBaseConfigs
|
|
117
|
+
...importPluginBaseConfigs,
|
|
127
118
|
importPluginModuleConfig,
|
|
128
119
|
|
|
129
120
|
...apply({
|
|
@@ -148,7 +139,6 @@ export default (url) => {
|
|
|
148
139
|
];
|
|
149
140
|
|
|
150
141
|
return {
|
|
151
|
-
compat,
|
|
152
142
|
configs: {
|
|
153
143
|
baseModule,
|
|
154
144
|
nodeModule,
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import importPlugin from "eslint-plugin-import";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!plugin) {
|
|
7
|
-
throw new Error(`Unable to resolve plugin ${name} and/or alias ${alias}`);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return fixupPluginRules(plugin);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default (compat) => [
|
|
3
|
+
export default [
|
|
4
|
+
importPlugin.flatConfigs.recommended,
|
|
14
5
|
{
|
|
15
|
-
|
|
6
|
+
name: "@pob/eslint-config/import/base",
|
|
7
|
+
// override recommended language options
|
|
16
8
|
languageOptions: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
sourceType: "module",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
plugins: {
|
|
23
|
-
import: legacyPlugin(compat, "eslint-plugin-import", "import"),
|
|
9
|
+
ecmaVersion: "latest",
|
|
10
|
+
sourceType: "module",
|
|
24
11
|
},
|
|
25
12
|
settings: {
|
|
13
|
+
"import/extensions": [".js", ".mjs"],
|
|
14
|
+
"import/ignore": ["node_modules"],
|
|
26
15
|
"import/parsers": {
|
|
27
16
|
// https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
|
|
28
17
|
espree: [".js", ".cjs", ".mjs"],
|
|
@@ -31,14 +20,10 @@ export default (compat) => [
|
|
|
31
20
|
node: true,
|
|
32
21
|
},
|
|
33
22
|
},
|
|
34
|
-
},
|
|
35
|
-
...compat.config({
|
|
36
|
-
settings: {
|
|
37
|
-
"import/extensions": [".js", ".mjs"],
|
|
38
|
-
"import/ignore": ["node_modules"],
|
|
39
|
-
},
|
|
40
|
-
|
|
41
23
|
rules: {
|
|
24
|
+
// disable in recommended
|
|
25
|
+
"import/default": "off",
|
|
26
|
+
|
|
42
27
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
43
28
|
"import/no-unresolved": [
|
|
44
29
|
"error",
|
|
@@ -128,7 +113,7 @@ export default (compat) => [
|
|
|
128
113
|
},
|
|
129
114
|
],
|
|
130
115
|
},
|
|
131
|
-
}
|
|
116
|
+
},
|
|
132
117
|
{
|
|
133
118
|
name: "@pob/eslint-config/import/rollup-config",
|
|
134
119
|
files: ["rollup.config.mjs", "rollup.config.mjs"],
|
package/lib/plugins/unicorn.js
CHANGED
|
@@ -56,9 +56,6 @@ export default [
|
|
|
56
56
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
57
57
|
"unicorn/new-for-builtins": "error",
|
|
58
58
|
|
|
59
|
-
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
60
|
-
"unicorn/better-regex": "error",
|
|
61
|
-
|
|
62
59
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
|
|
63
60
|
"unicorn/prefer-spread": "error",
|
|
64
61
|
|
|
@@ -339,6 +336,15 @@ export default [
|
|
|
339
336
|
|
|
340
337
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
|
|
341
338
|
"unicorn/prefer-blob-reading-methods": "error",
|
|
339
|
+
|
|
340
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
|
|
341
|
+
"unicorn/prefer-global-this": "warn",
|
|
342
|
+
|
|
343
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md
|
|
344
|
+
"unicorn/prefer-math-min-max": "error",
|
|
345
|
+
|
|
346
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
|
|
347
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
342
348
|
},
|
|
343
349
|
},
|
|
344
350
|
{
|
package/lib/rules/style.js
CHANGED
|
@@ -20,6 +20,9 @@ export default {
|
|
|
20
20
|
{ avoidEscape: true, allowTemplateLiterals: false },
|
|
21
21
|
],
|
|
22
22
|
|
|
23
|
+
// https://eslint.org/docs/latest/rules/sort-imports ; declaration is sorted using import/order
|
|
24
|
+
"sort-imports": ["error", { ignoreDeclarationSort: true }],
|
|
25
|
+
|
|
23
26
|
/* disabled rules */
|
|
24
27
|
|
|
25
28
|
// http://eslint.org/docs/rules/no-else-return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pob/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "59.2.0",
|
|
4
4
|
"description": "eslint config files",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Christophe Hurpeau <christophe@hurpeau.com> (http://christophe.hurpeau.com/)",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"homepage": "https://github.com/christophehurpeau/eslint-config-pob",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
16
|
+
"node": ">=20.9.0"
|
|
17
17
|
},
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"main": "./lib/index.js",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"eslint": "^9.9.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@eslint/compat": "^1.1.1",
|
|
47
|
-
"@eslint/eslintrc": "3.1.0",
|
|
48
46
|
"@eslint/js": "^9.9.0",
|
|
49
|
-
"@pob/eslint-plugin": "
|
|
47
|
+
"@pob/eslint-plugin": "59.2.0",
|
|
50
48
|
"confusing-browser-globals": "^1.0.11",
|
|
51
|
-
"eslint-plugin-import": "^2.
|
|
52
|
-
"eslint-plugin-n": "^17.
|
|
53
|
-
"eslint-plugin-
|
|
49
|
+
"eslint-plugin-import": "^2.31.0",
|
|
50
|
+
"eslint-plugin-n": "^17.15.0",
|
|
51
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
52
|
+
"eslint-plugin-unicorn": "^56.0.1"
|
|
54
53
|
},
|
|
55
54
|
"devDependencies": {
|
|
56
|
-
"eslint": "9.
|
|
57
|
-
"eslint-plugin-import": "2.
|
|
58
|
-
"eslint-plugin-n": "17.
|
|
59
|
-
"eslint-plugin-
|
|
60
|
-
"
|
|
55
|
+
"eslint": "9.17.0",
|
|
56
|
+
"eslint-plugin-import": "2.31.0",
|
|
57
|
+
"eslint-plugin-n": "17.15.0",
|
|
58
|
+
"eslint-plugin-regexp": "2.7.0",
|
|
59
|
+
"eslint-plugin-unicorn": "56.0.1",
|
|
60
|
+
"typescript": "5.7.2"
|
|
61
61
|
}
|
|
62
62
|
}
|