-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy patheslint.config.mjs
60 lines (57 loc) · 1.66 KB
/
eslint.config.mjs
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
/* eslint-disable import/no-anonymous-default-export */
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import * as eslintPluginMdx from "eslint-plugin-mdx";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import eslintCustomConfig from "@jakejarvis/eslint-config";
/** @type {import("@eslint/eslintrc").FlatCompat} */
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
});
/** @type {import("eslint").Linter.Config[]} */
export default [
{ ignores: ["README.md", ".next", ".vercel", "node_modules"] },
...compat.config({
plugins: ["react-compiler", "css-modules"],
extends: ["eslint:recommended", "next/core-web-vitals", "next/typescript", "plugin:css-modules/recommended"],
}),
...eslintCustomConfig,
eslintPluginPrettierRecommended,
{
rules: {
camelcase: [
"error",
{
allow: ["^experimental_", "^unstable_"],
},
],
"prettier/prettier": [
"error",
{},
{
usePrettierrc: true,
},
],
},
},
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "warn",
"react-compiler/react-compiler": "error",
},
},
{
...eslintPluginMdx.flat,
processor: eslintPluginMdx.createRemarkProcessor({
lintCodeBlocks: false,
}),
rules: {
"mdx/remark": "warn",
"mdx/code-blocks": "off",
"react/jsx-no-undef": "off", // components are injected automatically from mdx-components.ts
},
},
];