@travetto/eslint 3.2.0 → 3.2.2
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/package.json +3 -3
- package/support/cli.lint.ts +20 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/eslint",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "ES Linting Rules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"directory": "module/eslint"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@eslint/js": "^8.40.0",
|
|
26
27
|
"@travetto/manifest": "^3.2.0",
|
|
27
28
|
"@types/eslint": "^8.37.0",
|
|
28
29
|
"@typescript-eslint/eslint-plugin": "^5.59.6",
|
|
29
30
|
"@typescript-eslint/parser": "^5.59.6",
|
|
30
31
|
"@types/eslint__js": "^8.40.0",
|
|
31
|
-
"@eslint/js": "^8.40.0",
|
|
32
32
|
"eslint": "^8.40.0",
|
|
33
33
|
"eslint-plugin-unused-imports": "^2.0.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/cli": "^3.2.
|
|
36
|
+
"@travetto/cli": "^3.2.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/cli": {
|
package/support/cli.lint.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootIndex } from '@travetto/manifest';
|
|
2
2
|
import { ExecUtil, GlobalEnvConfig } from '@travetto/base';
|
|
3
|
-
import { CliCommandShape, CliCommand, CliModuleUtil } from '@travetto/cli';
|
|
3
|
+
import { CliCommandShape, CliCommand, CliModuleUtil, CliScmUtil } from '@travetto/cli';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Command line support for linting
|
|
@@ -11,14 +11,31 @@ export class LintCommand implements CliCommandShape {
|
|
|
11
11
|
/** Only check changed modules */
|
|
12
12
|
changed = false;
|
|
13
13
|
|
|
14
|
+
/** Output format */
|
|
15
|
+
format?: string;
|
|
16
|
+
|
|
17
|
+
/** Since a specific git commit */
|
|
18
|
+
since?: string;
|
|
19
|
+
|
|
14
20
|
envInit(): GlobalEnvConfig {
|
|
15
21
|
return { debug: false };
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
async main(): Promise<void> {
|
|
19
|
-
|
|
25
|
+
let files: string[];
|
|
26
|
+
if (this.since) {
|
|
27
|
+
files = await CliScmUtil.findChangedFilesSince(this.since);
|
|
28
|
+
} else {
|
|
29
|
+
const mods = await CliModuleUtil.findModules(this.changed ? 'changed' : 'all');
|
|
30
|
+
files = mods.filter(x => x.local).map(x => x.sourcePath);
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
|
|
21
|
-
const res = await ExecUtil.spawn('npx', [
|
|
34
|
+
const res = await ExecUtil.spawn('npx', [
|
|
35
|
+
'eslint',
|
|
36
|
+
...(this.format ? ['--format', this.format] : []),
|
|
37
|
+
...files
|
|
38
|
+
], {
|
|
22
39
|
cwd: RootIndex.manifest.workspacePath,
|
|
23
40
|
stdio: 'inherit',
|
|
24
41
|
catchAsResult: true
|