Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import schema from './options.json' with { type: 'json' };

/** @typedef {import("eslint").ESLint.Options} ESLintOptions */
/** @typedef {import('eslint').ESLint.LintResult} LintResult */
/** @typedef {import('eslint').ESLint.LintResultData} LintResultData */
Expand Down Expand Up @@ -55,6 +53,20 @@ const removedOptionMessages = {
quiet: "Use `severity.warning: 'off'` to hide ESLint warnings.",
};

const pluginOnlyOptionKeys = [
'configType',
'context',
'eslintPath',
'exclude',
'resourceQueryExclude',
'files',
'formatter',
'lintDirtyModulesOnly',
'lintAllFiles',
'severity',
'outputReport',
];

/**
* @param {Options} pluginOptions
* @returns {PluginOptions}
Expand Down Expand Up @@ -95,11 +107,7 @@ function getESLintOptions(loaderOptions) {

const eslintOptions = { ...loaderOptions };

// Keep the fix option because it is common to both the loader and ESLint.
const { fix, extensions, ...eslintOnlyOptions } = schema.properties;

// No need to guard the for-in because schema.properties has hardcoded keys.
for (const option in eslintOnlyOptions) {
for (const option of pluginOnlyOptionKeys) {
// @ts-ignore
delete eslintOptions[option];
}
Expand Down
87 changes: 0 additions & 87 deletions src/options.json

This file was deleted.

Loading