-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.ts
49 lines (42 loc) · 1.33 KB
/
eslint.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import path from "path";
import tseslint from "typescript-eslint";
import { includeIgnoreFile } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import eslint from "@eslint/js";
const gitignorePath = path.resolve(import.meta.dirname, ".gitignore");
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default tseslint.config(
includeIgnoreFile(gitignorePath),
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
},
extends: [eslint.configs.recommended],
},
{
files: ["**/*.{ts,tsx}"],
ignores: ["src/components/ui/**"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
extends: [
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
],
rules: {
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
...compat.extends("prettier", "next/core-web-vitals", "next/typescript"),
);