@travetto/eslint 6.0.1 → 7.0.0-rc.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
CHANGED
|
@@ -22,7 +22,7 @@ In a new project, the first thing that will need to be done, post installation,
|
|
|
22
22
|
|
|
23
23
|
**Terminal: Registering the Configuration**
|
|
24
24
|
```bash
|
|
25
|
-
$ trv
|
|
25
|
+
$ trv eslint:register
|
|
26
26
|
|
|
27
27
|
Wrote eslint config to <workspace-root>/eslint.config.cjs
|
|
28
28
|
```
|
|
@@ -50,7 +50,7 @@ Once installed, using the linter is as simple as invoking it via the cli:
|
|
|
50
50
|
|
|
51
51
|
**Terminal: Running the Linter**
|
|
52
52
|
```bash
|
|
53
|
-
npx trv
|
|
53
|
+
npx trv eslint
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Or pointing your IDE to reference the registered configuration file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/eslint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-rc.0",
|
|
4
4
|
"description": "ES Linting Rules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@eslint/js": "^9.35.0",
|
|
28
|
-
"@stylistic/eslint-plugin": "^5.
|
|
29
|
-
"@travetto/runtime": "^
|
|
28
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
29
|
+
"@travetto/runtime": "^7.0.0-rc.0",
|
|
30
30
|
"@types/eslint": "^9.6.1",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
33
|
-
"eslint": "^9.
|
|
34
|
-
"eslint-plugin-unused-imports": "^4.
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
32
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
33
|
+
"eslint": "^9.39.1",
|
|
34
|
+
"eslint-plugin-unused-imports": "^4.3.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@travetto/cli": "^
|
|
37
|
+
"@travetto/cli": "^7.0.0-rc.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
|
|
3
3
|
import { Env, ExecUtil, Runtime } from '@travetto/runtime';
|
|
4
|
-
import { CliCommandShape, CliCommand, CliModuleUtil
|
|
4
|
+
import { CliCommandShape, CliCommand, CliModuleUtil } from '@travetto/cli';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Command line support for
|
|
7
|
+
* Command line support for eslint
|
|
8
8
|
*/
|
|
9
9
|
@CliCommand()
|
|
10
|
-
export class
|
|
10
|
+
export class ESLintCommand implements CliCommandShape {
|
|
11
11
|
|
|
12
12
|
/** Only check changed modules */
|
|
13
13
|
changed = false;
|
|
@@ -26,21 +26,7 @@ export class LintCommand implements CliCommandShape {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async main(): Promise<void> {
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
if (this.since) {
|
|
32
|
-
files = (await CliScmUtil.findChangedFiles(this.since, 'HEAD'))
|
|
33
|
-
.filter(x => !x.endsWith('package.json') && !x.endsWith('package-lock.json'));
|
|
34
|
-
} else {
|
|
35
|
-
const mods = await CliModuleUtil.findModules(this.changed ? 'changed' : 'workspace', undefined, 'HEAD');
|
|
36
|
-
files = mods.map(x => x.sourcePath);
|
|
37
|
-
}
|
|
38
|
-
} catch (err) {
|
|
39
|
-
if (err instanceof Error) {
|
|
40
|
-
console.error(err.message);
|
|
41
|
-
}
|
|
42
|
-
files = [];
|
|
43
|
-
}
|
|
29
|
+
const paths = await CliModuleUtil.findChangedPaths({ changed: this.changed, since: this.since, logError: true });
|
|
44
30
|
|
|
45
31
|
const result = await ExecUtil.getResult(spawn('npx', [
|
|
46
32
|
'eslint',
|
|
@@ -48,7 +34,7 @@ export class LintCommand implements CliCommandShape {
|
|
|
48
34
|
'--cache-location', Runtime.toolPath('.eslintcache'),
|
|
49
35
|
...(this.format ? ['--format', this.format] : []),
|
|
50
36
|
...(this.fix ? ['--fix'] : []),
|
|
51
|
-
...
|
|
37
|
+
...paths
|
|
52
38
|
], {
|
|
53
39
|
cwd: Runtime.workspace.path,
|
|
54
40
|
stdio: 'inherit',
|
|
@@ -6,10 +6,10 @@ import { Runtime } from '@travetto/runtime';
|
|
|
6
6
|
import { buildEslintConfig } from './bin/eslint-config-file.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Writes the
|
|
9
|
+
* Writes the eslint configuration file
|
|
10
10
|
*/
|
|
11
11
|
@CliCommand({})
|
|
12
|
-
export class
|
|
12
|
+
export class ESLintConfigureCommand implements CliCommandShape {
|
|
13
13
|
|
|
14
14
|
async main(): Promise<void> {
|
|
15
15
|
const content = await buildEslintConfig();
|