@plumeria/eslint-plugin 2.0.3 → 2.1.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/README.md +30 -0
- package/bin/plumerialint.js +29 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -40,3 +40,33 @@ Automatically sorts CSS properties in the recommended order for consistency and
|
|
|
40
40
|
### validate-values
|
|
41
41
|
|
|
42
42
|
Validates CSS property values for correctness. Only standard CSS properties are checked; properties with string literal keys (e.g., computed or dynamic property names) are not validated.
|
|
43
|
+
|
|
44
|
+
## CLI (plumerialint)
|
|
45
|
+
|
|
46
|
+
This package also provides a small CLI, `plumerialint`, as a convenient way
|
|
47
|
+
to run only Plumeria’s ESLint rules.
|
|
48
|
+
|
|
49
|
+
It uses the same recommended configuration internally, so no additional
|
|
50
|
+
setup is required.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
plumerialint
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
By default, it lints the following file types:
|
|
57
|
+
|
|
58
|
+
- `.ts`, `.tsx`
|
|
59
|
+
- `.js`, `.jsx`
|
|
60
|
+
|
|
61
|
+
The process exits with a non-zero status code if any errors or warnings are found,
|
|
62
|
+
making it suitable for use in CI and build pipelines.
|
|
63
|
+
|
|
64
|
+
Example usage in `package.json`:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"scripts": {
|
|
69
|
+
"lint": "plumerialint"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { ESLint } = require('eslint');
|
|
4
|
+
const { plumeria } = require('@plumeria/eslint-plugin');
|
|
5
|
+
|
|
6
|
+
async function run() {
|
|
7
|
+
const eslint = new ESLint({
|
|
8
|
+
cwd: process.cwd(),
|
|
9
|
+
overrideConfig: [plumeria.flatConfigs.recommended],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const results = await eslint.lintFiles('**/*.{ts,tsx,js,jsx}');
|
|
13
|
+
|
|
14
|
+
const hasProblem = results.some(
|
|
15
|
+
(r) => r.errorCount > 0 || r.warningCount > 0,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const formatter = await eslint.loadFormatter('stylish');
|
|
19
|
+
process.stdout.write(formatter.format(results));
|
|
20
|
+
|
|
21
|
+
if (hasProblem) {
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
run().catch((err) => {
|
|
27
|
+
console.error(err);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/eslint-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Plumeria ESLint plugin",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist/"
|
|
22
22
|
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"plumerialint": "bin/plumerialint.js"
|
|
25
|
+
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@types/eslint": "^9.6.1",
|
|
25
28
|
"eslint": "^9.39.0",
|