@plumeria/eslint-plugin 19.10.4 → 19.11.0
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/README.md +8 -8
- package/bin/oxlint.js +3 -3
- package/bin/plumerialint.js +6 -0
- package/dist/guard.js +7 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -234,9 +234,9 @@ The bundler plugins turn the matching rule on in the build lint as well:
|
|
|
234
234
|
`withoutPhysicalProperties` runs `no-physical-properties`, and
|
|
235
235
|
`withoutLogicalProperties` runs `no-logical-properties`, `{ sizes }` included.
|
|
236
236
|
|
|
237
|
-
## CLI (
|
|
237
|
+
## CLI (plumeria-lint)
|
|
238
238
|
|
|
239
|
-
This package provides a CLI command, `
|
|
239
|
+
This package provides a CLI command, `plumeria-lint`, as a convenient way
|
|
240
240
|
to run Plumeria's custom ESLint rules.
|
|
241
241
|
|
|
242
242
|
It runs `oxlint`, which this package depends on, for fast linting with code
|
|
@@ -253,7 +253,7 @@ pnpm add -D @plumeria/eslint-plugin
|
|
|
253
253
|
### Usage
|
|
254
254
|
|
|
255
255
|
```bash
|
|
256
|
-
|
|
256
|
+
plumeria-lint
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
The process exits with a non-zero status code if any errors or warnings are found,
|
|
@@ -262,25 +262,25 @@ making it suitable for use in CI and build pipelines.
|
|
|
262
262
|
### Styling prop
|
|
263
263
|
|
|
264
264
|
If the styling prop is renamed, pass the name with `--style-prop`. Without the
|
|
265
|
-
flag, `
|
|
265
|
+
flag, `plumeria-lint` asks ESLint for `settings.plumeria.styleProp` when ESLint
|
|
266
266
|
and a flat config are installed, and uses `classStyle` otherwise:
|
|
267
267
|
|
|
268
268
|
```bash
|
|
269
|
-
|
|
269
|
+
plumeria-lint --style-prop sx
|
|
270
270
|
```
|
|
271
271
|
|
|
272
272
|
### Aborting Builds on Lint Errors (Parallel Pipeline)
|
|
273
273
|
|
|
274
|
-
You can run `
|
|
274
|
+
You can run `plumeria-lint` in parallel with your build command (e.g. `next build` or `vite build`) using the `--` separator:
|
|
275
275
|
|
|
276
276
|
```json
|
|
277
277
|
{
|
|
278
278
|
"scripts": {
|
|
279
|
-
"build": "
|
|
279
|
+
"build": "plumeria-lint -- next build"
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
-
If `
|
|
284
|
+
If `plumeria-lint` detects any styling errors or warnings, it will print the diagnostics, kill the build process immediately, and exit with a non-zero code. This avoids compiling when styling validation fails.
|
|
285
285
|
|
|
286
286
|
With `@plumeria/next-plugin` and `@plumeria/unplugin` (except on esbuild and Bun), this lint is integrated into the build by default, so it needs no setup. Pass `lint: false` to the plugin to build without it.
|
package/bin/oxlint.js
CHANGED
|
@@ -60,7 +60,7 @@ function handleOxlintError(err) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function fail(err) {
|
|
63
|
-
console.error(`✖ [
|
|
63
|
+
console.error(`✖ [plumeria-lint] ${err.message}`);
|
|
64
64
|
process.exit(1);
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -95,13 +95,13 @@ if (!buildCommand) {
|
|
|
95
95
|
aborted = true;
|
|
96
96
|
|
|
97
97
|
if (failedSource === 'lint') {
|
|
98
|
-
console.error(`\n✖ [
|
|
98
|
+
console.error(`\n✖ [plumeria-lint] Linting failed. Aborting build...`);
|
|
99
99
|
try {
|
|
100
100
|
buildChild.kill();
|
|
101
101
|
} catch (e) {}
|
|
102
102
|
process.exit(exitCode || 1);
|
|
103
103
|
} else if (failedSource === 'build') {
|
|
104
|
-
console.error(`\n✖ [
|
|
104
|
+
console.error(`\n✖ [plumeria-lint] Build failed. Aborting lint...`);
|
|
105
105
|
try {
|
|
106
106
|
if (oxlintChild) oxlintChild.kill();
|
|
107
107
|
} catch (e) {}
|
package/dist/guard.js
CHANGED
|
@@ -96,7 +96,13 @@ function startLintGuard(overrides = {}) {
|
|
|
96
96
|
'--deny-warnings',
|
|
97
97
|
'--no-error-on-unmatched-pattern',
|
|
98
98
|
'--threads=2',
|
|
99
|
-
], {
|
|
99
|
+
], {
|
|
100
|
+
stdio: 'inherit',
|
|
101
|
+
env: {
|
|
102
|
+
NODE_COMPILE_CACHE: path.join(process.cwd(), 'node_modules', '.cache', 'plumeria-lint'),
|
|
103
|
+
...process.env,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
100
106
|
lowerPriority(child.pid);
|
|
101
107
|
const exit = process.exit.bind(process);
|
|
102
108
|
let lintCode = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/eslint-plugin",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.11.0",
|
|
4
4
|
"description": "Plumeria ESLint plugin",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"oxlint.json"
|
|
42
42
|
],
|
|
43
43
|
"bin": {
|
|
44
|
-
"
|
|
44
|
+
"plumeria-lint": "bin/oxlint.js",
|
|
45
|
+
"plumerialint": "bin/plumerialint.js"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/eslint": "^9.6.1",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"known-css-properties": "^0.37.0",
|
|
60
61
|
"oxlint": "1.87.0",
|
|
61
62
|
"zss-engine": "2.9.1",
|
|
62
|
-
"@plumeria/compiler": "19.
|
|
63
|
+
"@plumeria/compiler": "19.11.0"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
65
66
|
"build": "rimraf dist && pnpm cjs",
|