@ivuorinen/eslint-config 0.5.13 → 1.0.1
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/index.cjs +26 -26
- package/jest.cjs +13 -13
- package/package.json +17 -13
- package/scripts/postinstall.cjs +13 -13
- package/wrapper-jest.mjs +2 -2
- package/wrapper.mjs +2 -2
package/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const globals = require(
|
|
4
|
-
const configEslint = require(
|
|
5
|
-
const configPrettier = require(
|
|
6
|
-
const pluginImport = require(
|
|
7
|
-
const pluginJs = require(
|
|
8
|
-
const pluginN = require(
|
|
9
|
-
const pluginPromise = require(
|
|
3
|
+
const globals = require("globals");
|
|
4
|
+
const configEslint = require("eslint-config-eslint");
|
|
5
|
+
const configPrettier = require("eslint-config-prettier");
|
|
6
|
+
const pluginImport = require("eslint-plugin-import");
|
|
7
|
+
const pluginJs = require("@eslint/js");
|
|
8
|
+
const pluginN = require("eslint-plugin-n");
|
|
9
|
+
const pluginPromise = require("eslint-plugin-promise");
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @type { import("eslint").Linter.Config[] } config eslint configuration.
|
|
@@ -15,42 +15,42 @@ module.exports = [
|
|
|
15
15
|
...configEslint,
|
|
16
16
|
{
|
|
17
17
|
linterOptions: {
|
|
18
|
-
reportUnusedDisableDirectives:
|
|
18
|
+
reportUnusedDisableDirectives: "warn",
|
|
19
19
|
},
|
|
20
20
|
rules: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
"func-style": [
|
|
22
|
+
"error",
|
|
23
|
+
"declaration",
|
|
24
24
|
{
|
|
25
|
-
allowArrowFunctions: true
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
25
|
+
allowArrowFunctions: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
files: [
|
|
31
|
+
files: ["**/*.{js,mjs,cjs}"],
|
|
32
32
|
languageOptions: {
|
|
33
33
|
globals: {
|
|
34
34
|
...globals.browser,
|
|
35
35
|
...globals.commonjs,
|
|
36
36
|
...globals.es2021,
|
|
37
|
-
...globals.node
|
|
37
|
+
...globals.node,
|
|
38
38
|
},
|
|
39
39
|
parserOptions: {
|
|
40
|
-
ecmaVersion: 12
|
|
41
|
-
}
|
|
42
|
-
}
|
|
40
|
+
ecmaVersion: 12,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
43
|
},
|
|
44
44
|
pluginJs.configs.recommended,
|
|
45
45
|
{
|
|
46
46
|
plugins: {
|
|
47
47
|
n: pluginN,
|
|
48
48
|
import: pluginImport,
|
|
49
|
-
promise: pluginPromise
|
|
50
|
-
}
|
|
49
|
+
promise: pluginPromise,
|
|
50
|
+
},
|
|
51
51
|
},
|
|
52
52
|
configPrettier,
|
|
53
53
|
{
|
|
54
|
-
ignores: [
|
|
55
|
-
}
|
|
56
|
-
]
|
|
54
|
+
ignores: ["coverage/", "dist/", "lib/", "node_modules/"],
|
|
55
|
+
},
|
|
56
|
+
];
|
package/jest.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const jest = require(
|
|
3
|
+
const jest = require("eslint-plugin-jest");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* eslint configuration for jest.
|
|
@@ -8,21 +8,21 @@ const jest = require('eslint-plugin-jest')
|
|
|
8
8
|
*/
|
|
9
9
|
module.exports = [
|
|
10
10
|
{
|
|
11
|
-
files: [
|
|
11
|
+
files: ["**/*.{js,mjs,cjs}"],
|
|
12
12
|
languageOptions: {
|
|
13
13
|
globals: {
|
|
14
|
-
...jest.globals
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
...jest.globals,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
17
|
},
|
|
18
|
-
jest.configs[
|
|
19
|
-
jest.configs[
|
|
18
|
+
jest.configs["flat/recommended"],
|
|
19
|
+
jest.configs["flat/style"],
|
|
20
20
|
{
|
|
21
21
|
rules: {
|
|
22
|
-
...jest.rules[
|
|
22
|
+
...jest.rules["flat/recommended"].rules,
|
|
23
23
|
},
|
|
24
24
|
plugins: {
|
|
25
|
-
jest
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
25
|
+
jest,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ivuorinen/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "ivuorinen's shareable configuration for ESLint.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ismo Vuorinen",
|
|
@@ -48,20 +48,24 @@
|
|
|
48
48
|
"url": "git+https://github.com/ivuorinen/base-configs-eslint.git"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"postinstall": "node scripts/postinstall.cjs"
|
|
51
|
+
"postinstall": "node scripts/postinstall.cjs",
|
|
52
|
+
"semantic-release": "semantic-release --ci"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"@eslint/js": "^
|
|
55
|
-
"@ivuorinen/config-checker": "^1.1
|
|
56
|
-
"eslint": "^
|
|
57
|
-
"eslint-config-eslint": "^
|
|
58
|
-
"eslint-config-prettier": "^10.
|
|
59
|
-
"eslint-plugin-import": "^2",
|
|
60
|
-
"eslint-plugin-jest": "^29.
|
|
61
|
-
"eslint-plugin-n": "^17",
|
|
62
|
-
"eslint-plugin-promise": "^7",
|
|
63
|
-
"globals": "^
|
|
55
|
+
"@eslint/js": "^10.0.0",
|
|
56
|
+
"@ivuorinen/config-checker": "^2.1.1",
|
|
57
|
+
"eslint": "^10.0.0",
|
|
58
|
+
"eslint-config-eslint": "^13.0.0",
|
|
59
|
+
"eslint-config-prettier": "^10.1.8",
|
|
60
|
+
"eslint-plugin-import": "^2.32.0",
|
|
61
|
+
"eslint-plugin-jest": "^29.2.1",
|
|
62
|
+
"eslint-plugin-n": "^17.23.1",
|
|
63
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
64
|
+
"globals": "^17.0.0",
|
|
64
65
|
"typescript": ">=4.2.0"
|
|
65
66
|
},
|
|
66
|
-
"
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@ivuorinen/semantic-release-config": "^1.0.0"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "yarn@4.12.0"
|
|
67
71
|
}
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint no-console: "off", n/no-process-exit: "off" -- CLI app that gives users feedback */
|
|
4
4
|
|
|
5
|
-
const fs = require(
|
|
6
|
-
const path = require(
|
|
7
|
-
const process = require(
|
|
8
|
-
const checkConfig = require(
|
|
9
|
-
const foundConfig = checkConfig(
|
|
5
|
+
const fs = require("node:fs");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
const process = require("node:process");
|
|
8
|
+
const checkConfig = require("@ivuorinen/config-checker");
|
|
9
|
+
const foundConfig = checkConfig("eslint");
|
|
10
10
|
|
|
11
11
|
if (foundConfig.length > 0) {
|
|
12
|
-
console.log(
|
|
13
|
-
console.log(
|
|
14
|
-
console.log(`eslint-config: Found config files at: ${foundConfig.join(
|
|
15
|
-
process.exit(0)
|
|
12
|
+
console.log("eslint-config: Found existing eslint config file, skipping creation.");
|
|
13
|
+
console.log("eslint-config: If you want to create a new config file, please remove the existing one.");
|
|
14
|
+
console.log(`eslint-config: Found config files at: ${foundConfig.join(", ")}`);
|
|
15
|
+
process.exit(0);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const filePath = path.join(process.env.INIT_CWD,
|
|
18
|
+
const filePath = path.join(process.env.INIT_CWD, "eslint.config.mjs");
|
|
19
19
|
const fileConfig = `import ivuorinenConfig from '@ivuorinen/eslint-config';
|
|
20
20
|
|
|
21
21
|
export default [
|
|
@@ -28,8 +28,8 @@ export default [
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
];
|
|
31
|
-
|
|
31
|
+
`;
|
|
32
32
|
|
|
33
33
|
if (!fs.existsSync(filePath)) {
|
|
34
|
-
fs.writeFileSync(filePath, fileConfig)
|
|
34
|
+
fs.writeFileSync(filePath, fileConfig);
|
|
35
35
|
}
|
package/wrapper-jest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import config from
|
|
2
|
-
export default config
|
|
1
|
+
import config from "./jest.cjs";
|
|
2
|
+
export default config;
|
package/wrapper.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import config from
|
|
2
|
-
export default config
|
|
1
|
+
import config from "./index.cjs";
|
|
2
|
+
export default config;
|