@shined/doctor 0.1.2 → 0.2.0-canary.10
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/es/cli.mjs +13 -0
- package/package.json +3 -3
package/es/cli.mjs
CHANGED
|
@@ -19,5 +19,18 @@ cli.command('', 'check project health').option('-v, --verbose', 'Verbose output'
|
|
|
19
19
|
const end = performance.now();
|
|
20
20
|
console.log(`Time taken: ${end - start} milliseconds`);
|
|
21
21
|
});
|
|
22
|
+
cli.command('fix', 'fix lint').option('-v, --verbose', 'Verbose output').option('--cwd <path>', 'Current working directory').action(async (options)=>{
|
|
23
|
+
const start = performance.now();
|
|
24
|
+
const cwd = options.cwd || process.cwd();
|
|
25
|
+
const standards = await JsSpecifications.create(cwd);
|
|
26
|
+
const res = await standards.fixLint();
|
|
27
|
+
const errorCount = res.reduce((count, msg)=>count + msg.diagnostics.filter((d)=>"Error" === d.severity).length, 0);
|
|
28
|
+
if (errorCount > 0) {
|
|
29
|
+
console.log(`Found ${errorCount} errors`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const end = performance.now();
|
|
33
|
+
console.log(`Time taken: ${end - start} milliseconds`);
|
|
34
|
+
});
|
|
22
35
|
cli.help();
|
|
23
36
|
cli.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shined/doctor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-canary.10",
|
|
4
4
|
"main": "es/index.mjs",
|
|
5
5
|
"types": "es/index.d.mts",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public",
|
|
14
|
-
"tag": "
|
|
14
|
+
"tag": "canary"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"bin",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"cac": "^6.7.14",
|
|
23
|
-
"@shined/doctor-binding": "0.
|
|
23
|
+
"@shined/doctor-binding": "0.2.0-canary.10"
|
|
24
24
|
},
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/sheinsight/doctor-engine/issues"
|