-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.cjs
62 lines (62 loc) · 1.87 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
/** @type {import('@types/eslint').Linter.BaseConfig} */
module.exports = {
extends: ['next/core-web-vitals', 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
plugins: ['@typescript-eslint', 'simple-import-sort'],
ignorePatterns: ['node_modules', '.next', '.cache', 'build', 'dist', 'out'],
rules: {
'react/jsx-key': 'off',
'import/no-anonymous-default-export': 'off',
'no-console': [
'warn',
{
allow: ['error', 'info'],
},
],
'@next/next/no-img-element': 'off',
'@next/next/no-html-link-for-pages': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
overrides: [
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': [
'error',
{
groups: [
// Dotenv and config packages first.
['^dotenv', '^(#/env)(/.*|$)'],
// React related packages come after.
['^react', '^next(?!/?$)', '^@?\\w'],
// Internal packages.
['^(#|components)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.?(css)$'],
],
},
],
},
},
],
globals: {
React: true,
JSX: true,
},
}