Skip to content

Commit ccc7e5c

Browse files
remove the function to check parser object
1 parent 958f597 commit ccc7e5c

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/playground/components/Configuration.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,6 @@ const defaultOption = {
108108

109109
const isEmpty = obj => Object.keys(obj).length === 0;
110110

111-
const parserValue = parser => {
112-
if (
113-
(typeof parser === "object" &&
114-
parser.meta.name === "typescript-eslint/parser") ||
115-
parser === "@typescript-eslint/parser"
116-
) {
117-
return "@typescript-eslint/parser";
118-
}
119-
120-
return null;
121-
};
122-
123111
export default function Configuration({
124112
initialOptions,
125113
rulesMeta,
@@ -260,11 +248,7 @@ export default function Configuration({
260248
if (config.languageOptions && config.languageOptions.parser) {
261249
const parser = config.languageOptions.parser;
262250

263-
if (
264-
parser === "@typescript-eslint/parser" ||
265-
(typeof parser === "object" &&
266-
parser?.meta?.name === "typescript-eslint/parser")
267-
) {
251+
if (parser === "@typescript-eslint/parser") {
268252
config.languageOptions.parser = "___TS_PARSER_PLACEHOLDER___";
269253
}
270254
}
@@ -493,9 +477,8 @@ export default function Configuration({
493477
value={ESLintParserOptions.filter(
494478
eslintParser =>
495479
eslintParser.value ===
496-
(parserValue(
497-
options.languageOptions?.parser,
498-
) || "default"),
480+
(options.languageOptions?.parser ||
481+
"default"),
499482
)}
500483
options={ESLintParserOptions}
501484
onChange={selected => {

0 commit comments

Comments
 (0)