-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
73 lines (69 loc) · 1.93 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
import path from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
const __filename = await Promise.resolve(fileURLToPath(import.meta.url))
const __dirname = await Promise.resolve(path.dirname(__filename))
const compat = new FlatCompat({
baseDirectory: __dirname,
})
const __eslintCofig = [
...compat.config({
parser: '@typescript-eslint/parser',
extends: [
'prettier',
'plugin:mdx/recommended',
'plugin:prettier/recommended',
'plugin:storybook/recommended',
'plugin:tailwindcss/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@next/next/recommended',
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'testing-library/prefer-screen-queries': 'off',
'@next/next/no-html-link-for-pages': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@next/next/no-img-element': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@next/next/no-html-link-for-pages': 'off',
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/classnames-order': 'error',
'tailwindcss/enforces-shorthand': 'error',
'tailwindcss/no-contradicting-classname': 'error',
},
settings: {
'mdx/code-blocks': true,
'mdx/language-mapper': {},
next: {
rootDir: '.',
},
tailwindcss: {
callees: ['cn', 'cva'],
config: 'tailwind.config.ts',
},
},
overrides: [
{
files: ['*.mdx'],
extends: ['plugin:mdx/recommended', 'plugin:@next/next/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
},
],
}),
]
export default __eslintCofig