@travetto/eslint 5.0.0-rc.1 → 5.0.0-rc.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/README.md +1 -1
- package/package.json +9 -9
- package/resources/eslint-config-file.cjs +1 -1
- package/resources/eslint-config-file.mjs +1 -1
- package/support/bin/eslint-common.ts +100 -102
- package/support/bin/eslint-config-file.ts +2 -3
- package/support/bin/eslint-config.ts +25 -20
- package/support/bin/eslint-std-rules.ts +5 -6
- package/support/cli.lint.ts +16 -9
- package/support/cli.lint_register.ts +3 -3
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ This is the file the linter will use, and any other tooling (e.g. IDEs).
|
|
|
34
34
|
process.env.TRV_MANIFEST = './.trv/output/node_modules/@travetto/eslint';
|
|
35
35
|
|
|
36
36
|
const { buildConfig } = require('./.trv/output/node_modules/@travetto/eslint/support/bin/eslint-config.js');
|
|
37
|
-
const { RuntimeIndex } = require('./.trv/output/node_modules/@travetto/
|
|
37
|
+
const { RuntimeIndex } = require('./.trv/output/node_modules/@travetto/runtime/__index__.js');
|
|
38
38
|
|
|
39
39
|
const pluginFiles = RuntimeIndex.find({ folder: f => f === 'support', file: f => /support\/eslint[.]/.test(f) });
|
|
40
40
|
const plugins = pluginFiles.map(x => require(x.outputFile));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/eslint",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.10",
|
|
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": "^
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
27
|
+
"@eslint/js": "^9.9.0",
|
|
28
|
+
"@stylistic/eslint-plugin": "^2.6.2",
|
|
29
|
+
"@travetto/runtime": "^5.0.0-rc.10",
|
|
30
|
+
"@types/eslint": "^9.6.0",
|
|
30
31
|
"@types/eslint__js": "^8.42.3",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
32
|
-
"@typescript-eslint/parser": "^
|
|
33
|
-
"eslint": "^
|
|
34
|
-
"eslint-plugin-unused-imports": "^3.2.0"
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.1.0",
|
|
34
|
+
"eslint": "^9.9.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
37
|
+
"@travetto/cli": "^5.0.0-rc.11"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
process.env.TRV_MANIFEST = '%MANIFEST_FILE%';
|
|
2
2
|
|
|
3
3
|
const { buildConfig } = require('@travetto/eslint/support/bin/eslint-config');
|
|
4
|
-
const { RuntimeIndex } = require('@travetto/
|
|
4
|
+
const { RuntimeIndex } = require('@travetto/runtime/__index__');
|
|
5
5
|
|
|
6
6
|
const pluginFiles = RuntimeIndex.find({ folder: f => f === 'support', file: f => /support\/eslint[.]/.test(f) });
|
|
7
7
|
const plugins = pluginFiles.map(x => require(x.outputFile));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
process.env.TRV_MANIFEST = '%MANIFEST_FILE%';
|
|
2
2
|
|
|
3
3
|
const { buildConfig } = await import('@travetto/eslint/support/bin/eslint-config');
|
|
4
|
-
const { RuntimeIndex } = await import('@travetto/
|
|
4
|
+
const { RuntimeIndex } = await import('@travetto/runtime/__index__');
|
|
5
5
|
|
|
6
6
|
const pluginFiles = RuntimeIndex.find({ folder: f => f === 'support', file: f => /support\/eslint[.]/.test(f) });
|
|
7
7
|
const plugins = await Promise.all(pluginFiles.map(x => import(x.outputFile)))
|
|
@@ -1,106 +1,94 @@
|
|
|
1
1
|
import * as parser from '@typescript-eslint/parser';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
undefined: false,
|
|
93
|
-
unescape: false,
|
|
94
|
-
URIError: false,
|
|
95
|
-
WeakMap: false,
|
|
96
|
-
WeakRef: false,
|
|
97
|
-
WeakSet: false,
|
|
98
|
-
},
|
|
99
|
-
parser,
|
|
100
|
-
parserOptions: {
|
|
101
|
-
project: 'tsconfig.json'
|
|
102
|
-
},
|
|
103
|
-
},
|
|
3
|
+
export const GLOBALS = {
|
|
4
|
+
AbortController: false,
|
|
5
|
+
AbortSignal: false,
|
|
6
|
+
AggregateError: false,
|
|
7
|
+
Array: false,
|
|
8
|
+
ArrayBuffer: false,
|
|
9
|
+
Atomics: false,
|
|
10
|
+
BigInt: false,
|
|
11
|
+
BigInt64Array: false,
|
|
12
|
+
BigUint64Array: false,
|
|
13
|
+
Boolean: false,
|
|
14
|
+
Buffer: false,
|
|
15
|
+
clearImmediate: false,
|
|
16
|
+
clearInterval: false,
|
|
17
|
+
clearTimeout: false,
|
|
18
|
+
console: false,
|
|
19
|
+
DataView: false,
|
|
20
|
+
Date: false,
|
|
21
|
+
decodeURI: false,
|
|
22
|
+
decodeURIComponent: false,
|
|
23
|
+
DOMException: false,
|
|
24
|
+
encodeURI: false,
|
|
25
|
+
encodeURIComponent: false,
|
|
26
|
+
Error: false,
|
|
27
|
+
EvalError: false,
|
|
28
|
+
Event: false,
|
|
29
|
+
EventTarget: false,
|
|
30
|
+
fetch: false,
|
|
31
|
+
FinalizationRegistry: false,
|
|
32
|
+
Float32Array: false,
|
|
33
|
+
Float64Array: false,
|
|
34
|
+
FormData: false,
|
|
35
|
+
Function: false,
|
|
36
|
+
global: false,
|
|
37
|
+
globalThis: false,
|
|
38
|
+
Headers: false,
|
|
39
|
+
Infinity: false,
|
|
40
|
+
Int16Array: false,
|
|
41
|
+
Int32Array: false,
|
|
42
|
+
Int8Array: false,
|
|
43
|
+
Intl: false,
|
|
44
|
+
isFinite: false,
|
|
45
|
+
isNaN: false,
|
|
46
|
+
JSON: false,
|
|
47
|
+
Map: false,
|
|
48
|
+
Math: false,
|
|
49
|
+
MessageChannel: false,
|
|
50
|
+
MessageEvent: false,
|
|
51
|
+
MessagePort: false,
|
|
52
|
+
NaN: false,
|
|
53
|
+
Number: false,
|
|
54
|
+
Object: false,
|
|
55
|
+
parseFloat: false,
|
|
56
|
+
parseInt: false,
|
|
57
|
+
performance: false,
|
|
58
|
+
process: false,
|
|
59
|
+
Promise: false,
|
|
60
|
+
propertyIsEnumerable: false,
|
|
61
|
+
Proxy: false,
|
|
62
|
+
queueMicrotask: false,
|
|
63
|
+
RangeError: false,
|
|
64
|
+
ReferenceError: false,
|
|
65
|
+
Reflect: false,
|
|
66
|
+
RegExp: false,
|
|
67
|
+
Request: false,
|
|
68
|
+
require: false,
|
|
69
|
+
Response: false,
|
|
70
|
+
Set: false,
|
|
71
|
+
setImmediate: false,
|
|
72
|
+
setInterval: false,
|
|
73
|
+
setTimeout: false,
|
|
74
|
+
SharedArrayBuffer: false,
|
|
75
|
+
String: false,
|
|
76
|
+
structuredClone: false,
|
|
77
|
+
Symbol: false,
|
|
78
|
+
SyntaxError: false,
|
|
79
|
+
TextDecoder: false,
|
|
80
|
+
TextEncoder: false,
|
|
81
|
+
TypeError: false,
|
|
82
|
+
Uint16Array: false,
|
|
83
|
+
Uint32Array: false,
|
|
84
|
+
Uint8Array: false,
|
|
85
|
+
Uint8ClampedArray: false,
|
|
86
|
+
undefined: false,
|
|
87
|
+
unescape: false,
|
|
88
|
+
URIError: false,
|
|
89
|
+
WeakMap: false,
|
|
90
|
+
WeakRef: false,
|
|
91
|
+
WeakSet: false,
|
|
104
92
|
};
|
|
105
93
|
|
|
106
94
|
export const IGNORES = [
|
|
@@ -110,4 +98,14 @@ export const IGNORES = [
|
|
|
110
98
|
'**/*.d.ts',
|
|
111
99
|
'**/fixtures/**/*',
|
|
112
100
|
'**/resources/**/*'
|
|
113
|
-
];
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
export const TS_OPTIONS = {
|
|
104
|
+
languageOptions: {
|
|
105
|
+
globals: GLOBALS,
|
|
106
|
+
ecmaVersion: 'latest',
|
|
107
|
+
parser,
|
|
108
|
+
sourceType: 'module',
|
|
109
|
+
parserOptions: { project: 'tsconfig.json' },
|
|
110
|
+
},
|
|
111
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { RuntimeIndex } from '@travetto/manifest';
|
|
4
|
+
import { Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
6
5
|
|
|
7
6
|
export async function buildEslintConfig(): Promise<string> {
|
|
8
7
|
const root = RuntimeIndex.getModule('@travetto/eslint')!.sourcePath;
|
|
9
|
-
const ext =
|
|
8
|
+
const ext = Runtime.workspace.type === 'commonjs' ? '.cjs' : '.mjs';
|
|
10
9
|
const tpl = await fs.readFile(path.resolve(root, 'resources', `eslint-config-file${ext}`), 'utf8');
|
|
11
10
|
|
|
12
11
|
return tpl
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
|
|
3
|
-
// @ts-expect-error
|
|
4
|
-
import unused from 'eslint-plugin-unused-imports';
|
|
5
3
|
import { configs } from '@eslint/js';
|
|
6
4
|
import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
|
|
5
|
+
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { Runtime } from '@travetto/runtime';
|
|
9
8
|
|
|
10
|
-
import { IGNORES,
|
|
9
|
+
import { IGNORES, GLOBALS, TS_OPTIONS } from './eslint-common';
|
|
11
10
|
import { STD_RULES } from './eslint-std-rules';
|
|
12
11
|
import { TrvEslintPlugin } from './types';
|
|
13
12
|
|
|
@@ -20,7 +19,7 @@ export function buildConfig(pluginMaps: Record<string, TrvEslintPlugin>[]): read
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
const overrides =
|
|
22
|
+
const overrides = Runtime.workspaceRelative('eslint-overrides.json');
|
|
24
23
|
|
|
25
24
|
const extra: (typeof STD_RULES)[] = existsSync(overrides) ? JSON.parse(readFileSync(overrides, 'utf8')) : [];
|
|
26
25
|
|
|
@@ -28,15 +27,15 @@ export function buildConfig(pluginMaps: Record<string, TrvEslintPlugin>[]): read
|
|
|
28
27
|
configs.recommended,
|
|
29
28
|
{ ignores: IGNORES, },
|
|
30
29
|
{
|
|
31
|
-
...
|
|
32
|
-
files: ['**/*.ts', '**/*.tsx', '**/*.
|
|
30
|
+
...TS_OPTIONS,
|
|
31
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
|
|
33
32
|
plugins: {
|
|
33
|
+
'@stylistic': {
|
|
34
|
+
rules: stylisticPlugin.rules
|
|
35
|
+
},
|
|
34
36
|
'@typescript-eslint': {
|
|
35
37
|
rules: tsEslintPlugin.rules,
|
|
36
38
|
},
|
|
37
|
-
'unused-imports': {
|
|
38
|
-
rules: unused.rules,
|
|
39
|
-
},
|
|
40
39
|
...(Object.fromEntries(plugins.map(x => [x.name, x])))
|
|
41
40
|
},
|
|
42
41
|
rules: {
|
|
@@ -45,7 +44,21 @@ export function buildConfig(pluginMaps: Record<string, TrvEslintPlugin>[]): read
|
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
|
-
|
|
47
|
+
languageOptions: {
|
|
48
|
+
globals: GLOBALS,
|
|
49
|
+
ecmaVersion: 'latest',
|
|
50
|
+
},
|
|
51
|
+
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
|
|
52
|
+
plugins: {
|
|
53
|
+
'@stylistic': {
|
|
54
|
+
rules: stylisticPlugin.rules
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
rules: {
|
|
58
|
+
...Object.fromEntries(Object.entries(STD_RULES).filter(x => !x[0].startsWith('@typescript'))),
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
49
62
|
files: ['**/*.ts', '**/*.tsx'],
|
|
50
63
|
rules: {
|
|
51
64
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
@@ -53,19 +66,14 @@ export function buildConfig(pluginMaps: Record<string, TrvEslintPlugin>[]): read
|
|
|
53
66
|
}
|
|
54
67
|
},
|
|
55
68
|
{
|
|
56
|
-
...RULE_COMMON,
|
|
57
69
|
files: ['**/DOC.ts', '**/DOC.tsx', '**/doc/**/*.ts', '**/doc/**/*.tsx'],
|
|
58
70
|
rules: {
|
|
59
71
|
'max-len': 0,
|
|
60
72
|
'no-unused-private-class-members': 0,
|
|
61
|
-
'@typescript-eslint/quotes': 'warn',
|
|
62
|
-
'@typescript-eslint/indent': 0,
|
|
63
|
-
'@typescript-eslint/consistent-type-assertions': 0,
|
|
64
73
|
'@typescript-eslint/explicit-function-return-type': 0
|
|
65
74
|
}
|
|
66
75
|
},
|
|
67
76
|
{
|
|
68
|
-
...RULE_COMMON,
|
|
69
77
|
files: [
|
|
70
78
|
'module/compiler/**/*.ts', 'module/transformer/**/*.ts',
|
|
71
79
|
'**/support/transformer/**/*.ts', '**/support/transformer/**/*.tsx',
|
|
@@ -76,17 +84,14 @@ export function buildConfig(pluginMaps: Record<string, TrvEslintPlugin>[]): read
|
|
|
76
84
|
}
|
|
77
85
|
},
|
|
78
86
|
{
|
|
79
|
-
...RULE_COMMON,
|
|
80
87
|
files: ['**/test/**/*.ts', '**/test/**/*.tsx', '**/support/test/**/*.ts', '**/support/test/**/*.tsx'],
|
|
81
88
|
ignores: [...IGNORES, 'module/test/src/**'],
|
|
82
89
|
rules: {
|
|
83
|
-
'@typescript-eslint/consistent-type-assertions': 0,
|
|
84
|
-
'no-unused-private-class-members': 0,
|
|
85
90
|
'@typescript-eslint/explicit-function-return-type': 0
|
|
86
91
|
}
|
|
87
92
|
},
|
|
88
93
|
...extra.map(ex => ({
|
|
89
|
-
...
|
|
94
|
+
...TS_OPTIONS,
|
|
90
95
|
...ex
|
|
91
96
|
}))
|
|
92
97
|
] as const;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const STD_RULES = {
|
|
2
2
|
'no-loss-of-precision': 0,
|
|
3
|
-
'unused-imports/no-unused-imports': 'error',
|
|
4
3
|
'no-unused-vars': 0,
|
|
5
4
|
'no-dupe-class-members': 0,
|
|
6
5
|
'@typescript-eslint/array-type': 'error',
|
|
@@ -9,7 +8,7 @@ export const STD_RULES = {
|
|
|
9
8
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
10
9
|
'@typescript-eslint/explicit-member-accessibility': [0, { accessibility: 'explicit' }],
|
|
11
10
|
indent: 0,
|
|
12
|
-
'@
|
|
11
|
+
'@stylistic/indent': [
|
|
13
12
|
'error',
|
|
14
13
|
2,
|
|
15
14
|
{
|
|
@@ -24,7 +23,7 @@ export const STD_RULES = {
|
|
|
24
23
|
SwitchCase: 1
|
|
25
24
|
}
|
|
26
25
|
],
|
|
27
|
-
'@
|
|
26
|
+
'@stylistic/member-delimiter-style': [
|
|
28
27
|
'error',
|
|
29
28
|
{
|
|
30
29
|
multiline: { delimiter: 'semi', requireLast: true },
|
|
@@ -65,12 +64,12 @@ export const STD_RULES = {
|
|
|
65
64
|
'error',
|
|
66
65
|
{ varsIgnorePattern: '^(_|[A-Z])[A-Za-z0-9]*', args: 'none' }
|
|
67
66
|
],
|
|
68
|
-
'@
|
|
67
|
+
'@stylistic/quotes': [
|
|
69
68
|
'error',
|
|
70
69
|
'single',
|
|
71
70
|
{ avoidEscape: true, allowTemplateLiterals: false }
|
|
72
71
|
],
|
|
73
|
-
'@
|
|
72
|
+
'@stylistic/semi': [
|
|
74
73
|
'error',
|
|
75
74
|
'always'
|
|
76
75
|
],
|
|
@@ -83,7 +82,7 @@ export const STD_RULES = {
|
|
|
83
82
|
'no-ex-assign': 0,
|
|
84
83
|
'@typescript-eslint/ban-types': 0,
|
|
85
84
|
'@typescript-eslint/ban-ts-comment': 0,
|
|
86
|
-
'@
|
|
85
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
87
86
|
'@typescript-eslint/explicit-module-boundary-types': 0,
|
|
88
87
|
'arrow-body-style': ['error', 'as-needed'],
|
|
89
88
|
'@typescript-eslint/naming-convention': [
|
package/support/cli.lint.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
|
|
3
|
-
import { Env, ExecUtil,
|
|
3
|
+
import { Env, ExecUtil, Runtime } from '@travetto/runtime';
|
|
4
4
|
import { CliCommandShape, CliCommand, CliModuleUtil, CliScmUtil } from '@travetto/cli';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -27,23 +27,30 @@ export class LintCommand implements CliCommandShape {
|
|
|
27
27
|
|
|
28
28
|
async main(): Promise<void> {
|
|
29
29
|
let files: string[];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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' : 'all', undefined, 'HEAD');
|
|
36
|
+
files = mods.filter(x => x.workspace).map(x => x.sourcePath);
|
|
37
|
+
}
|
|
38
|
+
} catch (err) {
|
|
39
|
+
if (err instanceof Error) {
|
|
40
|
+
console.error(err.message);
|
|
41
|
+
}
|
|
42
|
+
files = [];
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
const res = await ExecUtil.getResult(spawn('npx', [
|
|
39
46
|
'eslint',
|
|
40
47
|
'--cache',
|
|
41
|
-
'--cache-location',
|
|
48
|
+
'--cache-location', Runtime.toolPath('.eslintcache'),
|
|
42
49
|
...(this.format ? ['--format', this.format] : []),
|
|
43
50
|
...(this.fix ? ['--fix'] : []),
|
|
44
51
|
...files
|
|
45
52
|
], {
|
|
46
|
-
cwd:
|
|
53
|
+
cwd: Runtime.workspace.path,
|
|
47
54
|
stdio: 'inherit',
|
|
48
55
|
shell: false
|
|
49
56
|
}), { catch: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
|
|
3
3
|
import { CliCommandShape, CliCommand } from '@travetto/cli';
|
|
4
|
-
import {
|
|
4
|
+
import { Runtime } from '@travetto/runtime';
|
|
5
5
|
|
|
6
6
|
import { buildEslintConfig } from './bin/eslint-config-file';
|
|
7
7
|
|
|
@@ -13,8 +13,8 @@ export class LintConfigureCommand implements CliCommandShape {
|
|
|
13
13
|
|
|
14
14
|
async main(): Promise<void> {
|
|
15
15
|
const content = await buildEslintConfig();
|
|
16
|
-
const output =
|
|
17
|
-
await fs.writeFile(output, content.replaceAll(
|
|
16
|
+
const output = Runtime.workspaceRelative('eslint.config.js');
|
|
17
|
+
await fs.writeFile(output, content.replaceAll(Runtime.workspace.path, '.').trim());
|
|
18
18
|
|
|
19
19
|
console.log(`Wrote eslint config to ${output}`);
|
|
20
20
|
}
|