@travetto/eslint 4.0.0-rc.0 → 4.0.0-rc.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/README.md +5 -5
- package/package.json +8 -8
- package/support/cli.lint.ts +6 -4
package/README.md
CHANGED
|
@@ -83,9 +83,9 @@ import { Program, BaseExpression, Expression } from 'estree';
|
|
|
83
83
|
import type { TrvEslintPlugin } from '@travetto/eslint';
|
|
84
84
|
|
|
85
85
|
const groupTypeMap = {
|
|
86
|
-
node: ['node', 'travetto', '
|
|
87
|
-
travetto: ['travetto', '
|
|
88
|
-
|
|
86
|
+
node: ['node', 'travetto', 'workspace'],
|
|
87
|
+
travetto: ['travetto', 'workspace'],
|
|
88
|
+
workspace: ['workspace'],
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
interface TSAsExpression extends BaseExpression {
|
|
@@ -143,9 +143,9 @@ export const ImportOrder: TrvEslintPlugin = {
|
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
const lineType: typeof groupType = /^@travetto/.test(from) ? 'travetto' : /^[^.]/.test(from) ? 'node' : '
|
|
146
|
+
const lineType: typeof groupType = /^@travetto/.test(from) ? 'travetto' : /^[^.]/.test(from) ? 'node' : 'workspace';
|
|
147
147
|
|
|
148
|
-
if (/module\/[^/]+\/doc\//.test(context.getFilename()) && lineType === '
|
|
148
|
+
if (/module\/[^/]+\/doc\//.test(context.getFilename()) && lineType === 'workspace' && from.startsWith('..')) {
|
|
149
149
|
context.report({ message: 'Doc does not support parent imports', node });
|
|
150
150
|
}
|
|
151
151
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/eslint",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.2",
|
|
4
4
|
"description": "ES Linting Rules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"directory": "module/eslint"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@eslint/js": "^8.
|
|
28
|
-
"@travetto/manifest": "^4.0.0-rc.
|
|
29
|
-
"@types/eslint": "^8.
|
|
27
|
+
"@eslint/js": "^8.56.0",
|
|
28
|
+
"@travetto/manifest": "^4.0.0-rc.2",
|
|
29
|
+
"@types/eslint": "^8.56.2",
|
|
30
30
|
"@types/eslint__js": "^8.42.3",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
32
|
-
"@typescript-eslint/parser": "^6.
|
|
33
|
-
"eslint": "^8.
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
32
|
+
"@typescript-eslint/parser": "^6.20.0",
|
|
33
|
+
"eslint": "^8.56.0",
|
|
34
34
|
"eslint-plugin-unused-imports": "^3.0.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@travetto/cli": "^4.0.0-rc.
|
|
37
|
+
"@travetto/cli": "^4.0.0-rc.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
package/support/cli.lint.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
|
|
1
3
|
import { RuntimeContext } from '@travetto/manifest';
|
|
2
4
|
import { Env, ExecUtil } from '@travetto/base';
|
|
3
5
|
import { CliCommandShape, CliCommand, CliModuleUtil, CliScmUtil } from '@travetto/cli';
|
|
@@ -28,19 +30,19 @@ export class LintCommand implements CliCommandShape {
|
|
|
28
30
|
.filter(x => !x.endsWith('package.json') && !x.endsWith('package-lock.json'));
|
|
29
31
|
} else {
|
|
30
32
|
const mods = await CliModuleUtil.findModules(this.changed ? 'changed' : 'all');
|
|
31
|
-
files = mods.filter(x => x.
|
|
33
|
+
files = mods.filter(x => x.workspace).map(x => x.sourcePath);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
|
|
35
|
-
const res = await ExecUtil.spawn('npx', [
|
|
37
|
+
const res = await ExecUtil.getResult(spawn('npx', [
|
|
36
38
|
'eslint',
|
|
37
39
|
...(this.format ? ['--format', this.format] : []),
|
|
38
40
|
...files
|
|
39
41
|
], {
|
|
40
42
|
cwd: RuntimeContext.workspace.path,
|
|
41
43
|
stdio: 'inherit',
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
+
shell: false
|
|
45
|
+
}), { catch: true });
|
|
44
46
|
|
|
45
47
|
process.exitCode = res.code;
|
|
46
48
|
}
|