@kitql/eslint-config 0.3.1 → 0.3.3
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/cmd.js +20 -1
- package/package.json +10 -10
package/cmd.js
CHANGED
|
@@ -10,6 +10,13 @@ const log = new Log('kitql-lint')
|
|
|
10
10
|
program.addOption(new Option('-f, --format', 'format'))
|
|
11
11
|
program.addOption(new Option('-g, --glob <type>', 'file/dir/glob (. by default)', '.'))
|
|
12
12
|
program.addOption(new Option('--verbose', 'add more logs', false))
|
|
13
|
+
program.addOption(
|
|
14
|
+
new Option(
|
|
15
|
+
'-p, --prefix <type>',
|
|
16
|
+
'prefix by with "pnpm" or "npm" or "none" ("none" by default)',
|
|
17
|
+
'none',
|
|
18
|
+
),
|
|
19
|
+
)
|
|
13
20
|
|
|
14
21
|
program.parse(process.argv)
|
|
15
22
|
const options_cli = program.opts()
|
|
@@ -37,9 +44,20 @@ let pathPrettierCjs = findFileOrUp('.prettierrc.cjs')
|
|
|
37
44
|
const format = options_cli.format ?? false
|
|
38
45
|
const glob = options_cli.glob ?? '.'
|
|
39
46
|
const verbose = options_cli.verbose ?? false
|
|
47
|
+
const pre = options_cli.prefix ?? 'none'
|
|
48
|
+
|
|
49
|
+
let preToUse = ''
|
|
50
|
+
if (pre === 'npm') {
|
|
51
|
+
preToUse = 'npm exec '
|
|
52
|
+
} else if (pre === 'pnpm') {
|
|
53
|
+
preToUse = 'pnpm '
|
|
54
|
+
} else {
|
|
55
|
+
preToUse = ''
|
|
56
|
+
}
|
|
40
57
|
|
|
41
58
|
// First prettier
|
|
42
59
|
const cmdPrettier =
|
|
60
|
+
preToUse +
|
|
43
61
|
`prettier` +
|
|
44
62
|
` --list-different` +
|
|
45
63
|
// ignore?
|
|
@@ -87,6 +105,7 @@ if (format && verbose) {
|
|
|
87
105
|
function esLintRun(code) {
|
|
88
106
|
// Then eslint
|
|
89
107
|
const cmdEsLint =
|
|
108
|
+
preToUse +
|
|
90
109
|
`eslint` +
|
|
91
110
|
// ignore?
|
|
92
111
|
` --ignore-path ${pathPrettierIgnore}` +
|
|
@@ -137,7 +156,7 @@ result_prettier.stdout.on('readable', (data) => {
|
|
|
137
156
|
}
|
|
138
157
|
})
|
|
139
158
|
result_prettier.stdout.on('resume', (data) => {
|
|
140
|
-
if (verbose) {
|
|
159
|
+
if (verbose && data) {
|
|
141
160
|
log.info(`resume`, data)
|
|
142
161
|
}
|
|
143
162
|
esLintRun(0)
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"eslint",
|
|
7
7
|
"eslint-config"
|
|
8
8
|
],
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"repository": {
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"main": "index.cjs",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@graphql-eslint/eslint-plugin": "3.20.1",
|
|
24
|
-
"@kitql/helpers": "0.8.
|
|
24
|
+
"@kitql/helpers": "0.8.9",
|
|
25
25
|
"@theguild/eslint-config": "^0.11.1",
|
|
26
26
|
"@theguild/prettier-config": "2.0.2",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "
|
|
28
|
-
"@typescript-eslint/parser": "
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "7.7.0",
|
|
28
|
+
"@typescript-eslint/parser": "7.7.0",
|
|
29
29
|
"@vue/compiler-sfc": "3.4.7",
|
|
30
30
|
"commander": "^12.0.0",
|
|
31
|
-
"eslint": "8.
|
|
31
|
+
"eslint": "8.57.0",
|
|
32
32
|
"eslint-config-prettier": "9.1.0",
|
|
33
|
-
"eslint-plugin-svelte": "2.
|
|
34
|
-
"eslint-plugin-unused-imports": "3.
|
|
33
|
+
"eslint-plugin-svelte": "2.39.3",
|
|
34
|
+
"eslint-plugin-unused-imports": "3.2.0",
|
|
35
35
|
"prettier": "3.2.4",
|
|
36
36
|
"prettier-plugin-sh": "0.14.0",
|
|
37
|
-
"prettier-plugin-svelte": "3.
|
|
37
|
+
"prettier-plugin-svelte": "3.2.2",
|
|
38
38
|
"prettier-plugin-tailwindcss": "0.5.7",
|
|
39
39
|
"svelte": "4.2.0",
|
|
40
|
-
"typescript": "5.
|
|
40
|
+
"typescript": "5.4.2"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"publishConfig": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
".prettierrc.cjs"
|
|
52
52
|
],
|
|
53
53
|
"scripts": {
|
|
54
|
-
"lint": "node ./cmd.js",
|
|
54
|
+
"lint": "node ./cmd.js --verbose -p none",
|
|
55
55
|
"format": "node ./cmd.js -f",
|
|
56
56
|
"lint:example": "kitql-lint",
|
|
57
57
|
"format:example": "kitql-lint --format"
|