diff --git a/packages/eslint/src/executors/lint/lint.impl.ts b/packages/eslint/src/executors/lint/lint.impl.ts index 3ac8c5fd785af..6276f1eb9684a 100644 --- a/packages/eslint/src/executors/lint/lint.impl.ts +++ b/packages/eslint/src/executors/lint/lint.impl.ts @@ -2,7 +2,7 @@ import { joinPathFragments, type ExecutorContext } from '@nx/devkit'; import type { ESLint } from 'eslint'; import { mkdirSync, writeFileSync } from 'fs'; import { interpolate } from 'nx/src/tasks-runner/utils'; -import { dirname, posix, resolve } from 'path'; +import { dirname, posix, relative, resolve } from 'path'; import { findFlatConfigFile, findOldConfigFile } from '../../utils/config-file'; import type { Schema } from './schema'; import { resolveAndInstantiateESLint } from './utility/eslint-utils'; @@ -45,10 +45,7 @@ export default async function run( // the flat config would be resolved starting from the cwd, which we changed to the workspace root // so we explicitly set the config path to the flat config file path we previously found if (hasFlatConfig && !normalizedOptions.eslintConfig) { - normalizedOptions.eslintConfig = posix.relative( - systemRoot, - flatConfigFilePath - ); + normalizedOptions.eslintConfig = relative(systemRoot, flatConfigFilePath); } /**