Skip to content

Commit

Permalink
Cleanup the types
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparticuz committed Dec 12, 2024
1 parent 55bae42 commit dcb7639
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/configs/import.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-expect-error There are no types
import importPlugin from "eslint-plugin-import";
import tseslint, { type ConfigWithExtends } from "typescript-eslint";

export default tseslint.config(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
importPlugin.flatConfigs.recommended as ConfigWithExtends,
{
name: "@sparticuz/eslint-config/import.ts",
Expand Down
19 changes: 14 additions & 5 deletions src/configs/jsx-a11y.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
// @ts-expect-error There are no types
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
import globals from "globals";
import tseslint, { type ConfigWithExtends } from "typescript-eslint";

export default tseslint.config(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
jsxA11yPlugin.flatConfigs.recommended as ConfigWithExtends,
);
export default tseslint.config({
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
...jsxA11yPlugin.flatConfigs.recommended,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
languageOptions: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
...jsxA11yPlugin.flatConfigs.recommended.languageOptions,
globals: {
...globals.serviceworker,
...globals.browser,
},
},
} as ConfigWithExtends);
15 changes: 10 additions & 5 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ declare module "eslint-plugin-array-func" {
declare module "@eslint-community/eslint-plugin-eslint-comments/configs" {
const recommended: FlatConfig.Config;
}
declare module "eslint-plugin-import" {
const flatConfigs: {
recommended: FlatConfig.Config;
};
}
declare module "eslint-plugin-jsx-a11y" {
const flatConfigs: {
recommended: FlatConfig.Config;
};
}
declare module "eslint-plugin-no-unsanitized" {
const configs: {
recommended: FlatConfig.Config[];
Expand All @@ -16,8 +26,3 @@ declare module "eslint-plugin-promise" {
"flat/recommended": FlatConfig.Config;
};
}
declare module "eslint-plugin-unicorn" {
const configs: {
"flat/recommended": FlatConfig.Config;
};
}

0 comments on commit dcb7639

Please sign in to comment.