diff --git a/eslint.config.js b/eslint.config.js index 593bfd50..b7f5829e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,21 +3,17 @@ import {fileURLToPath} from "node:url" import {includeIgnoreFile} from "@eslint/compat" import js from "@eslint/js" -import prettier from "eslint-config-prettier" import jsxA11y from "eslint-plugin-jsx-a11y" import react from "eslint-plugin-react" import reactHooks from "eslint-plugin-react-hooks" import simpleImportSort from "eslint-plugin-simple-import-sort" -import globals from "globals" import ts from "typescript-eslint" const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) const gitignore = path.resolve(dirname, ".gitignore") -/** @type {import('eslint').Linter.Config[]} */ - -const config = [ +export default ts.config( includeIgnoreFile(gitignore), { files: [ @@ -30,16 +26,7 @@ const config = [ "**/*.mts", "**/*.tsx", ], - languageOptions: { - ecmaVersion: "latest", - globals: { - ...globals.browser, - ...globals.node, - ...globals.es2025, - ...globals.jest, - }, - parser: ts.parser, parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, @@ -56,11 +43,10 @@ const config = [ }, }, js.configs.recommended, - ...ts.configs.recommended, + ts.configs.recommended, react.configs.flat.recommended, react.configs.flat["jsx-runtime"], jsxA11y.flatConfigs.recommended, - prettier, { rules: { ...reactHooks.configs.recommended.rules, @@ -72,12 +58,7 @@ const config = [ fixStyle: "separate-type-imports", }, ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - fixMixedExportsWithInlineTypeSpecifier: false, - }, - ], + "@typescript-eslint/consistent-type-exports": "error", "@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-unused-vars": [ "error", @@ -85,74 +66,11 @@ const config = [ ignoreRestSiblings: true, }, ], - "comma-dangle": ["error", "always-multiline"], - "comma-spacing": [ - "error", - { - before: false, - after: true, - }, - ], - "comma-style": ["error", "last"], - "eol-last": ["error", "always"], "eqeqeq": ["error", "always"], - "function-paren-newline": ["off"], - "indent": ["off"], - "jsx-a11y/accessible-emoji": ["off"], - "no-console": ["off"], - "no-mixed-spaces-and-tabs": ["error"], - "no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - }, - ], - "object-curly-newline": [ - "error", - { - consistent: true, - }, - ], - "object-curly-spacing": ["error", "never"], - "object-property-newline": [ - "error", - { - allowAllPropertiesOnSameLine: true, - }, - ], - "prefer-const": ["error"], - "quote-props": ["error", "consistent-as-needed"], - "quotes": ["error", "double"], - "react/jsx-tag-spacing": [ - "error", - { - beforeSelfClosing: "always", - }, - ], - "react/react-in-jsx-scope": ["off"], - "react-hooks/rules-of-hooks": ["error"], - "react-hooks/exhaustive-deps": ["error"], - "semi": ["error", "never"], - "semi-spacing": [ - "error", - { - before: false, - after: true, - }, - ], - "semi-style": ["error", "last"], - "simple-import-sort/imports": ["error"], - "simple-import-sort/exports": ["error"], - "space-before-function-paren": [ - "error", - { - anonymous: "never", - named: "never", - asyncArrow: "always", - }, - ], + "prefer-const": "error", + "react-hooks/exhaustive-deps": "error", + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", }, }, -] - -export default config +) diff --git a/src/hooks/useMarkdown/useMarkdown.test.tsx b/src/hooks/useMarkdown/useMarkdown.test.tsx index 9b509a01..c1fc7294 100644 --- a/src/hooks/useMarkdown/useMarkdown.test.tsx +++ b/src/hooks/useMarkdown/useMarkdown.test.tsx @@ -40,7 +40,6 @@ test("renders images", () => { const {result} = renderHook(() => useMarkdown( - // eslint-disable-next-line quotes '', ), ) diff --git a/src/transformers/twitch/twitch.test.ts b/src/transformers/twitch/twitch.test.ts index 1ac1572a..b1eb9808 100644 --- a/src/transformers/twitch/twitch.test.ts +++ b/src/transformers/twitch/twitch.test.ts @@ -63,6 +63,5 @@ test("transforms twitch clips", () => { const emptyHtml = twitchTransformer.getHTML("https://twitch.tv") - // eslint-disable-next-line quotes expect(emptyHtml).toEqual('
') }) diff --git a/src/transformers/twitch/twitch.ts b/src/transformers/twitch/twitch.ts index 8d50af2c..e1600da9 100644 --- a/src/transformers/twitch/twitch.ts +++ b/src/transformers/twitch/twitch.ts @@ -17,7 +17,6 @@ const getHTML = (string: string): string => { } else if (isClip(string)) { src = `https://clips.twitch.tv/embed?clip=${id}` } else { - // eslint-disable-next-line quotes const html = '' return html } diff --git a/src/transformers/twitter/twitter.test.ts b/src/transformers/twitter/twitter.test.ts index f20adc6b..f773d50a 100644 --- a/src/transformers/twitter/twitter.test.ts +++ b/src/transformers/twitter/twitter.test.ts @@ -22,18 +22,15 @@ test("transforms twitter links", async () => { ) expect(html).toEqual( - // eslint-disable-next-line quotes expect.stringContaining(''), ) expect(html).toEqual( expect.stringContaining( - // eslint-disable-next-line quotes '