forked from cert-manager/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
60 lines (55 loc) · 1.42 KB
/
Copy patheslint.config.mjs
File metadata and controls
60 lines (55 loc) · 1.42 KB
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
import { defineConfig, globalIgnores } from "eslint/config";
import js from "@eslint/js";
import reactPlugin from "@eslint-react/eslint-plugin";
import nextPlugin from "@next/eslint-plugin-next";
import * as mdx from "eslint-plugin-mdx";
import globals from "globals";
export default defineConfig([
// Global ignores (equivalent to an .eslintignore)
globalIgnores([
"out",
"node_modules",
".github/actions/sync/node_modules",
"**/node_modules",
"**/out",
"**/build",
"**/.next",
]),
// Base JS rules (eslint:recommended)
js.configs.recommended,
// React (@eslint-react) recommended rules (includes plugin, settings, and rules)
reactPlugin.configs.recommended,
// Next.js rules and JSX language options
{
plugins: {
"@next/next": nextPlugin,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
ecmaVersion: 13, // ES2022
sourceType: "module",
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
rules: {
...nextPlugin.configs.recommended.rules,
},
},
// MDX support (files + embedded code blocks)
// See: https://github.com/mdx-js/eslint-mdx#flat-config
{
...mdx.flat,
},
{
...mdx.flatCodeBlocks,
// Optionally override code-block rules here:
rules: {
...mdx.flatCodeBlocks.rules,
// e.g. "no-var": "error", "prefer-const": "error",
},
},
]);