Skip to content

Commit f747a5b

Browse files
authored
chore: update eslint config (C4illin#521)
1 parent 52af8d5 commit f747a5b

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

bun.lock

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

eslint.config.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
import js from "@eslint/js";
2-
import eslintParserTypeScript from "@typescript-eslint/parser";
32
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
3+
import { defineConfig } from "eslint/config";
44
import globals from "globals";
5-
import tseslint from "typescript-eslint";
6-
import path from "path";
7-
import { fileURLToPath } from "url";
5+
import tseslint, { parser as eslintParserTypeScript } from "typescript-eslint";
86

9-
const __filename = fileURLToPath(import.meta.url);
10-
const __dirname = path.dirname(__filename);
11-
12-
export default tseslint.config(
7+
export default defineConfig(
138
{
14-
ignores: ["**/node_modules/**", "eslint.config.ts", "dist/**"],
9+
ignores: ["**/node_modules/**", "dist/**"],
1510
},
1611
js.configs.recommended,
1712
tseslint.configs.recommended,
1813
{
19-
files: ["**/*.{tsx,ts}"],
20-
plugins: {
21-
"better-tailwindcss": eslintPluginBetterTailwindcss,
22-
},
14+
files: ["**/*.{ts,tsx,cts,mts}"],
15+
extends: [
16+
eslintPluginBetterTailwindcss.configs.recommended,
17+
eslintPluginBetterTailwindcss.configs.stylistic,
18+
],
2319
languageOptions: {
2420
parser: eslintParserTypeScript,
2521
parserOptions: {
2622
project: "./tsconfig.eslint.json",
27-
tsconfigRootDir: __dirname,
28-
ecmaFeatures: {
29-
jsx: true,
30-
},
3123
},
3224
globals: {
3325
...globals.node,
@@ -39,9 +31,6 @@ export default tseslint.config(
3931
},
4032
},
4133
rules: {
42-
...(eslintPluginBetterTailwindcss.configs["recommended-warn"] ?? {}).rules,
43-
...(eslintPluginBetterTailwindcss.configs["stylistic-warn"] ?? {}).rules,
44-
// "tailwindcss/classnames-order": "off",
4534
"better-tailwindcss/enforce-consistent-line-wrapping": [
4635
"warn",
4736
{
@@ -66,6 +55,16 @@ export default tseslint.config(
6655
],
6756
},
6857
},
58+
{
59+
files: ["**/*.{jsx,tsx}"],
60+
languageOptions: {
61+
parserOptions: {
62+
ecmaFeatures: {
63+
jsx: true,
64+
},
65+
},
66+
},
67+
},
6968
{
7069
files: ["**/*.{js,cjs,mjs,jsx}"],
7170
extends: [tseslint.configs.disableTypeChecked],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@tailwindcss/postcss": "^4.1.18",
3737
"@types/bun": "latest",
3838
"@types/node": "^24.10.9",
39-
"@typescript-eslint/parser": "^8.54.0",
4039
"eslint": "^9.39.2",
4140
"eslint-plugin-better-tailwindcss": "^4.0.2",
4241
"globals": "^17.1.0",

0 commit comments

Comments
 (0)