@nx/eslint 19.2.0-canary.20240604-0594deb → 19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "19.2.0-canary.20240604-0594deb",
3
+ "version": "19.2.0-rc.0",
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,12 +35,12 @@
35
35
  "eslint": "^8.0.0 || ^9.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "19.2.0-canary.20240604-0594deb",
39
- "@nx/js": "19.2.0-canary.20240604-0594deb",
38
+ "@nx/devkit": "19.2.0-rc.0",
39
+ "@nx/js": "19.2.0-rc.0",
40
40
  "semver": "^7.5.3",
41
41
  "tslib": "^2.3.0",
42
42
  "typescript": "~5.4.2",
43
- "@nx/linter": "19.2.0-canary.20240604-0594deb"
43
+ "@nx/linter": "19.2.0-rc.0"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@zkochan/js-yaml": {
package/plugin.d.ts CHANGED
@@ -1 +1 @@
1
- export { createNodes, EslintPluginOptions } from './src/plugins/plugin';
1
+ export { createNodes, createNodesV2, EslintPluginOptions, } from './src/plugins/plugin';
package/plugin.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNodes = void 0;
3
+ exports.createNodesV2 = exports.createNodes = void 0;
4
4
  var plugin_1 = require("./src/plugins/plugin");
5
5
  Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return plugin_1.createNodes; } });
6
+ Object.defineProperty(exports, "createNodesV2", { enumerable: true, get: function () { return plugin_1.createNodesV2; } });
@@ -189,7 +189,7 @@ function replaceOverridesInLintConfig(tree, root, overrides) {
189
189
  content = (0, ast_utils_1.removeOverridesFromLintConfig)(content);
190
190
  overrides.forEach((override) => {
191
191
  const flatOverride = (0, ast_utils_1.generateFlatOverride)(override);
192
- (0, ast_utils_1.addBlockToFlatConfigExport)(content, flatOverride);
192
+ content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, flatOverride);
193
193
  });
194
194
  tree.write(fileName, content);
195
195
  }
@@ -209,7 +209,9 @@ function addExtendsToLintConfig(tree, root, plugin) {
209
209
  const pluginExtends = (0, ast_utils_1.generatePluginExtendsElement)(plugins);
210
210
  let content = tree.read(fileName, 'utf8');
211
211
  content = (0, ast_utils_1.addCompatToFlatConfig)(content);
212
- tree.write(fileName, (0, ast_utils_1.addBlockToFlatConfigExport)(content, pluginExtends));
212
+ tree.write(fileName, (0, ast_utils_1.addBlockToFlatConfigExport)(content, pluginExtends, {
213
+ insertAtTheEnd: false,
214
+ }));
213
215
  }
214
216
  else {
215
217
  const fileName = (0, devkit_1.joinPathFragments)(root, '.eslintrc.json');
@@ -425,7 +425,7 @@ function addCompatToFlatConfig(content) {
425
425
  if (result.includes('const compat = new FlatCompat')) {
426
426
  return result;
427
427
  }
428
- result = addImportToFlatConfig(result, 'FlatCompat', '@eslint/eslintrc');
428
+ result = addImportToFlatConfig(result, ['FlatCompat'], '@eslint/eslintrc');
429
429
  const index = result.indexOf('module.exports');
430
430
  return (0, devkit_1.applyChangesToString)(result, [
431
431
  {
@@ -88,7 +88,7 @@ exports.createNodesV2 = [
88
88
  ESLINT_CONFIG_GLOB,
89
89
  async (configFiles, options, context) => {
90
90
  const optionsHash = (0, file_hasher_1.hashObject)(options);
91
- const cachePath = (0, node_path_1.join)(cache_directory_1.projectGraphCacheDirectory, `eslint-${optionsHash}.hash`);
91
+ const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `eslint-${optionsHash}.hash`);
92
92
  const targetsCache = readTargetsCache(cachePath);
93
93
  try {
94
94
  return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => internalCreateNodes(configFile, options, context, targetsCache), configFiles, options, context);