-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheslint.config.js
67 lines (64 loc) · 1.61 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
// @ts-check
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
import security from "eslint-plugin-security";
import { FlatCompat } from "@eslint/eslintrc";
import globals from "globals";
import * as mdx from "eslint-plugin-mdx";
const baseDirectory = dirname(fileURLToPath(import.meta.url));
const compat = new FlatCompat({
baseDirectory,
resolvePluginsRelativeTo: baseDirectory,
});
export default tsEslint.config(
{
ignores: [
"node_modules/**/*",
"dist/**/*",
"out/**/*",
"cdk.out/**/*",
".next/**/*",
"packages/gboost/templates/**/*",
],
languageOptions: {
globals: {
...globals.node,
},
},
},
eslint.configs.recommended,
{
...security.configs.recommended,
rules: {
...security.configs.recommended.rules,
"security/detect-object-injection": "off", // too many false positives
"security/detect-non-literal-fs-filename": "off", // too many false positives
},
},
...tsEslint.configs.recommended,
...compat.config({
overrides: [
{
files: ["packages/gboost-ui/**/*.{ts,tsx}", "docs/**/*.{ts,tsx}"],
extends: "next/core-web-vitals",
},
],
}),
// mdx for docs
{
...mdx.flat,
// optional, if you want to lint code blocks at the same
processor: mdx.createRemarkProcessor({
lintCodeBlocks: true,
}),
},
{
...mdx.flatCodeBlocks,
rules: {
...mdx.flatCodeBlocks.rules,
// if you want to override some rules for code blocks
},
},
);