@coderwyd/eslint-config 2.3.0 → 2.3.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/dist/cli.cjs +7 -6
- package/dist/cli.js +7 -6
- package/dist/index.cjs +17 -10
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +17 -10
- package/package.json +10 -10
package/dist/cli.cjs
CHANGED
|
@@ -46,7 +46,7 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
|
|
|
46
46
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
47
47
|
|
|
48
48
|
// package.json
|
|
49
|
-
var version = "2.3.
|
|
49
|
+
var version = "2.3.1";
|
|
50
50
|
var devDependencies = {
|
|
51
51
|
"@antfu/ni": "^0.21.12",
|
|
52
52
|
"@types/eslint": "^8.56.6",
|
|
@@ -54,9 +54,9 @@ var devDependencies = {
|
|
|
54
54
|
"@types/node": "^20.11.30",
|
|
55
55
|
"@types/prompts": "^2.4.9",
|
|
56
56
|
"@types/yargs": "^17.0.32",
|
|
57
|
-
"@unocss/eslint-plugin": "^0.58.
|
|
57
|
+
"@unocss/eslint-plugin": "^0.58.7",
|
|
58
58
|
bumpp: "^9.4.0",
|
|
59
|
-
eslint: "
|
|
59
|
+
eslint: "9.0.0-rc.0",
|
|
60
60
|
"eslint-flat-config-viewer": "^0.1.14",
|
|
61
61
|
"eslint-plugin-react": "^7.34.1",
|
|
62
62
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -67,7 +67,7 @@ var devDependencies = {
|
|
|
67
67
|
"fs-extra": "^11.2.0",
|
|
68
68
|
"lint-staged": "^15.2.2",
|
|
69
69
|
rimraf: "^5.0.5",
|
|
70
|
-
"simple-git-hooks": "^2.11.
|
|
70
|
+
"simple-git-hooks": "^2.11.1",
|
|
71
71
|
"svelte-eslint-parser": "^0.33.1",
|
|
72
72
|
tsup: "^8.0.2",
|
|
73
73
|
tsx: "^4.7.1",
|
|
@@ -97,7 +97,6 @@ var vscodeSettingsString = `
|
|
|
97
97
|
// Enable eslint for all supported languages
|
|
98
98
|
"eslint.validate": [
|
|
99
99
|
"svelte",
|
|
100
|
-
"astro",
|
|
101
100
|
"html",
|
|
102
101
|
"css",
|
|
103
102
|
"less",
|
|
@@ -107,7 +106,9 @@ var vscodeSettingsString = `
|
|
|
107
106
|
"yaml",
|
|
108
107
|
"yml",
|
|
109
108
|
"markdown",
|
|
110
|
-
"toml"
|
|
109
|
+
"toml",
|
|
110
|
+
"gql",
|
|
111
|
+
"graphql"
|
|
111
112
|
]
|
|
112
113
|
`;
|
|
113
114
|
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import parse from "parse-gitignore";
|
|
|
17
17
|
import c from "picocolors";
|
|
18
18
|
|
|
19
19
|
// package.json
|
|
20
|
-
var version = "2.3.
|
|
20
|
+
var version = "2.3.1";
|
|
21
21
|
var devDependencies = {
|
|
22
22
|
"@antfu/ni": "^0.21.12",
|
|
23
23
|
"@types/eslint": "^8.56.6",
|
|
@@ -25,9 +25,9 @@ var devDependencies = {
|
|
|
25
25
|
"@types/node": "^20.11.30",
|
|
26
26
|
"@types/prompts": "^2.4.9",
|
|
27
27
|
"@types/yargs": "^17.0.32",
|
|
28
|
-
"@unocss/eslint-plugin": "^0.58.
|
|
28
|
+
"@unocss/eslint-plugin": "^0.58.7",
|
|
29
29
|
bumpp: "^9.4.0",
|
|
30
|
-
eslint: "
|
|
30
|
+
eslint: "9.0.0-rc.0",
|
|
31
31
|
"eslint-flat-config-viewer": "^0.1.14",
|
|
32
32
|
"eslint-plugin-react": "^7.34.1",
|
|
33
33
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -38,7 +38,7 @@ var devDependencies = {
|
|
|
38
38
|
"fs-extra": "^11.2.0",
|
|
39
39
|
"lint-staged": "^15.2.2",
|
|
40
40
|
rimraf: "^5.0.5",
|
|
41
|
-
"simple-git-hooks": "^2.11.
|
|
41
|
+
"simple-git-hooks": "^2.11.1",
|
|
42
42
|
"svelte-eslint-parser": "^0.33.1",
|
|
43
43
|
tsup: "^8.0.2",
|
|
44
44
|
tsx: "^4.7.1",
|
|
@@ -68,7 +68,6 @@ var vscodeSettingsString = `
|
|
|
68
68
|
// Enable eslint for all supported languages
|
|
69
69
|
"eslint.validate": [
|
|
70
70
|
"svelte",
|
|
71
|
-
"astro",
|
|
72
71
|
"html",
|
|
73
72
|
"css",
|
|
74
73
|
"less",
|
|
@@ -78,7 +77,9 @@ var vscodeSettingsString = `
|
|
|
78
77
|
"yaml",
|
|
79
78
|
"yml",
|
|
80
79
|
"markdown",
|
|
81
|
-
"toml"
|
|
80
|
+
"toml",
|
|
81
|
+
"gql",
|
|
82
|
+
"graphql"
|
|
82
83
|
]
|
|
83
84
|
`;
|
|
84
85
|
|
package/dist/index.cjs
CHANGED
|
@@ -103,7 +103,7 @@ var GLOB_JSONC = "**/*.jsonc";
|
|
|
103
103
|
var GLOB_MARKDOWN = "**/*.md";
|
|
104
104
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
105
105
|
var GLOB_TOML = "**/*.toml";
|
|
106
|
-
var GLOB_GRAPHQL = "**/*.
|
|
106
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
107
107
|
var GLOB_PRETTIER_LINT = [GLOB_SRC, GLOB_VUE];
|
|
108
108
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
109
109
|
var GLOB_TESTS = [
|
|
@@ -1547,12 +1547,19 @@ async function unocss(options = {}) {
|
|
|
1547
1547
|
async function formatter(options = {}, prettierRules2 = {}) {
|
|
1548
1548
|
const {
|
|
1549
1549
|
css = true,
|
|
1550
|
-
graphql,
|
|
1550
|
+
graphql = false,
|
|
1551
1551
|
html = true,
|
|
1552
|
-
markdown,
|
|
1553
|
-
toml,
|
|
1554
|
-
yaml
|
|
1555
|
-
} = options
|
|
1552
|
+
markdown = false,
|
|
1553
|
+
toml = false,
|
|
1554
|
+
yaml = false
|
|
1555
|
+
} = typeof options === "object" ? options : {
|
|
1556
|
+
css: true,
|
|
1557
|
+
graphql: true,
|
|
1558
|
+
html: true,
|
|
1559
|
+
markdown: true,
|
|
1560
|
+
toml: true,
|
|
1561
|
+
yaml: true
|
|
1562
|
+
};
|
|
1556
1563
|
const pluginPrettier = await interopDefault(import("eslint-plugin-prettier"));
|
|
1557
1564
|
function createPrettierFormatter(files, parser, plugins) {
|
|
1558
1565
|
const rules = {
|
|
@@ -1900,10 +1907,10 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1900
1907
|
);
|
|
1901
1908
|
Object.assign(prettierRules2, prettierConfig);
|
|
1902
1909
|
}
|
|
1903
|
-
configs.push(
|
|
1904
|
-
|
|
1905
|
-
formatter(options.formatter, prettierRules2)
|
|
1906
|
-
|
|
1910
|
+
configs.push(prettier(options.formatter ? prettierRules2 : {}));
|
|
1911
|
+
if (options.formatter) {
|
|
1912
|
+
configs.push(formatter(options.formatter, prettierRules2));
|
|
1913
|
+
}
|
|
1907
1914
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
1908
1915
|
if (key in options)
|
|
1909
1916
|
acc[key] = options[key];
|
package/dist/index.d.cts
CHANGED
|
@@ -538,9 +538,6 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
538
538
|
/**
|
|
539
539
|
* Use external formatters to format files.
|
|
540
540
|
*
|
|
541
|
-
* Requires installing:
|
|
542
|
-
* - `eslint-plugin-prettier`
|
|
543
|
-
*
|
|
544
541
|
* @default
|
|
545
542
|
* {
|
|
546
543
|
* "html": true,
|
|
@@ -550,8 +547,10 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
550
547
|
* "yaml": false
|
|
551
548
|
* "toml": false
|
|
552
549
|
* }
|
|
550
|
+
*
|
|
551
|
+
* When set to `true`, it will enable all formatters.
|
|
553
552
|
*/
|
|
554
|
-
formatter?: OptionsFormatters;
|
|
553
|
+
formatter?: boolean | OptionsFormatters;
|
|
555
554
|
/**
|
|
556
555
|
* Default prettier rules
|
|
557
556
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -538,9 +538,6 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
538
538
|
/**
|
|
539
539
|
* Use external formatters to format files.
|
|
540
540
|
*
|
|
541
|
-
* Requires installing:
|
|
542
|
-
* - `eslint-plugin-prettier`
|
|
543
|
-
*
|
|
544
541
|
* @default
|
|
545
542
|
* {
|
|
546
543
|
* "html": true,
|
|
@@ -550,8 +547,10 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
550
547
|
* "yaml": false
|
|
551
548
|
* "toml": false
|
|
552
549
|
* }
|
|
550
|
+
*
|
|
551
|
+
* When set to `true`, it will enable all formatters.
|
|
553
552
|
*/
|
|
554
|
-
formatter?: OptionsFormatters;
|
|
553
|
+
formatter?: boolean | OptionsFormatters;
|
|
555
554
|
/**
|
|
556
555
|
* Default prettier rules
|
|
557
556
|
*
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var GLOB_JSONC = "**/*.jsonc";
|
|
|
57
57
|
var GLOB_MARKDOWN = "**/*.md";
|
|
58
58
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
59
59
|
var GLOB_TOML = "**/*.toml";
|
|
60
|
-
var GLOB_GRAPHQL = "**/*.
|
|
60
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
61
61
|
var GLOB_PRETTIER_LINT = [GLOB_SRC, GLOB_VUE];
|
|
62
62
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
63
63
|
var GLOB_TESTS = [
|
|
@@ -1501,12 +1501,19 @@ async function unocss(options = {}) {
|
|
|
1501
1501
|
async function formatter(options = {}, prettierRules2 = {}) {
|
|
1502
1502
|
const {
|
|
1503
1503
|
css = true,
|
|
1504
|
-
graphql,
|
|
1504
|
+
graphql = false,
|
|
1505
1505
|
html = true,
|
|
1506
|
-
markdown,
|
|
1507
|
-
toml,
|
|
1508
|
-
yaml
|
|
1509
|
-
} = options
|
|
1506
|
+
markdown = false,
|
|
1507
|
+
toml = false,
|
|
1508
|
+
yaml = false
|
|
1509
|
+
} = typeof options === "object" ? options : {
|
|
1510
|
+
css: true,
|
|
1511
|
+
graphql: true,
|
|
1512
|
+
html: true,
|
|
1513
|
+
markdown: true,
|
|
1514
|
+
toml: true,
|
|
1515
|
+
yaml: true
|
|
1516
|
+
};
|
|
1510
1517
|
const pluginPrettier = await interopDefault(import("eslint-plugin-prettier"));
|
|
1511
1518
|
function createPrettierFormatter(files, parser, plugins) {
|
|
1512
1519
|
const rules = {
|
|
@@ -1854,10 +1861,10 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1854
1861
|
);
|
|
1855
1862
|
Object.assign(prettierRules2, prettierConfig);
|
|
1856
1863
|
}
|
|
1857
|
-
configs.push(
|
|
1858
|
-
|
|
1859
|
-
formatter(options.formatter, prettierRules2)
|
|
1860
|
-
|
|
1864
|
+
configs.push(prettier(options.formatter ? prettierRules2 : {}));
|
|
1865
|
+
if (options.formatter) {
|
|
1866
|
+
configs.push(formatter(options.formatter, prettierRules2));
|
|
1867
|
+
}
|
|
1861
1868
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
1862
1869
|
if (key in options)
|
|
1863
1870
|
acc[key] = options[key];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.1",
|
|
5
5
|
"packageManager": "pnpm@8.15.5",
|
|
6
6
|
"description": "Donny's ESLint config",
|
|
7
7
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"@eslint-types/typescript-eslint": "^7.2.0",
|
|
73
73
|
"@eslint-types/unicorn": "^51.0.1",
|
|
74
74
|
"@toml-tools/parser": "^1.0.0",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
76
|
-
"@typescript-eslint/parser": "^7.
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
76
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
77
77
|
"eslint-config-flat-gitignore": "^0.1.3",
|
|
78
78
|
"eslint-config-prettier": "^9.1.0",
|
|
79
79
|
"eslint-plugin-antfu": "^2.1.2",
|
|
80
80
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
|
-
"eslint-plugin-import-x": "^0.4.
|
|
81
|
+
"eslint-plugin-import-x": "^0.4.4",
|
|
82
82
|
"eslint-plugin-jsdoc": "^48.2.1",
|
|
83
83
|
"eslint-plugin-jsonc": "^2.14.1",
|
|
84
84
|
"eslint-plugin-n": "^16.6.2",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
89
89
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
90
90
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
91
|
-
"eslint-plugin-vitest": "^0.
|
|
92
|
-
"eslint-plugin-vue": "^9.
|
|
93
|
-
"globals": "^
|
|
91
|
+
"eslint-plugin-vitest": "^0.4.0",
|
|
92
|
+
"eslint-plugin-vue": "^9.24.0",
|
|
93
|
+
"globals": "^15.0.0",
|
|
94
94
|
"jsonc-eslint-parser": "^2.4.0",
|
|
95
95
|
"local-pkg": "^0.5.0",
|
|
96
96
|
"parse-gitignore": "^2.0.0",
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
"@types/node": "^20.11.30",
|
|
109
109
|
"@types/prompts": "^2.4.9",
|
|
110
110
|
"@types/yargs": "^17.0.32",
|
|
111
|
-
"@unocss/eslint-plugin": "^0.58.
|
|
111
|
+
"@unocss/eslint-plugin": "^0.58.7",
|
|
112
112
|
"bumpp": "^9.4.0",
|
|
113
|
-
"eslint": "
|
|
113
|
+
"eslint": "9.0.0-rc.0",
|
|
114
114
|
"eslint-flat-config-viewer": "^0.1.14",
|
|
115
115
|
"eslint-plugin-react": "^7.34.1",
|
|
116
116
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"fs-extra": "^11.2.0",
|
|
122
122
|
"lint-staged": "^15.2.2",
|
|
123
123
|
"rimraf": "^5.0.5",
|
|
124
|
-
"simple-git-hooks": "^2.11.
|
|
124
|
+
"simple-git-hooks": "^2.11.1",
|
|
125
125
|
"svelte-eslint-parser": "^0.33.1",
|
|
126
126
|
"tsup": "^8.0.2",
|
|
127
127
|
"tsx": "^4.7.1",
|