diff --git a/packages/eslint/src/plugins/plugin.spec.ts b/packages/eslint/src/plugins/plugin.spec.ts index 63e2ac0062e57..db7a928423dfb 100644 --- a/packages/eslint/src/plugins/plugin.spec.ts +++ b/packages/eslint/src/plugins/plugin.spec.ts @@ -109,6 +109,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": ".", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -178,6 +181,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/my-app", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -216,6 +222,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/my-app", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -326,6 +335,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/my-app", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -348,6 +360,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "libs/my-lib", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -430,6 +445,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/my-app", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -453,6 +471,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "libs/my-lib", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -493,6 +514,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/myapp", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, @@ -538,6 +562,9 @@ describe('@nx/eslint/plugin', () => { "options": { "cwd": "apps/myapp/nested/mylib", }, + "outputs": [ + "{options.outputFile}", + ], }, }, }, diff --git a/packages/eslint/src/plugins/plugin.ts b/packages/eslint/src/plugins/plugin.ts index 8abf61c51c952..aa37e9520132b 100644 --- a/packages/eslint/src/plugins/plugin.ts +++ b/packages/eslint/src/plugins/plugin.ts @@ -187,6 +187,7 @@ function buildEslintTargets( '{workspaceRoot}/tools/eslint-rules/**/*', { externalDependencies: ['eslint'] }, ], + outputs: ['{options.outputFile}'], }; if (eslintConfigs.some((config) => isFlatConfig(config))) { targetConfig.options.env = {