@nx/eslint 17.3.0-canary.20231228-f1849a7 → 17.3.0-canary.20231229-51c039b

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/generators.json CHANGED
@@ -2,6 +2,12 @@
2
2
  "name": "nx/eslint",
3
3
  "version": "0.1",
4
4
  "generators": {
5
+ "init": {
6
+ "factory": "./src/generators/init/init#lintInitGenerator",
7
+ "schema": "./src/generators/init/schema.json",
8
+ "description": "Set up the ESLint plugin.",
9
+ "hidden": true
10
+ },
5
11
  "workspace-rules-project": {
6
12
  "factory": "./src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator",
7
13
  "schema": "./src/generators/workspace-rules-project/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "17.3.0-canary.20231228-f1849a7",
3
+ "version": "17.3.0-canary.20231229-51c039b",
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": {
@@ -34,11 +34,11 @@
34
34
  "js-yaml": "4.1.0"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "17.3.0-canary.20231228-f1849a7",
38
- "@nx/js": "17.3.0-canary.20231228-f1849a7",
37
+ "@nx/devkit": "17.3.0-canary.20231229-51c039b",
38
+ "@nx/js": "17.3.0-canary.20231229-51c039b",
39
39
  "tslib": "^2.3.0",
40
40
  "typescript": "~5.2.2",
41
- "@nx/linter": "17.3.0-canary.20231228-f1849a7"
41
+ "@nx/linter": "17.3.0-canary.20231229-51c039b"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "eslint": {
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NxESLintInit",
5
+ "title": "Initialize ESLint Plugin",
6
+ "description": "Set up the ESLint plugin.",
7
+ "type": "object",
8
+ "properties": {},
9
+ "required": []
10
+ }
@@ -139,6 +139,13 @@ function updateOverrideInLintConfig(tree, root, lookup, update) {
139
139
  }
140
140
  else {
141
141
  const fileName = (0, devkit_1.joinPathFragments)(root, '.eslintrc.json');
142
+ if (!tree.exists(fileName)) {
143
+ return;
144
+ }
145
+ const existingJson = (0, devkit_1.readJson)(tree, fileName);
146
+ if (!existingJson.overrides || !existingJson.overrides.some(lookup)) {
147
+ return;
148
+ }
142
149
  (0, devkit_1.updateJson)(tree, fileName, (json) => {
143
150
  const index = json.overrides.findIndex(lookup);
144
151
  if (index !== -1) {