From 6e166587b79ab0df5f8227d58fd9b052cfee14dd Mon Sep 17 00:00:00 2001 From: Vojtech Masek Date: Thu, 5 Sep 2024 16:13:55 +0200 Subject: [PATCH] test(plugin-eslint): fix nx project graph for mocked monorepo Signed-off-by: Vojtech Masek --- .../plugin-eslint/mocks/fixtures/nx-monorepo/.gitignore | 2 +- .../mocks/fixtures/nx-monorepo/packages/cli/project.json | 6 ++---- .../mocks/fixtures/nx-monorepo/packages/core/project.json | 6 ++---- .../fixtures/nx-monorepo/packages/nx-plugin/project.json | 7 ++----- .../mocks/fixtures/nx-monorepo/packages/utils/project.json | 5 +---- .../mocks/fixtures/nx-monorepo/tsconfig.base.json | 4 ++-- packages/plugin-eslint/src/lib/nx.integration.test.ts | 5 ----- 7 files changed, 10 insertions(+), 25 deletions(-) diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/.gitignore b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/.gitignore index 0cba03f65..f21d80021 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/.gitignore +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/.gitignore @@ -1 +1 @@ -.nx/cache \ No newline at end of file +.nx diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json index eaa517967..5c0452837 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/cli/project.json @@ -2,15 +2,13 @@ "name": "cli", "sourceRoot": "packages/cli/src", "projectType": "application", + "implicitDependencies": ["core"], "targets": { "lint": { "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": [ - "packages/cli/**/*.ts", - "packages/cli/package.json" - ] + "lintFilePatterns": ["packages/cli/**/*.ts"] } } } diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json index 238ad8866..cb8107127 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/core/project.json @@ -2,15 +2,13 @@ "name": "core", "sourceRoot": "packages/core/src", "projectType": "library", + "implicitDependencies": ["utils"], "targets": { "lint": { "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": [ - "packages/core/**/*.ts", - "packages/core/package.json" - ] + "lintFilePatterns": ["packages/core/**/*.ts"] } } } diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/nx-plugin/project.json b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/nx-plugin/project.json index faa609fb0..45c7f7f1d 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/nx-plugin/project.json +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/nx-plugin/project.json @@ -2,16 +2,13 @@ "name": "nx-plugin", "sourceRoot": "packages/nx-plugin/src", "projectType": "library", + "implicitDependencies": ["utils"], "targets": { "lint": { "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": [ - "packages/nx-plugin/**/*.ts", - "packages/nx-plugin/package.json", - "packages/nx-plugin/generators.json" - ] + "lintFilePatterns": ["packages/nx-plugin/**/*.ts"] } } } diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/utils/project.json b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/utils/project.json index 77632393b..0daa43e40 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/utils/project.json +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/packages/utils/project.json @@ -7,10 +7,7 @@ "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": [ - "packages/utils/**/*.ts", - "packages/utils/package.json" - ] + "lintFilePatterns": ["packages/utils/**/*.ts"] } } } diff --git a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/tsconfig.base.json b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/tsconfig.base.json index 05d05e672..6fc9deaa6 100644 --- a/packages/plugin-eslint/mocks/fixtures/nx-monorepo/tsconfig.base.json +++ b/packages/plugin-eslint/mocks/fixtures/nx-monorepo/tsconfig.base.json @@ -8,9 +8,9 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, - "target": "es2015", + "target": "ES2022", "module": "esnext", - "lib": ["es2020", "dom"], + "lib": ["ES2022", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", diff --git a/packages/plugin-eslint/src/lib/nx.integration.test.ts b/packages/plugin-eslint/src/lib/nx.integration.test.ts index 0d13fafab..d743194ea 100644 --- a/packages/plugin-eslint/src/lib/nx.integration.test.ts +++ b/packages/plugin-eslint/src/lib/nx.integration.test.ts @@ -45,7 +45,6 @@ describe('Nx helpers', () => { eslintrc: './packages/cli/.eslintrc.json', patterns: [ 'packages/cli/**/*.ts', - 'packages/cli/package.json', 'packages/cli/src/*.spec.ts', 'packages/cli/src/*.cy.ts', 'packages/cli/src/*.stories.ts', @@ -56,7 +55,6 @@ describe('Nx helpers', () => { eslintrc: './packages/core/.eslintrc.json', patterns: [ 'packages/core/**/*.ts', - 'packages/core/package.json', 'packages/core/src/*.spec.ts', 'packages/core/src/*.cy.ts', 'packages/core/src/*.stories.ts', @@ -67,8 +65,6 @@ describe('Nx helpers', () => { eslintrc: './packages/nx-plugin/.eslintrc.json', patterns: [ 'packages/nx-plugin/**/*.ts', - 'packages/nx-plugin/package.json', - 'packages/nx-plugin/generators.json', 'packages/nx-plugin/src/*.spec.ts', 'packages/nx-plugin/src/*.cy.ts', 'packages/nx-plugin/src/*.stories.ts', @@ -79,7 +75,6 @@ describe('Nx helpers', () => { eslintrc: './packages/utils/.eslintrc.json', patterns: [ 'packages/utils/**/*.ts', - 'packages/utils/package.json', 'packages/utils/src/*.spec.ts', 'packages/utils/src/*.cy.ts', 'packages/utils/src/*.stories.ts',