@kitql/eslint-config 0.8.3 → 0.8.4
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 +43 -23
- package/package.json +10 -11
package/cmd.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { spawn } from 'node:child_process'
|
|
3
3
|
import fs from 'node:fs'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
-
import { Option, program } from 'commander'
|
|
6
5
|
|
|
7
6
|
import { gray, green, Log } from '@kitql/helpers'
|
|
7
|
+
import { parseCli } from '@kitql/helpers/server'
|
|
8
8
|
|
|
9
9
|
import { findFileOrUp } from './helper/findFileOrUp.js'
|
|
10
10
|
|
|
@@ -12,25 +12,43 @@ import { findFileOrUp } from './helper/findFileOrUp.js'
|
|
|
12
12
|
const TOOLS_ALL = ['eslint', 'prettier', 'oxlint', 'tsgolint']
|
|
13
13
|
const TOOLS_DEFAULT = TOOLS_ALL.slice(0, 2)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
const { values: options_cli, help } = parseCli({
|
|
16
|
+
name: 'kitql-lint',
|
|
17
|
+
options: {
|
|
18
|
+
format: { type: 'boolean', short: 'f', description: 'format' },
|
|
19
|
+
glob: { type: 'string', short: 'g', default: '.', description: 'file/dir/glob' },
|
|
20
|
+
tools: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
short: 't',
|
|
23
|
+
default: TOOLS_DEFAULT.join(','),
|
|
24
|
+
description: 'tools to use (eslint, prettier, oxlint, tsgolint)',
|
|
25
|
+
},
|
|
26
|
+
verbose: { type: 'boolean', short: 'v', default: false, description: 'add more logs' },
|
|
27
|
+
'diff-only': {
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
short: 'd',
|
|
30
|
+
default: false,
|
|
31
|
+
description: 'only check files changed against base branch',
|
|
32
|
+
},
|
|
33
|
+
'base-branch': {
|
|
34
|
+
type: 'string',
|
|
35
|
+
short: 'b',
|
|
36
|
+
default: 'main',
|
|
37
|
+
description: 'base branch to compare against',
|
|
38
|
+
},
|
|
39
|
+
prefix: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
short: 'p',
|
|
42
|
+
default: 'none',
|
|
43
|
+
description: 'prefix by with "pnpm" or "npm" or "none"',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
if (options_cli.help) {
|
|
49
|
+
console.info(help)
|
|
50
|
+
process.exit(0)
|
|
51
|
+
}
|
|
34
52
|
|
|
35
53
|
const pathPrettierIgnore = findFileOrUp('.prettierignore')
|
|
36
54
|
const pathPrettier_js = findFileOrUp('.prettierrc.js')
|
|
@@ -39,9 +57,11 @@ const format = /** @type {boolean} */ (options_cli.format ?? false)
|
|
|
39
57
|
let glob = /** @type {string} */ (options_cli.glob ?? '.')
|
|
40
58
|
const verbose = /** @type {boolean} */ (options_cli.verbose ?? false)
|
|
41
59
|
const pre = /** @type {string} */ (options_cli.prefix ?? 'none')
|
|
42
|
-
const tools = /** @type {typeof TOOLS_ALL} */ (
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
const tools = /** @type {typeof TOOLS_ALL} */ (
|
|
61
|
+
String(options_cli.tools ?? TOOLS_DEFAULT.join(',')).split(',')
|
|
62
|
+
)
|
|
63
|
+
const diffOnly = /** @type {boolean} */ (options_cli['diff-only'] ?? false)
|
|
64
|
+
const baseBranch = /** @type {string} */ (options_cli['base-branch'] ?? 'main')
|
|
45
65
|
|
|
46
66
|
const log = new Log('kitql-lint')
|
|
47
67
|
// const spinner = new Spinner({ symbolFormatter: (msg) => bgBlueBright(` kitql-lint `) + ' ' + msg })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitql/eslint-config",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "opinionated linting and formatting for projects",
|
|
6
6
|
"repository": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"format"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"eslint": "10.
|
|
38
|
-
"oxlint": "1.
|
|
39
|
-
"oxlint-tsgolint": "0.
|
|
40
|
-
"prettier": "^3.
|
|
37
|
+
"eslint": "10.4.0",
|
|
38
|
+
"oxlint": "1.66.0",
|
|
39
|
+
"oxlint-tsgolint": "0.23.0",
|
|
40
|
+
"prettier": "^3.8.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"eslint": {
|
|
@@ -54,25 +54,24 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@e18e/eslint-plugin": "^0.
|
|
57
|
+
"@e18e/eslint-plugin": "^0.5.0",
|
|
58
58
|
"@eslint/compat": "2.1.0",
|
|
59
59
|
"@eslint/js": "10.0.1",
|
|
60
60
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
61
61
|
"@types/eslint": "9.6.1",
|
|
62
62
|
"@typescript-eslint/parser": "8.59.3",
|
|
63
|
-
"commander": "14.0.0",
|
|
64
63
|
"eslint-config-prettier": "10.1.5",
|
|
65
|
-
"eslint-plugin-oxlint": "1.
|
|
64
|
+
"eslint-plugin-oxlint": "1.66.0",
|
|
66
65
|
"eslint-plugin-pnpm": "1.6.0",
|
|
67
66
|
"eslint-plugin-svelte": "3.17.1",
|
|
68
67
|
"globals": "17.6.0",
|
|
69
68
|
"jsonc-eslint-parser": "3.1.0",
|
|
70
69
|
"prettier-plugin-sh": "^0.18.0",
|
|
71
|
-
"prettier-plugin-svelte": "^
|
|
72
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
70
|
+
"prettier-plugin-svelte": "^4.0.0",
|
|
71
|
+
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
73
72
|
"typescript-eslint": "8.59.3",
|
|
74
73
|
"yaml-eslint-parser": "2.0.0",
|
|
75
|
-
"@kitql/helpers": "0.8.
|
|
74
|
+
"@kitql/helpers": "0.8.15"
|
|
76
75
|
},
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|