-
Notifications
You must be signed in to change notification settings - Fork 142
/
.eslintrc.js
37 lines (36 loc) · 1.1 KB
/
.eslintrc.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
const isVSCode = Boolean(process.env.VSCODE_PID)
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
overrides: [
{
files: ['*.{ts,tsx,js,jsx,mjs,cjs}'],
extends: ['@edgeandnode/eslint-config', '@edgeandnode/eslint-config/next'],
settings: {
next: { rootDir: 'website' },
},
},
{
files: ['*.{ts,tsx}'],
parserOptions: {
project: true,
},
},
{
// Only lint the English pages because the Markdown for the other languages is auto-generated from English (via Crowdin).
// But include all languages when running the ESLint extension in VS Code (in case the user has "eslint.validate": ["mdx"]),
// otherwise there will be random errors since the non-English files don't match any ruleset.
files: [`website/pages/${!isVSCode ? 'en/' : ''}**/*.{md,mdx}`],
parser: 'eslint-mdx',
processor: 'mdx/remark',
plugins: ['mdx'],
rules: {
'mdx/remark': 'error',
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
],
}