-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy path.eslintrc.cjs
73 lines (69 loc) · 2.49 KB
/
.eslintrc.cjs
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
68
69
70
71
72
73
// eslint does not properly load plugins loaded by presets
// this fixes that
require('@rushstack/eslint-patch/modern-module-resolution');
/** @type import('eslint/') */
module.exports = {
extends: [
'@ephys/eslint-config-typescript',
'@ephys/eslint-config-typescript/react',
'@ephys/eslint-config-typescript/browser',
// https://github.com/facebook/docusaurus/issues/6520
'@ephys/eslint-config-typescript/commonjs',
'plugin:mdx/recommended',
],
overrides: [
{
files: ['*.mdx/**', '*.md/**'],
rules: {
// these rules require proper type-checking and cannot be enabled on code snippets inside markdown files
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/prefer-includes': 'off',
'@typescript-eslint/prefer-readonly': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/prefer-return-this-type': 'off',
},
},
{
files: ['*.d.ts', 'src/pages/*', 'src/theme/**/*'],
rules: {
// in .d.ts files, we don't really have a choice as it's dictated by the file that's being typed.
// For pages and theme files, docusaurus imposes the default export
'import/no-default-export': 'off',
},
},
],
ignorePatterns: [
// archives
'static/v1',
'static/v2',
'static/v3',
'static/v4',
'static/v5',
// auto-generated
'static/api',
'build',
'.sequelize',
'.docusaurus',
'**/_category_.json',
// as sad as it is, eslint-mdx has a syntax error when a JSX tag includes a code block
// https://github.com/mdx-js/eslint-mdx/issues/367
'*.mdx',
// rules that should not run on json files are, for some unknown reason, ran.
// need to figure out why before removing this:
'*.json',
],
settings: {
'mdx/code-blocks': true,
},
};