@pob/eslint-config 56.1.0 → 57.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.
@@ -1,8 +1,6 @@
1
- "use strict";
1
+ import confusingBrowserGlobals from "confusing-browser-globals";
2
2
 
3
- const confusingBrowserGlobals = require("confusing-browser-globals");
4
-
5
- module.exports = {
3
+ export default {
6
4
  rules: {
7
5
  // https://eslint.org/docs/rules/accessor-pairs
8
6
  "accessor-pairs": "off",
@@ -198,6 +196,9 @@ module.exports = {
198
196
  // https://eslint.org/docs/rules/no-new-object
199
197
  "no-new-object": "error",
200
198
 
199
+ // disallow use of new operator with the require function
200
+ "no-new-require": "error",
201
+
201
202
  // https://eslint.org/docs/rules/no-new-wrappers
202
203
  "no-new-wrappers": "error",
203
204
 
@@ -343,7 +344,12 @@ module.exports = {
343
344
  // https://eslint.org/docs/rules/no-unused-vars
344
345
  "no-unused-vars": [
345
346
  "error",
346
- { vars: "all", args: "none", ignoreRestSiblings: true },
347
+ {
348
+ vars: "all",
349
+ args: "none",
350
+ caughtErrors: "none",
351
+ ignoreRestSiblings: true,
352
+ },
347
353
  ],
348
354
 
349
355
  // https://eslint.org/docs/rules/no-use-before-define
@@ -1,6 +1,4 @@
1
- "use strict";
2
-
3
- module.exports = {
1
+ export default {
4
2
  rules: {
5
3
  complexity: ["warn", { max: 8 }],
6
4
  "max-depth": ["warn", 6],
@@ -1,6 +1,6 @@
1
- "use strict";
2
-
3
- module.exports = {
1
+ export default {
2
+ files: ["**/*.{js,cjs,mjs}"],
3
+ ignores: ["**/{src,lib}/*.{js,cjs,mjs}"],
4
4
  rules: {
5
5
  "no-console": "off",
6
6
 
@@ -1,6 +1,4 @@
1
- "use strict";
2
-
3
- module.exports = {
1
+ export default {
4
2
  rules: {
5
3
  // https://eslint.org/docs/rules/for-direction
6
4
  "for-direction": "error",
@@ -1,6 +1,4 @@
1
- "use strict";
2
-
3
- module.exports = {
1
+ export default {
4
2
  rules: {
5
3
  // changed properties: 'never' to properties: 'always' ; true to 'ignoreDestructuring': false
6
4
  // http://eslint.org/docs/rules/camelcase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/eslint-config",
3
- "version": "56.1.0",
3
+ "version": "57.0.0",
4
4
  "description": "eslint config files",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (http://christophe.hurpeau.com/)",
@@ -11,7 +11,7 @@
11
11
  "directory": "@pob/eslint-config"
12
12
  },
13
13
  "homepage": "https://github.com/christophehurpeau/eslint-config-pob",
14
- "type": "commonjs",
14
+ "type": "module",
15
15
  "engines": {
16
16
  "node": ">=18.12.0"
17
17
  },
@@ -19,10 +19,6 @@
19
19
  "main": "./lib/index.js",
20
20
  "exports": {
21
21
  ".": "./lib/index.js",
22
- "./node-commonjs": "./lib/node-commonjs.js",
23
- "./node-module": "./lib/node-module.js",
24
- "./root-commonjs": "./lib/root-commonjs.js",
25
- "./root-module": "./lib/root-module.js",
26
22
  "./lib/rules/best-practices": "./lib/rules/best-practices.js",
27
23
  "./lib/rules/code-quality": "./lib/rules/code-quality.js",
28
24
  "./lib/rules/errors": "./lib/rules/errors.js",
@@ -39,7 +35,7 @@
39
35
  ],
40
36
  "scripts": {
41
37
  "lint": "yarn run lint:eslint",
42
- "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet @pob/eslint-config"
38
+ "lint:eslint": "yarn ../.. run eslint --quiet @pob/eslint-config"
43
39
  },
44
40
  "pob": {},
45
41
  "prettier": "@pob/root/prettier-config",
@@ -47,7 +43,10 @@
47
43
  "eslint": "^8.56.0"
48
44
  },
49
45
  "dependencies": {
50
- "@pob/eslint-plugin": "56.1.0",
46
+ "@eslint/compat": "^1.1.1",
47
+ "@eslint/eslintrc": "2.1.4",
48
+ "@eslint/js": "^8.56.0",
49
+ "@pob/eslint-plugin": "57.0.0",
51
50
  "confusing-browser-globals": "^1.0.11",
52
51
  "eslint-plugin-import": "^2.29.1",
53
52
  "eslint-plugin-n": "^17.4.0",
@@ -57,6 +56,7 @@
57
56
  "eslint": "8.57.0",
58
57
  "eslint-plugin-import": "2.29.1",
59
58
  "eslint-plugin-n": "17.4.0",
60
- "eslint-plugin-unicorn": "52.0.0"
59
+ "eslint-plugin-unicorn": "52.0.0",
60
+ "typescript": "5.5.4"
61
61
  }
62
62
  }
package/utils.js CHANGED
@@ -1,7 +1,5 @@
1
- "use strict";
2
-
3
1
  const isVSCode =
4
2
  process.argv &&
5
3
  process.argv.some((argv) => argv.includes("dbaeumer.vscode-eslint"));
6
4
 
7
- exports.enableIfVSCode = (ruleLevel) => (isVSCode ? ruleLevel : "off");
5
+ export const enableIfVSCode = (ruleLevel) => (isVSCode ? ruleLevel : "off");
@@ -1,4 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": ["../../eslint-config/lib/node-commonjs"]
4
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- extends: [
5
- "./_base",
6
- "./base/commonjs",
7
- "./plugins/import/import-commonjs",
8
- "./node/commonjs",
9
- ].map(require.resolve),
10
-
11
- overrides: [
12
- {
13
- files: ["*.mjs"],
14
- extends: [
15
- "./_base",
16
- "./base/module",
17
- "./plugins/import/import-module",
18
- "./node/module",
19
- ].map(require.resolve),
20
- },
21
- {
22
- files: ["*.cjs"],
23
- },
24
- ],
25
- };
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- extends: [
5
- "./_base",
6
- "./base/module",
7
- "./plugins/import/import-module",
8
- "./node/module",
9
- ].map(require.resolve),
10
-
11
- overrides: [
12
- {
13
- files: ["*.cjs"],
14
- extends: [
15
- "./_base",
16
- "./base/commonjs",
17
- "./plugins/import/import-commonjs",
18
- "./node/commonjs",
19
- ].map(require.resolve),
20
- },
21
- {
22
- files: ["*.mjs"],
23
- },
24
- ],
25
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- extends: ["./node-commonjs", "./rules/dev-only"].map(require.resolve),
5
- ignorePatterns: ["**/node_modules/**"],
6
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- extends: ["./node-module", "./rules/dev-only"].map(require.resolve),
5
- ignorePatterns: ["**/node_modules/**"],
6
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- rules: {
5
- // disallow use of new operator with the require function
6
- "no-new-require": "error",
7
- },
8
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- rules: {
5
- // https://eslint.org/docs/rules/global-require
6
- "global-require": "error",
7
-
8
- // disallow use of new operator with the require function
9
- "no-new-require": "error",
10
- },
11
- };
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- rules: {
5
- // replaced by import/no-duplicates
6
- "no-duplicate-imports": "off",
7
-
8
- // https://eslint.org/docs/rules/no-restricted-exports
9
- "no-restricted-exports": [
10
- "error",
11
- {
12
- restrictDefaultExports: {
13
- direct: false, // permits `export default` declarations
14
- named: true, // restricts `export { foo as default };` declarations
15
- defaultFrom: false, // permits `export { default } from 'foo';` declarations
16
- namedFrom: false, // permits `export { foo as default } from 'foo';` declarations
17
- namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
18
- },
19
- restrictedNamedExports: [
20
- "then", // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
21
- ],
22
- },
23
- ],
24
- },
25
- };