fix(linter): remove reportUnusedDisableDirectives for flat config (#21405)
This commit is contained in:
parent
3505fc628e
commit
35b5ca756e
@ -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
|
* not be any html files in the project, so keeping it true would break linting every time
|
||||||
*/
|
*/
|
||||||
errorOnUnmatchedPattern: false,
|
errorOnUnmatchedPattern: false,
|
||||||
reportUnusedDisableDirectives:
|
|
||||||
options.reportUnusedDisableDirectives || undefined,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (useFlatConfig) {
|
if (useFlatConfig) {
|
||||||
@ -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'
|
'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 {
|
} else {
|
||||||
eslintOptions.rulePaths = options.rulesdir || [];
|
eslintOptions.rulePaths = options.rulesdir || [];
|
||||||
eslintOptions.resolvePluginsRelativeTo =
|
eslintOptions.resolvePluginsRelativeTo =
|
||||||
@ -79,6 +82,8 @@ export async function resolveAndInstantiateESLint(
|
|||||||
* merge the provided config with others it finds automatically.
|
* merge the provided config with others it finds automatically.
|
||||||
*/
|
*/
|
||||||
eslintOptions.useEslintrc = !options.noEslintrc;
|
eslintOptions.useEslintrc = !options.noEslintrc;
|
||||||
|
eslintOptions.reportUnusedDisableDirectives =
|
||||||
|
options.reportUnusedDisableDirectives || undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const eslint = new ESLint(eslintOptions);
|
const eslint = new ESLint(eslintOptions);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user