@nx/oxlint 23.2.0-rc.0 → 23.2.0-rc.1
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 +14 -10
- 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
|
+
// Oxlint honours both, so both decide which files it lints.
|
|
31
|
+
const IGNORE_FILENAMES = ['.eslintignore', '.gitignore'];
|
|
30
32
|
// The one rule that looks across projects; every other rule sees one file.
|
|
31
33
|
const BOUNDARIES_PLUGIN_SPECIFIER = '@nx/oxlint/boundaries-plugin';
|
|
32
34
|
const PROJECT_CONFIG_FILENAMES = ['project.json', 'package.json'];
|
|
@@ -118,7 +120,7 @@ export const createNodes = [
|
|
|
118
120
|
...allConfigs.flatMap((config) => localJsPluginFiles(config, jsPluginSpecifiersByConfig.get(config) ?? [])),
|
|
119
121
|
// Change which files Oxlint considers lintable, and therefore
|
|
120
122
|
// whether a target is inferred at all.
|
|
121
|
-
...
|
|
123
|
+
...ancestorIgnorePaths(root),
|
|
122
124
|
lockFilePattern,
|
|
123
125
|
...(tsconfigChainsByProjectRoot.get(root) ?? []),
|
|
124
126
|
]),
|
|
@@ -518,16 +520,18 @@ async function collectLintableFilesByProjectRoot(projectRoots, context) {
|
|
|
518
520
|
return lintableFilesPerProjectRoot;
|
|
519
521
|
}
|
|
520
522
|
/**
|
|
521
|
-
*
|
|
523
|
+
* Ignore-file candidates in every ancestor directory of the project root,
|
|
522
524
|
* workspace root included. The project's own directory is excluded — files
|
|
523
|
-
* there are covered by the
|
|
524
|
-
* which is its own ancestor and so keeps its
|
|
525
|
+
* there are covered by the in-project ignore-file input — except at the
|
|
526
|
+
* workspace root, which is its own ancestor and so keeps its ignore files.
|
|
525
527
|
*/
|
|
526
|
-
function
|
|
528
|
+
function ancestorIgnorePaths(projectRoot) {
|
|
527
529
|
const result = [];
|
|
528
530
|
let dir = projectRoot === '.' ? '.' : dirname(projectRoot);
|
|
529
531
|
while (true) {
|
|
530
|
-
|
|
532
|
+
for (const filename of IGNORE_FILENAMES) {
|
|
533
|
+
result.push(dir === '.' ? filename : `${dir}/${filename}`);
|
|
534
|
+
}
|
|
531
535
|
if (dir === '.') {
|
|
532
536
|
break;
|
|
533
537
|
}
|
|
@@ -596,13 +600,13 @@ function getProjectUsingOxlintConfig(configFilePath, projectRoot, options, conte
|
|
|
596
600
|
: []),
|
|
597
601
|
// Configs, ignore files and tsconfigs inside the project.
|
|
598
602
|
{
|
|
599
|
-
fileset: `{projectRoot}/**/{${[...OXLINT_CONFIG_FILENAMES,
|
|
603
|
+
fileset: `{projectRoot}/**/{${[...OXLINT_CONFIG_FILENAMES, ...IGNORE_FILENAMES, 'tsconfig*.json'].join(',')}}`,
|
|
600
604
|
},
|
|
601
605
|
...configInputs.map((config) => `{workspaceRoot}/${config}`),
|
|
602
606
|
...[...jsPluginFiles].map((file) => `{workspaceRoot}/${file}`),
|
|
603
|
-
// Oxlint layers
|
|
604
|
-
//
|
|
605
|
-
...
|
|
607
|
+
// Oxlint layers ignore files from every ancestor of a linted file.
|
|
608
|
+
// Declared even when absent, like the extends chain.
|
|
609
|
+
...ancestorIgnorePaths(projectRoot).map((file) => `{workspaceRoot}/${file}`),
|
|
606
610
|
...tsconfigChainOutsideProjectRoot.map((file) => `{workspaceRoot}/${file}`),
|
|
607
611
|
{ externalDependencies: ['oxlint'] },
|
|
608
612
|
],
|
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-rc.
|
|
4
|
+
"version": "23.2.0-rc.1",
|
|
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-rc.
|
|
73
|
-
"@nx/eslint-plugin": "23.2.0-rc.
|
|
74
|
-
"@nx/js": "23.2.0-rc.
|
|
72
|
+
"@nx/devkit": "23.2.0-rc.1",
|
|
73
|
+
"@nx/eslint-plugin": "23.2.0-rc.1",
|
|
74
|
+
"@nx/js": "23.2.0-rc.1"
|
|
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-rc.
|
|
88
|
+
"nx": "23.2.0-rc.1"
|
|
89
89
|
}
|
|
90
90
|
}
|