@nx/eslint 23.3.0-beta.1 → 23.3.0-beta.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.
@@ -102,10 +102,15 @@ exports.createNodes = [
102
102
  const lintableFilesPerProjectRoot = await collectLintableFilesByProjectRoot(projectRoots, options, context);
103
103
  const tsconfigChainsByProjectRoot = collectTsconfigChainsByProjectRoot(projectRoots, context.workspaceRoot);
104
104
  const lockFilePattern = (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
105
+ const configDirectories = eslintConfigFiles.map((config) => (0, posix_1.normalize)((0, posix_1.dirname)(config)));
105
106
  const hashes = await (0, internal_1.calculateHashesForCreateNodes)(projectRoots, options, context, projectRoots.map((root) => {
106
- const parentConfigs = eslintConfigFiles.filter((eslintConfig) => isSubDir(root, (0, posix_1.dirname)(eslintConfig)));
107
+ const normalizedRoot = (0, posix_1.normalize)(root);
108
+ const prefix = normalizedRoot.endsWith(posix_1.sep)
109
+ ? normalizedRoot
110
+ : normalizedRoot + posix_1.sep;
111
+ const descendantConfigs = eslintConfigFiles.filter((_, index) => root === '.' || configDirectories[index].startsWith(prefix));
107
112
  return [
108
- ...parentConfigs,
113
+ ...descendantConfigs,
109
114
  (0, posix_1.join)(root, '.eslintignore'),
110
115
  lockFilePattern,
111
116
  ...(tsconfigChainsByProjectRoot.get(root) ?? []),
@@ -333,19 +338,3 @@ function normalizeOptions(options) {
333
338
  }
334
339
  return normalizedOptions;
335
340
  }
336
- /**
337
- * Determines if `child` is a subdirectory of `parent`. This is a simplified
338
- * version that takes into account that paths are always relative to the
339
- * workspace root.
340
- */
341
- function isSubDir(parent, child) {
342
- if (parent === '.') {
343
- return true;
344
- }
345
- parent = (0, posix_1.normalize)(parent);
346
- child = (0, posix_1.normalize)(child);
347
- if (!parent.endsWith(posix_1.sep)) {
348
- parent += posix_1.sep;
349
- }
350
- return child.startsWith(parent);
351
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "23.3.0-beta.1",
3
+ "version": "23.3.0-beta.3",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -73,17 +73,17 @@
73
73
  "peerDependencies": {
74
74
  "@zkochan/js-yaml": "0.0.7",
75
75
  "eslint": "^9.0.0 || ^10.0.0",
76
- "@nx/jest": "23.3.0-beta.1"
76
+ "@nx/jest": "23.3.0-beta.3"
77
77
  },
78
78
  "dependencies": {
79
79
  "semver": "^7.6.3",
80
80
  "tslib": "^2.3.0",
81
81
  "typescript": "~6.0.3",
82
- "@nx/devkit": "23.3.0-beta.1",
83
- "@nx/js": "23.3.0-beta.1"
82
+ "@nx/js": "23.3.0-beta.3",
83
+ "@nx/devkit": "23.3.0-beta.3"
84
84
  },
85
85
  "devDependencies": {
86
- "nx": "23.3.0-beta.1"
86
+ "nx": "23.3.0-beta.3"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@nx/jest": {