Skip to content

Commit

Permalink
feat: more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed May 6, 2024
1 parent 335954c commit c07191c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-format": "0.1.1",
"eslint-plugin-functional": "7.0.0-alpha.3",
"eslint-plugin-functional": "7.0.0-alpha.5",
"eslint-plugin-import-x": "0.5.0",
"eslint-plugin-jsdoc": "48.2.3",
"eslint-plugin-jsonc": "2.15.1",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import {
type FlatConfigItem,
type OptionsConfig,
type OptionsTypeScriptParserOptions,
type OptionsTypeScriptWithTypes,
type OptionsTypescript,
} from "./types";

const VuePackages = ["vue", "nuxt", "vitepress", "@slidev/cli"];
Expand Down Expand Up @@ -115,20 +117,17 @@ export function rsEslint(

const hasTypeScript = Boolean(typeScriptOptions);

const typeScriptSubOptions = resolveSubOptions(options, "typescript");
const { filesTypeAware, tsconfig, parserOptions, ...typeScriptSubOptions } =
resolveSubOptions(options, "typescript") as OptionsTypescript &
OptionsTypeScriptWithTypes &
OptionsTypeScriptParserOptions;

const typescriptConfigOptions: Required<OptionsTypeScriptParserOptions> = {
filesTypeAware:
"filesTypeAware" in typeScriptSubOptions
? typeScriptSubOptions.filesTypeAware
: defaultFilesTypesAware,
...typeScriptSubOptions,
filesTypeAware: filesTypeAware ?? defaultFilesTypesAware,
parserOptions: {
project:
"tsconfig" in typeScriptSubOptions
? typeScriptSubOptions.tsconfig
: null,
...("parserOptions" in typeScriptSubOptions
? typeScriptSubOptions.parserOptions
: {}),
project: tsconfig ?? null,
...parserOptions,
},
};

Expand Down

0 comments on commit c07191c

Please sign in to comment.