@coko/lint 3.0.0-alpha.29 → 3.0.0-alpha.30
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/cli.mjs +20 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [3.0.0-alpha.30](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.29...v3.0.0-alpha.30) (2026-05-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* allow passing path to the lint commands ([dd7a355](https://gitlab.coko.foundation/cokoapps/lint/commit/dd7a35561e0757f03d11d192f60b43834a63ce56))
|
|
11
|
+
|
|
5
12
|
## [3.0.0-alpha.29](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.28...v3.0.0-alpha.29) (2026-04-29)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -55,18 +55,23 @@ const runSubprocess = (fn, name, skip) => {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const runESLint = isSubprocess => {
|
|
59
|
-
const
|
|
58
|
+
const runESLint = (isSubprocess, targetPath) => {
|
|
59
|
+
const target = targetPath ?? process.cwd()
|
|
60
|
+
const command = `npx eslint ${target}`
|
|
60
61
|
runCommand(ESLINT, command, isSubprocess)
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
const runStylelint = isSubprocess => {
|
|
64
|
-
const
|
|
64
|
+
const runStylelint = (isSubprocess, targetPath) => {
|
|
65
|
+
const target = targetPath
|
|
66
|
+
? `"${targetPath}/**/*.{js,jsx,ts,tsx,css}"`
|
|
67
|
+
: `"${process.cwd()}/**/*.{js,jsx,ts,tsx,css}"`
|
|
68
|
+
const command = `npx stylelint ${target}`
|
|
65
69
|
runCommand(STYLELINT, command, isSubprocess)
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
const runPrettier = isSubprocess => {
|
|
69
|
-
const
|
|
72
|
+
const runPrettier = (isSubprocess, targetPath) => {
|
|
73
|
+
const target = targetPath ?? process.cwd()
|
|
74
|
+
const command = `npx prettier --check ${target}`
|
|
70
75
|
runCommand(PRETTIER, command, isSubprocess)
|
|
71
76
|
}
|
|
72
77
|
|
|
@@ -137,27 +142,27 @@ program
|
|
|
137
142
|
.description("Coko's cli tool for running linters")
|
|
138
143
|
|
|
139
144
|
program
|
|
140
|
-
.command('eslint')
|
|
145
|
+
.command('eslint [path]')
|
|
141
146
|
.description('Run eslint command')
|
|
142
|
-
.action(
|
|
147
|
+
.action(targetPath => {
|
|
143
148
|
printVersion()
|
|
144
|
-
runESLint()
|
|
149
|
+
runESLint(false, targetPath)
|
|
145
150
|
})
|
|
146
151
|
|
|
147
152
|
program
|
|
148
|
-
.command('stylelint')
|
|
153
|
+
.command('stylelint [path]')
|
|
149
154
|
.description('Run stylelint command')
|
|
150
|
-
.action(
|
|
155
|
+
.action(targetPath => {
|
|
151
156
|
printVersion()
|
|
152
|
-
runStylelint()
|
|
157
|
+
runStylelint(false, targetPath)
|
|
153
158
|
})
|
|
154
159
|
|
|
155
160
|
program
|
|
156
|
-
.command('prettier')
|
|
161
|
+
.command('prettier [path]')
|
|
157
162
|
.description('Run prettier command')
|
|
158
|
-
.action(
|
|
163
|
+
.action(targetPath => {
|
|
159
164
|
printVersion()
|
|
160
|
-
runPrettier()
|
|
165
|
+
runPrettier(false, targetPath)
|
|
161
166
|
})
|
|
162
167
|
|
|
163
168
|
program
|