Skip to content

Commit

Permalink
fix(linter): remove reportUnusedDisableDirectives for flat config (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Feb 2, 2024
1 parent 3505fc6 commit 35b5ca7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/eslint/src/executors/lint/utility/eslint-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export async function resolveAndInstantiateESLint(
* not be any html files in the project, so keeping it true would break linting every time
*/
errorOnUnmatchedPattern: false,
reportUnusedDisableDirectives:
options.reportUnusedDisableDirectives || undefined,
};

if (useFlatConfig) {
Expand All @@ -69,6 +67,11 @@ export async function resolveAndInstantiateESLint(
'For Flat Config, ESLint removed `ignorePath` and so it is not supported as an option. See https://eslint.org/docs/latest/use/configure/configuration-files-new'
);
}
if (options.reportUnusedDisableDirectives) {
throw new Error(
'For Flat Config, ESLint removed `reportedUnusedDisableDirectives` and so it is not supported as an option. See https://eslint.org/docs/latest/use/configure/configuration-files-new'
);
}
} else {
eslintOptions.rulePaths = options.rulesdir || [];
eslintOptions.resolvePluginsRelativeTo =
Expand All @@ -79,6 +82,8 @@ export async function resolveAndInstantiateESLint(
* merge the provided config with others it finds automatically.
*/
eslintOptions.useEslintrc = !options.noEslintrc;
eslintOptions.reportUnusedDisableDirectives =
options.reportUnusedDisableDirectives || undefined;
}

const eslint = new ESLint(eslintOptions);
Expand Down

0 comments on commit 35b5ca7

Please sign in to comment.