@nx/oxlint 23.2.0-pr.36838.ef8e258 → 23.2.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/dist/src/plugins/plugin.js +22 -4
- package/package.json +5 -5
|
@@ -27,6 +27,8 @@ const LINTABLE_EXTENSIONS = [
|
|
|
27
27
|
'astro',
|
|
28
28
|
];
|
|
29
29
|
const LINTABLE_FILES_GLOB = `**/*.{${LINTABLE_EXTENSIONS.join(',')}}`;
|
|
30
|
+
// The one rule that looks across projects; every other rule sees one file.
|
|
31
|
+
const BOUNDARIES_PLUGIN_SPECIFIER = '@nx/oxlint/boundaries-plugin';
|
|
30
32
|
const PROJECT_CONFIG_FILENAMES = ['project.json', 'package.json'];
|
|
31
33
|
const OXLINT_CONFIG_GLOB = combineGlobPatterns([
|
|
32
34
|
...OXLINT_CONFIG_FILENAMES.map((f) => `**/${f}`),
|
|
@@ -572,18 +574,34 @@ function getProjectUsingOxlintConfig(configFilePath, projectRoot, options, conte
|
|
|
572
574
|
const isRootProject = projectRoot === '.';
|
|
573
575
|
const lintPath = isRootProject && standaloneSrcPath ? `./${standaloneSrcPath}` : '.';
|
|
574
576
|
const jsPluginFiles = new Set(configInputs.flatMap((config) => localJsPluginFiles(config, jsPluginSpecifiersByConfig.get(config) ?? [])));
|
|
577
|
+
const lintableFiles = `{projectRoot}/${LINTABLE_FILES_GLOB}`;
|
|
578
|
+
const usesBoundariesBridge = configInputs.some((config) => (jsPluginSpecifiersByConfig.get(config) ?? []).includes(BOUNDARIES_PLUGIN_SPECIFIER));
|
|
575
579
|
const targetConfig = {
|
|
576
580
|
command: `oxlint ${lintPath}`,
|
|
577
581
|
options: { cwd: projectRoot },
|
|
578
582
|
cache: true,
|
|
579
583
|
inputs: [
|
|
580
|
-
|
|
581
|
-
|
|
584
|
+
// Only what Oxlint can lint, so a README or JSON edit is not a re-lint.
|
|
585
|
+
{ fileset: lintableFiles },
|
|
586
|
+
// The bridge checks the project graph, which a dependency's imports and
|
|
587
|
+
// package.json shape.
|
|
588
|
+
...(usesBoundariesBridge
|
|
589
|
+
? [
|
|
590
|
+
{ fileset: lintableFiles, dependencies: true },
|
|
591
|
+
{
|
|
592
|
+
fileset: '{projectRoot}/package.json',
|
|
593
|
+
dependencies: true,
|
|
594
|
+
},
|
|
595
|
+
]
|
|
596
|
+
: []),
|
|
597
|
+
// Configs, ignore files and tsconfigs inside the project.
|
|
598
|
+
{
|
|
599
|
+
fileset: `{projectRoot}/**/{${[...OXLINT_CONFIG_FILENAMES, '.eslintignore', 'tsconfig*.json'].join(',')}}`,
|
|
600
|
+
},
|
|
582
601
|
...configInputs.map((config) => `{workspaceRoot}/${config}`),
|
|
583
602
|
...[...jsPluginFiles].map((file) => `{workspaceRoot}/${file}`),
|
|
584
603
|
// Oxlint layers .eslintignore files from every ancestor of a linted
|
|
585
|
-
// file
|
|
586
|
-
// absent, like the extends chain.
|
|
604
|
+
// file. Declared even when absent, like the extends chain.
|
|
587
605
|
...ancestorEslintignorePaths(projectRoot).map((file) => `{workspaceRoot}/${file}`),
|
|
588
606
|
...tsconfigChainOutsideProjectRoot.map((file) => `{workspaceRoot}/${file}`),
|
|
589
607
|
{ externalDependencies: ['oxlint'] },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/oxlint",
|
|
3
3
|
"description": "Experimental. The Oxlint plugin for Nx contains generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
|
4
|
-
"version": "23.2.0-
|
|
4
|
+
"version": "23.2.0-rc.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"generators": "./generators.json",
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"tslib": "^2.3.0",
|
|
72
|
-
"@nx/devkit": "23.2.0-
|
|
73
|
-
"@nx/eslint-plugin": "23.2.0-
|
|
74
|
-
"@nx/js": "23.2.0-
|
|
72
|
+
"@nx/devkit": "23.2.0-rc.0",
|
|
73
|
+
"@nx/eslint-plugin": "23.2.0-rc.0",
|
|
74
|
+
"@nx/js": "23.2.0-rc.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"oxlint": "^1.43.0"
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"node": "^20.19.0 || >=22.12.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"nx": "23.2.0-
|
|
88
|
+
"nx": "23.2.0-rc.0"
|
|
89
89
|
}
|
|
90
90
|
}
|