@virmator/lint 14.8.2 → 14.9.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/configs/eslint.config.base.ts +4 -1
- package/configs/tsconfig.eslint.top-package.json +7 -0
- package/dist/lint.d.ts +24 -0
- package/dist/lint.js +17 -1
- package/package.json +11 -11
- package/src/lint.ts +18 -0
- package/tsconfig.json +3 -2
|
@@ -32,6 +32,8 @@ export function defineEslintConfig(repoDir: string) {
|
|
|
32
32
|
baseDirectory: repoDir,
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
const tsConfigPath = determineTsconfigPath(repoDir);
|
|
36
|
+
|
|
35
37
|
return [
|
|
36
38
|
...compat.plugins('require-extensions'),
|
|
37
39
|
...compat.extends('plugin:require-extensions/recommended'),
|
|
@@ -61,6 +63,7 @@ export function defineEslintConfig(repoDir: string) {
|
|
|
61
63
|
'**/test-files/',
|
|
62
64
|
'cspell.config.cjs',
|
|
63
65
|
'package-lock.json',
|
|
66
|
+
'eslint.config.ts',
|
|
64
67
|
],
|
|
65
68
|
},
|
|
66
69
|
jsEslint.configs.recommended,
|
|
@@ -71,7 +74,7 @@ export function defineEslintConfig(repoDir: string) {
|
|
|
71
74
|
languageOptions: {
|
|
72
75
|
parserOptions: {
|
|
73
76
|
project: [
|
|
74
|
-
|
|
77
|
+
tsConfigPath,
|
|
75
78
|
],
|
|
76
79
|
},
|
|
77
80
|
globals: globalVars,
|
package/dist/lint.d.ts
CHANGED
|
@@ -33,6 +33,18 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
33
33
|
};
|
|
34
34
|
readonly required: true;
|
|
35
35
|
};
|
|
36
|
+
readonly eslintTsconfigTopPackage: {
|
|
37
|
+
readonly copyFromPath: string;
|
|
38
|
+
readonly copyToPath: string;
|
|
39
|
+
readonly env: {
|
|
40
|
+
readonly node: true;
|
|
41
|
+
readonly web: true;
|
|
42
|
+
};
|
|
43
|
+
readonly packageType: {
|
|
44
|
+
readonly package: true;
|
|
45
|
+
};
|
|
46
|
+
readonly required: true;
|
|
47
|
+
};
|
|
36
48
|
readonly eslint: {
|
|
37
49
|
readonly copyFromPath: string;
|
|
38
50
|
readonly copyToPath: string;
|
|
@@ -250,6 +262,18 @@ export declare const virmatorLintPlugin: Readonly<Readonly<{
|
|
|
250
262
|
};
|
|
251
263
|
readonly required: true;
|
|
252
264
|
};
|
|
265
|
+
readonly eslintTsconfigTopPackage: {
|
|
266
|
+
readonly copyFromPath: string;
|
|
267
|
+
readonly copyToPath: string;
|
|
268
|
+
readonly env: {
|
|
269
|
+
readonly node: true;
|
|
270
|
+
readonly web: true;
|
|
271
|
+
};
|
|
272
|
+
readonly packageType: {
|
|
273
|
+
readonly package: true;
|
|
274
|
+
};
|
|
275
|
+
readonly required: true;
|
|
276
|
+
};
|
|
253
277
|
readonly eslint: {
|
|
254
278
|
readonly copyFromPath: string;
|
|
255
279
|
readonly copyToPath: string;
|
package/dist/lint.js
CHANGED
|
@@ -50,6 +50,18 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
50
50
|
},
|
|
51
51
|
required: true,
|
|
52
52
|
},
|
|
53
|
+
eslintTsconfigTopPackage: {
|
|
54
|
+
copyFromPath: join('configs', 'tsconfig.eslint.top-package.json'),
|
|
55
|
+
copyToPath: join('configs', 'tsconfig.eslint.json'),
|
|
56
|
+
env: {
|
|
57
|
+
[RuntimeEnv.Node]: true,
|
|
58
|
+
[RuntimeEnv.Web]: true,
|
|
59
|
+
},
|
|
60
|
+
packageType: {
|
|
61
|
+
[PackageType.TopPackage]: true,
|
|
62
|
+
},
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
53
65
|
eslint: {
|
|
54
66
|
copyFromPath: join('configs', 'eslint.config.share.ts'),
|
|
55
67
|
copyToPath: join('eslint.config.ts'),
|
|
@@ -237,15 +249,19 @@ export const virmatorLintPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
237
249
|
},
|
|
238
250
|
},
|
|
239
251
|
},
|
|
240
|
-
}, async ({ package: { monoRepoRootPath }, runShellCommand, cliInputs: { usedCommands, filteredArgs }, }) => {
|
|
252
|
+
}, async ({ package: { monoRepoRootPath }, runShellCommand, cliInputs: { usedCommands, filteredArgs }, configs, }) => {
|
|
241
253
|
const args = mri(filteredArgs);
|
|
242
254
|
const dirPath = args._.length ? '' : '.';
|
|
243
255
|
const cacheLocation = join(monoRepoRootPath, 'node_modules', '.cache', '.eslintcache');
|
|
256
|
+
const userSpecifiedConfig = filteredArgs.some((arg) => arg === '-c' || arg === '--config');
|
|
244
257
|
const eslintCommand = [
|
|
245
258
|
'npx',
|
|
246
259
|
'eslint',
|
|
247
260
|
'--cache',
|
|
248
261
|
`--cache-location='${interpolationSafeWindowsPath(cacheLocation)}'`,
|
|
262
|
+
userSpecifiedConfig
|
|
263
|
+
? ''
|
|
264
|
+
: `--config '${interpolationSafeWindowsPath(configs.lint.configs.eslint.fullCopyToPath)}'`,
|
|
249
265
|
usedCommands.lint?.subCommands.fix && !args.fix ? '--fix' : '',
|
|
250
266
|
dirPath,
|
|
251
267
|
...filteredArgs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/lint",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.9.0",
|
|
4
4
|
"description": "Default ESLint linting plugin for virmator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -32,22 +32,22 @@
|
|
|
32
32
|
"test:update": "npm test update"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@augment-vir/assert": "^31.
|
|
36
|
-
"@augment-vir/common": "^31.
|
|
37
|
-
"@augment-vir/node": "^31.
|
|
38
|
-
"@virmator/core": "^14.
|
|
35
|
+
"@augment-vir/assert": "^31.68.1",
|
|
36
|
+
"@augment-vir/common": "^31.68.1",
|
|
37
|
+
"@augment-vir/node": "^31.68.1",
|
|
38
|
+
"@virmator/core": "^14.9.0",
|
|
39
39
|
"jiti": "^2.6.1",
|
|
40
40
|
"mri": "^1.2.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@augment-vir/test": "^31.
|
|
44
|
-
"@eslint/eslintrc": "^3.3.
|
|
43
|
+
"@augment-vir/test": "^31.68.1",
|
|
44
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
45
45
|
"@eslint/js": "9.39.2",
|
|
46
|
-
"@stylistic/eslint-plugin": "^5.
|
|
46
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
47
47
|
"@stylistic/eslint-plugin-ts": "^4.4.1",
|
|
48
48
|
"@types/estree": "^1.0.8",
|
|
49
49
|
"@types/node": "^25.3.0",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
51
51
|
"c8": "^11.0.0",
|
|
52
52
|
"eslint": "^9.39.2",
|
|
53
53
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"eslint-plugin-playwright": "^2.9.0",
|
|
57
57
|
"eslint-plugin-prettier": "^5.5.5",
|
|
58
58
|
"eslint-plugin-require-extensions": "^0.1.3",
|
|
59
|
-
"eslint-plugin-sonarjs": "^4.0.
|
|
59
|
+
"eslint-plugin-sonarjs": "^4.0.2",
|
|
60
60
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
61
61
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
62
|
-
"typescript-eslint": "^8.
|
|
62
|
+
"typescript-eslint": "^8.57.0"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=22"
|
package/src/lint.ts
CHANGED
|
@@ -53,6 +53,18 @@ export const virmatorLintPlugin = defineVirmatorPlugin(
|
|
|
53
53
|
},
|
|
54
54
|
required: true,
|
|
55
55
|
},
|
|
56
|
+
eslintTsconfigTopPackage: {
|
|
57
|
+
copyFromPath: join('configs', 'tsconfig.eslint.top-package.json'),
|
|
58
|
+
copyToPath: join('configs', 'tsconfig.eslint.json'),
|
|
59
|
+
env: {
|
|
60
|
+
[RuntimeEnv.Node]: true,
|
|
61
|
+
[RuntimeEnv.Web]: true,
|
|
62
|
+
},
|
|
63
|
+
packageType: {
|
|
64
|
+
[PackageType.TopPackage]: true,
|
|
65
|
+
},
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
56
68
|
eslint: {
|
|
57
69
|
copyFromPath: join('configs', 'eslint.config.share.ts'),
|
|
58
70
|
copyToPath: join('eslint.config.ts'),
|
|
@@ -245,6 +257,7 @@ export const virmatorLintPlugin = defineVirmatorPlugin(
|
|
|
245
257
|
package: {monoRepoRootPath},
|
|
246
258
|
runShellCommand,
|
|
247
259
|
cliInputs: {usedCommands, filteredArgs},
|
|
260
|
+
configs,
|
|
248
261
|
}) => {
|
|
249
262
|
const args = mri(filteredArgs);
|
|
250
263
|
|
|
@@ -252,11 +265,16 @@ export const virmatorLintPlugin = defineVirmatorPlugin(
|
|
|
252
265
|
|
|
253
266
|
const cacheLocation = join(monoRepoRootPath, 'node_modules', '.cache', '.eslintcache');
|
|
254
267
|
|
|
268
|
+
const userSpecifiedConfig = filteredArgs.some((arg) => arg === '-c' || arg === '--config');
|
|
269
|
+
|
|
255
270
|
const eslintCommand = [
|
|
256
271
|
'npx',
|
|
257
272
|
'eslint',
|
|
258
273
|
'--cache',
|
|
259
274
|
`--cache-location='${interpolationSafeWindowsPath(cacheLocation)}'`,
|
|
275
|
+
userSpecifiedConfig
|
|
276
|
+
? ''
|
|
277
|
+
: `--config '${interpolationSafeWindowsPath(configs.lint.configs.eslint.fullCopyToPath)}'`,
|
|
260
278
|
usedCommands.lint?.subCommands.fix && !args.fix ? '--fix' : '',
|
|
261
279
|
dirPath,
|
|
262
280
|
...filteredArgs,
|
package/tsconfig.json
CHANGED