-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
67 lines (64 loc) · 1.72 KB
/
eslint.config.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import nextjsConfig from "eslint-config-neon/flat/next.js";
/** @type {import("typescript-eslint").ConfigWithExtends} */
const baseConfig = {
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
};
/** @type {import("typescript-eslint").ConfigWithExtends} */
const botConfig = {
...baseConfig,
rules: {
"prettier/prettier": "error",
quotes: ["error", "double", { avoidEscape: true }],
semi: ["error", "always"],
"quote-props": ["error", "as-needed"],
"prefer-const": "error",
"no-var": "error",
"no-async-promise-executor": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "off",
},
};
export default tseslint.config(
{
ignores: [
"**/node_modules/",
".git/",
"**/.next/",
"apps/web/src/components/ui/**",
"apps/web/.contentlayer/**",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ["apps/bot/**/*.ts"],
...botConfig,
},
{
files: ["apps/web/**/*.{ts,tsx,js,jsx}"],
...nextjsConfig[0],
rules: {
...nextjsConfig[0].rules,
"@next/next/no-duplicate-head": 0,
},
},
eslintPluginPrettierRecommended,
);