@nx/eslint 20.0.5 → 20.0.7

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "20.0.5",
3
+ "version": "20.0.7",
4
4
  "private": false,
5
5
  "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
6
6
  "repository": {
@@ -35,8 +35,8 @@
35
35
  "eslint": "^8.0.0 || ^9.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "20.0.5",
39
- "@nx/js": "20.0.5",
38
+ "@nx/devkit": "20.0.7",
39
+ "@nx/js": "20.0.7",
40
40
  "semver": "^7.5.3",
41
41
  "tslib": "^2.3.0",
42
42
  "typescript": "~5.4.2"
@@ -24,13 +24,15 @@ async function run(task, context) {
24
24
  hashes.push(res.details.nodes[d]);
25
25
  }
26
26
  }
27
- return {
27
+ const hashResult = {
28
28
  value: (0, devkit_1.hashArray)([command, selfSource, ...hashes, tags]),
29
29
  details: {
30
30
  command,
31
31
  nodes: { [task.target.project]: selfSource, tags, ...nodes },
32
32
  },
33
33
  };
34
+ hashResult['name'] = 'eslint-hasher';
35
+ return hashResult;
34
36
  }
35
37
  function allDeps(taskId, taskGraph, projectGraph) {
36
38
  if (!taskGraph.tasks) {
@@ -184,7 +184,8 @@ function createEsLintConfiguration(tree, options, projectConfig, setParserOption
184
184
  });
185
185
  const nodeList = (0, ast_utils_1.createNodeList)(importMap, nodes);
186
186
  const content = (0, ast_utils_1.stringifyNodeList)(nodeList);
187
- tree.write((0, path_1.join)(projectConfig.root, 'eslint.config.js'), content);
187
+ const ext = extendedRootConfig?.endsWith('.cjs') ? '.cjs' : '.js';
188
+ tree.write((0, path_1.join)(projectConfig.root, `eslint.config${ext}`), content);
188
189
  }
189
190
  else {
190
191
  (0, devkit_1.writeJson)(tree, (0, path_1.join)(projectConfig.root, `.eslintrc.json`), {
@@ -40,7 +40,9 @@ function isEslintConfigSupported(tree, projectRoot = '') {
40
40
  if (!eslintFile) {
41
41
  return false;
42
42
  }
43
- return eslintFile.endsWith('.json') || eslintFile.endsWith('.config.js');
43
+ return (eslintFile.endsWith('.json') ||
44
+ eslintFile.endsWith('.config.js') ||
45
+ eslintFile.endsWith('.config.cjs'));
44
46
  }
45
47
  function updateRelativePathsInConfig(tree, sourcePath, destinationPath) {
46
48
  if (sourcePath === destinationPath ||