@virmator/lint 14.8.2 → 14.8.3

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.
@@ -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
- determineTsconfigPath(repoDir),
77
+ tsConfigPath,
75
78
  ],
76
79
  },
77
80
  globals: globalVars,
@@ -0,0 +1,7 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": ".."
4
+ },
5
+ "extends": "../tsconfig.json",
6
+ "include": ["../eslint.config.ts", "../src/**/*.ts"]
7
+ }
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.8.2",
3
+ "version": "14.8.3",
4
4
  "description": "Default ESLint linting plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -35,7 +35,7 @@
35
35
  "@augment-vir/assert": "^31.67.1",
36
36
  "@augment-vir/common": "^31.67.1",
37
37
  "@augment-vir/node": "^31.67.1",
38
- "@virmator/core": "^14.8.2",
38
+ "@virmator/core": "^14.8.3",
39
39
  "jiti": "^2.6.1",
40
40
  "mri": "^1.2.0"
41
41
  },
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
@@ -6,10 +6,11 @@
6
6
  "exclude": [
7
7
  "./configs",
8
8
  "./coverage",
9
- "./dist",
10
9
  "./dist-*",
10
+ "./dist",
11
11
  "./node_modules",
12
- "./test-files"
12
+ "./test-files",
13
+ "eslint.config.ts"
13
14
  ],
14
15
  "extends": "../../configs/tsconfig.base.json",
15
16
  "references": [