@nx/plugin 17.2.0-beta.6 → 17.2.0-beta.9

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/plugin",
3
- "version": "17.2.0-beta.6",
3
+ "version": "17.2.0-beta.9",
4
4
  "private": false,
5
5
  "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "@phenomnomnominal/tsquery": "~5.0.1",
32
32
  "fs-extra": "^11.1.0",
33
33
  "tslib": "^2.3.0",
34
- "@nx/devkit": "17.2.0-beta.6",
35
- "@nx/jest": "17.2.0-beta.6",
36
- "@nx/js": "17.2.0-beta.6",
37
- "@nx/eslint": "17.2.0-beta.6",
38
- "@nrwl/nx-plugin": "17.2.0-beta.6"
34
+ "@nx/devkit": "17.2.0-beta.9",
35
+ "@nx/jest": "17.2.0-beta.9",
36
+ "@nx/js": "17.2.0-beta.9",
37
+ "@nx/eslint": "17.2.0-beta.9",
38
+ "@nrwl/nx-plugin": "17.2.0-beta.9"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -102,7 +102,6 @@ async function addLintingToApplication(tree, options) {
102
102
  tsConfigPaths: [
103
103
  (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.app.json'),
104
104
  ],
105
- eslintFilePatterns: [`${options.projectRoot}/**/*.ts`],
106
105
  unitTestRunner: 'jest',
107
106
  skipFormat: true,
108
107
  setParserOptionsProject: false,
@@ -44,22 +44,25 @@ function addMigrationJsonChecks(host, options, packageJson) {
44
44
  return;
45
45
  }
46
46
  const migrationsJsonPath = (0, devkit_1.joinPathFragments)(projectConfiguration.root, relativeMigrationsJsonPath);
47
- if (eslintTarget &&
48
- !eslintTargetConfiguration.options?.lintFilePatterns?.includes(migrationsJsonPath)) {
49
- // Add to lintFilePatterns
47
+ if (!eslintTarget) {
48
+ return;
49
+ }
50
+ // Add path to lintFilePatterns if different than default "{projectRoot}"
51
+ if (eslintTargetConfiguration.options?.lintFilePatterns &&
52
+ !eslintTargetConfiguration.options.lintFilePatterns.includes(migrationsJsonPath)) {
50
53
  eslintTargetConfiguration.options.lintFilePatterns.push(migrationsJsonPath);
51
54
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfiguration);
52
- // Update project level eslintrc
53
- (0, eslint_file_1.updateOverrideInLintConfig)(host, projectConfiguration.root, (o) => Object.keys(o.rules ?? {})?.includes('@nx/nx-plugin-checks') ||
54
- Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks'), (o) => {
55
- const fileSet = new Set(Array.isArray(o.files) ? o.files : [o.files]);
56
- fileSet.add(relativeMigrationsJsonPath);
57
- return {
58
- ...o,
59
- files: Array.from(fileSet),
60
- };
61
- });
62
55
  }
56
+ // Update project level eslintrc
57
+ (0, eslint_file_1.updateOverrideInLintConfig)(host, projectConfiguration.root, (o) => Object.keys(o.rules ?? {})?.includes('@nx/nx-plugin-checks') ||
58
+ Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks'), (o) => {
59
+ const fileSet = new Set(Array.isArray(o.files) ? o.files : [o.files]);
60
+ fileSet.add(relativeMigrationsJsonPath);
61
+ return {
62
+ ...o,
63
+ files: Array.from(fileSet),
64
+ };
65
+ });
63
66
  }
64
67
  exports.addMigrationJsonChecks = addMigrationJsonChecks;
65
68
  function updateProjectTarget(host, options, packageJson) {
@@ -68,9 +71,9 @@ function updateProjectTarget(host, options, packageJson) {
68
71
  return;
69
72
  }
70
73
  for (const [target, configuration] of Object.entries(project.targets)) {
71
- if (configuration.executor === '@nx/eslint:lint' ||
72
- configuration.executor === '@nx/linter:eslint' ||
73
- configuration.executor === '@nrwl/linter:eslint') {
74
+ if (configuration.executor === '@nx/eslint:lint' &&
75
+ // only add patterns if there are already hardcoded ones
76
+ configuration.options?.lintFilePatterns) {
74
77
  const opts = configuration.options ?? {};
75
78
  opts.lintFilePatterns ??= [];
76
79
  if (packageJson.generators) {