Skip to content

Commit b4b7a10

Browse files
authored
fix: fixed monorepo eslint setup (#1141)
1 parent d27962b commit b4b7a10

File tree

4 files changed

+20
-85
lines changed

4 files changed

+20
-85
lines changed

apps/website/eslint.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import url from "node:url";
12
import react from "@eslint-react/eslint-plugin";
23
import markdown from "@eslint/markdown";
34
import * as configs from "@local/configs/eslint";
45
import gitignore from "eslint-config-flat-gitignore";
6+
import { recommended as fastImportRecommended } from "eslint-plugin-fast-import";
57
import pluginReactHooks from "eslint-plugin-react-hooks";
68
import pluginReactRefresh from "eslint-plugin-react-refresh";
9+
import { globalIgnores } from "eslint/config";
710
import tseslint from "typescript-eslint";
811

912
import TSCONFIG from "./tsconfig.json" with { type: "json" };
@@ -15,8 +18,17 @@ const GLOB_MDX = ["**/*.mdx"];
1518
const GLOB_APP = ["app/**/*.{js,ts,jsx,tsx}"];
1619
const GLOB_COMPONENT = ["components/**/*.{js,ts,jsx,tsx}"];
1720
const GLOB_CONFIG = ["**/*.config.{js,mjs,ts,tsx}"];
21+
const GLOB_IGNORES = [
22+
"test",
23+
"**/*.d.ts",
24+
"eslint.config.ts",
25+
];
26+
27+
const dirname = url.fileURLToPath(new URL(".", import.meta.url));
1828

1929
export default tseslint.config(
30+
gitignore(),
31+
globalIgnores(GLOB_IGNORES),
2032
{
2133
extends: [
2234
markdown.configs.recommended,
@@ -37,10 +49,12 @@ export default tseslint.config(
3749
{
3850
extends: [
3951
configs.typescript,
52+
fastImportRecommended({ rootDir: dirname }),
4053
],
4154
files: GLOB_TS,
4255
rules: {
4356
"no-restricted-syntax": "off",
57+
"fast-import/no-unused-exports": "off",
4458
},
4559
},
4660
{
@@ -90,5 +104,4 @@ export default tseslint.config(
90104
"no-undef": "off",
91105
},
92106
},
93-
gitignore(),
94107
);

apps/website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"dedent": "^1.6.0",
5252
"eslint": "^9.29.0",
5353
"eslint-plugin-de-morgan": "^1.3.0",
54-
"eslint-plugin-import-x": "^4.15.2",
5554
"eslint-plugin-perfectionist": "^4.15.0",
55+
"eslint-plugin-fast-import": "^1.2.0",
5656
"eslint-plugin-react-hooks": "^5.2.0",
5757
"eslint-plugin-react-refresh": "^0.4.20",
5858
"eslint-plugin-unicorn": "^59.0.1",

eslint.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import markdown from "@eslint/markdown";
44
import * as configs from "@local/configs/eslint";
55
import pluginLocal from "@local/eslint-plugin-local";
66
import gitIgnores from "eslint-config-flat-gitignore";
7-
import * as pluginFastImport from "eslint-plugin-fast-import";
7+
import { recommended as fastImportRecommended } from "eslint-plugin-fast-import";
88
import pluginVitest from "eslint-plugin-vitest";
99
import { globalIgnores } from "eslint/config";
1010
import tseslint from "typescript-eslint";
@@ -57,7 +57,7 @@ export default tseslint.config(
5757
extends: [
5858
...tseslint.configs.strictTypeChecked,
5959
configs.typescript,
60-
pluginFastImport.recommended({ rootDir: dirname }),
60+
fastImportRecommended({ rootDir: dirname }),
6161
],
6262
files: GLOB_TS,
6363
languageOptions: {

pnpm-lock.yaml

Lines changed: 3 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)