-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy patheslint.config.mjs
92 lines (88 loc) · 2.12 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import * as mdx from 'eslint-plugin-mdx';
const compat = new FlatCompat({
baseDirectory: path.dirname(fileURLToPath(import.meta.url)),
});
const configs = [
// Mimic ESLintRC-style extends
...compat.extends('@silverhand/react'),
{
rules: {
'sql/no-unsafe-query': 'off',
'unicorn/prevent-abbreviations': 'off',
},
},
{
ignores: ['**/generated-*.md', '**/generated-*.mdx', '**/_template-*.mdx'],
},
{
...mdx.flat,
processor: mdx.createRemarkProcessor({
lintCodeBlocks: false,
}),
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.md', '**/*.mdx'],
rules: {
complexity: 'off',
'unicorn/filename-case': 'off',
'no-unused-expressions': 'off',
'max-statements-per-line': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'react/self-closing-comp': 'off',
'react/no-unescaped-entities': 'off',
},
languageOptions: {
parserOptions: {
extraFileExtensions: ['.mdx'],
},
globals: {
props: 'readonly',
},
},
},
{
files: ['**/*.mdx', '**/*.md'],
rules: {
camelcase: 'off',
'no-warning-comments': 'off',
'no-undef': 'off',
'react/jsx-no-undef': 'off',
'max-lines': 'off',
},
},
{
files: ['**/*.config.ts', '**/*.config.js'],
rules: {
'max-lines': 'off',
},
env: {
node: true,
},
},
{
files: ['**/generate.mjs', '**/generate.js'],
rules: {
'no-template-curly-in-string': 'off',
},
},
{
files: ['**/pages/**/*.tsx'],
rules: {
'consistent-default-export-name/default-export-match-filename': 'off',
},
},
{
files: ['src/theme/**/*'],
rules: {
'consistent-default-export-name/default-export-match-filename': 'off',
'react/function-component-definition': 'off',
'unicorn/prevent-abbreviations': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'react/boolean-prop-naming': 'off',
},
},
];
export default configs;