diff --git a/apps/website/eslint.config.ts b/apps/website/eslint.config.ts index 384efa3e46..951184fc8b 100644 --- a/apps/website/eslint.config.ts +++ b/apps/website/eslint.config.ts @@ -1,9 +1,12 @@ +import url from "node:url"; import react from "@eslint-react/eslint-plugin"; import markdown from "@eslint/markdown"; import * as configs from "@local/configs/eslint"; import gitignore from "eslint-config-flat-gitignore"; +import { recommended as fastImportRecommended } from "eslint-plugin-fast-import"; import pluginReactHooks from "eslint-plugin-react-hooks"; import pluginReactRefresh from "eslint-plugin-react-refresh"; +import { globalIgnores } from "eslint/config"; import tseslint from "typescript-eslint"; import TSCONFIG from "./tsconfig.json" with { type: "json" }; @@ -15,8 +18,17 @@ const GLOB_MDX = ["**/*.mdx"]; const GLOB_APP = ["app/**/*.{js,ts,jsx,tsx}"]; const GLOB_COMPONENT = ["components/**/*.{js,ts,jsx,tsx}"]; const GLOB_CONFIG = ["**/*.config.{js,mjs,ts,tsx}"]; +const GLOB_IGNORES = [ + "test", + "**/*.d.ts", + "eslint.config.ts", +]; + +const dirname = url.fileURLToPath(new URL(".", import.meta.url)); export default tseslint.config( + gitignore(), + globalIgnores(GLOB_IGNORES), { extends: [ markdown.configs.recommended, @@ -37,10 +49,12 @@ export default tseslint.config( { extends: [ configs.typescript, + fastImportRecommended({ rootDir: dirname }), ], files: GLOB_TS, rules: { "no-restricted-syntax": "off", + "fast-import/no-unused-exports": "off", }, }, { @@ -90,5 +104,4 @@ export default tseslint.config( "no-undef": "off", }, }, - gitignore(), ); diff --git a/apps/website/package.json b/apps/website/package.json index a1bee94f8a..8d02d7fa3f 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -51,8 +51,8 @@ "dedent": "^1.6.0", "eslint": "^9.29.0", "eslint-plugin-de-morgan": "^1.3.0", - "eslint-plugin-import-x": "^4.15.2", "eslint-plugin-perfectionist": "^4.15.0", + "eslint-plugin-fast-import": "^1.2.0", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.20", "eslint-plugin-unicorn": "^59.0.1", diff --git a/eslint.config.ts b/eslint.config.ts index 8c3553c771..6a1f6a5238 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -4,7 +4,7 @@ import markdown from "@eslint/markdown"; import * as configs from "@local/configs/eslint"; import pluginLocal from "@local/eslint-plugin-local"; import gitIgnores from "eslint-config-flat-gitignore"; -import * as pluginFastImport from "eslint-plugin-fast-import"; +import { recommended as fastImportRecommended } from "eslint-plugin-fast-import"; import pluginVitest from "eslint-plugin-vitest"; import { globalIgnores } from "eslint/config"; import tseslint from "typescript-eslint"; @@ -57,7 +57,7 @@ export default tseslint.config( extends: [ ...tseslint.configs.strictTypeChecked, configs.typescript, - pluginFastImport.recommended({ rootDir: dirname }), + fastImportRecommended({ rootDir: dirname }), ], files: GLOB_TS, languageOptions: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee1d63ad26..0e482a5745 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -377,9 +377,9 @@ importers: eslint-plugin-de-morgan: specifier: ^1.3.0 version: 1.3.0(eslint@9.29.0(jiti@2.4.2)) - eslint-plugin-import-x: - specifier: ^4.15.2 - version: 4.15.2(@typescript-eslint/utils@8.35.0(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2)) + eslint-plugin-fast-import: + specifier: ^1.2.0 + version: 1.2.0(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3) eslint-plugin-perfectionist: specifier: ^4.15.0 version: 4.15.0(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3) @@ -5462,14 +5462,6 @@ packages: supports-color: optional: true - debug@3.2.7: - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -5771,18 +5763,6 @@ packages: peerDependencies: eslint: ^9.5.0 - eslint-import-context@0.1.8: - resolution: {integrity: sha512-bq+F7nyc65sKpZGT09dY0S0QrOnQtuDVIfyTGQ8uuvtMIF7oHp6CEP3mouN0rrnYF3Jqo6Ke0BfU/5wASZue1w==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - peerDependencies: - unrs-resolver: ^1.0.0 - peerDependenciesMeta: - unrs-resolver: - optional: true - - eslint-import-resolver-node@0.3.9: - resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-plugin-de-morgan@1.3.0: resolution: {integrity: sha512-UHCQ4XyDaEeSmk7lI0O1TEcsSBkvdyY8FV4H9TN2DvBfKV45SJR/qZ/rYwzt8JSBIbMXy8S0vNBhzngnpIreJw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -5802,19 +5782,6 @@ packages: ts-api-utils: ^2.1.0 typescript: ^5.8.3 - eslint-plugin-import-x@4.15.2: - resolution: {integrity: sha512-J5gx7sN6DTm0LRT//eP3rVVQ2Yi4hrX0B+DbWxa5er8PZ6JjLo9GUBwogIFvEDdwJaSqZplpQT+haK/cXhb7VQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/utils': ^8.0.0 - eslint: ^8.57.0 || ^9.0.0 - eslint-import-resolver-node: '*' - peerDependenciesMeta: - '@typescript-eslint/utils': - optional: true - eslint-import-resolver-node: - optional: true - eslint-plugin-jsdoc@51.2.3: resolution: {integrity: sha512-pagzxFubOih+O6XSB1D8BkDkJjF4G4/v8s9pRg4FkXQJLu0e3QJg621ayhmnhyc5mNBpp3cYCNiUyeLQs7oz7w==} engines: {node: '>=20.11.0'} @@ -8420,10 +8387,6 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - stable-hash-x@0.1.1: - resolution: {integrity: sha512-l0x1D6vhnsNUGPFVDx45eif0y6eedVC8nm5uACTrVFJFtl2mLRW17aWtVyxFCpn5t94VUPkjU8vSLwIuwwqtJQ==} - engines: {node: '>=12.0.0'} - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -13590,11 +13553,6 @@ snapshots: dependencies: ms: 2.0.0 - debug@3.2.7: - dependencies: - ms: 2.1.3 - optional: true - debug@4.3.7: dependencies: ms: 2.1.3 @@ -13964,22 +13922,6 @@ snapshots: '@eslint/compat': 1.2.8(eslint@9.29.0(jiti@2.4.2)) eslint: 9.29.0(jiti@2.4.2) - eslint-import-context@0.1.8(unrs-resolver@1.9.0): - dependencies: - get-tsconfig: 4.10.1 - stable-hash-x: 0.1.1 - optionalDependencies: - unrs-resolver: 1.9.0 - - eslint-import-resolver-node@0.3.9: - dependencies: - debug: 3.2.7 - is-core-module: 2.16.1 - resolve: 1.22.10 - transitivePeerDependencies: - - supports-color - optional: true - eslint-plugin-de-morgan@1.3.0(eslint@9.29.0(jiti@2.4.2)): dependencies: eslint: 9.29.0(jiti@2.4.2) @@ -14015,24 +13957,6 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import-x@4.15.2(@typescript-eslint/utils@8.35.0(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2)): - dependencies: - '@typescript-eslint/types': 8.35.0 - comment-parser: 1.4.1 - debug: 4.4.1 - eslint: 9.29.0(jiti@2.4.2) - eslint-import-context: 0.1.8(unrs-resolver@1.9.0) - is-glob: 4.0.3 - minimatch: 10.0.1 - semver: 7.7.2 - stable-hash-x: 0.1.1 - unrs-resolver: 1.9.0 - optionalDependencies: - '@typescript-eslint/utils': 8.35.0(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3) - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - eslint-plugin-jsdoc@51.2.3(eslint@9.29.0(jiti@2.4.2)): dependencies: '@es-joy/jsdoccomment': 0.52.0 @@ -17201,8 +17125,6 @@ snapshots: sprintf-js@1.0.3: {} - stable-hash-x@0.1.1: {} - stackback@0.0.2: {} statuses@1.5.0: {}