Skip to content

Commit 0096a6f

Browse files
authored
chore: fix typescript-eslint (#439)
1 parent 53c1a54 commit 0096a6f

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

eslint.config.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,28 @@ import eslintParserTypeScript from "@typescript-eslint/parser";
33
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
44
import globals from "globals";
55
import tseslint from "typescript-eslint";
6+
import path from "path";
7+
import { fileURLToPath } from "url";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
611

712
export default tseslint.config(
13+
{
14+
ignores: ["**/node_modules/**", "eslint.config.ts", "dist/**"],
15+
},
816
js.configs.recommended,
917
tseslint.configs.recommended,
1018
{
19+
files: ["**/*.{tsx,ts}"],
1120
plugins: {
1221
"better-tailwindcss": eslintPluginBetterTailwindcss,
1322
},
14-
ignores: ["**/node_modules/**", "eslint.config.ts"],
1523
languageOptions: {
1624
parser: eslintParserTypeScript,
1725
parserOptions: {
18-
project: true,
26+
project: "./tsconfig.eslint.json",
27+
tsconfigRootDir: __dirname,
1928
ecmaFeatures: {
2029
jsx: true,
2130
},
@@ -24,7 +33,6 @@ export default tseslint.config(
2433
...globals.node,
2534
},
2635
},
27-
files: ["**/*.{tsx,ts}"],
2836
settings: {
2937
"better-tailwindcss": {
3038
entryPoint: "src/main.css",

tsconfig.eslint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"noEmit": true
4+
},
5+
"extends": "./tsconfig.json",
6+
"include": ["src", "tests", "eslint.config.ts", "package.json"]
7+
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
"esModuleInterop": true
3030
// "noImplicitReturns": true
3131
},
32-
"include": ["src", "tests", "package.json"]
32+
"include": ["src", "package.json"],
33+
"exclude": ["dist", "node_modules"]
3334
}

0 commit comments

Comments
 (0)