-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
60 lines (58 loc) · 1.45 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// eslint-disable-next-line import/no-extraneous-dependencies
const alias = require('alias-hq');
const eslintImportAlias = require('./alias/eslint-import');
module.exports = {
settings: {
'import/resolver': {
alias: {
map: alias.get(eslintImportAlias),
extensions: ['.js', '.jsx', '.json'],
},
},
},
extends: [
'react-app',
'react-app/jest',
'plugin:@next/next/recommended',
'plugin:ssr-friendly/recommended',
'prettier',
],
plugins: ['prettier', 'ssr-friendly'],
rules: {
'no-const-assign': 'error',
/** Restrict imports from devDependencies since they are not included in library build. peerDependencies are ok */
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
peerDependencies: true,
},
],
/**
* Enforce import order with empty lines between import group
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
*/
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index']],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
],
'newlines-between': 'always',
},
],
'import/no-unresolved': 'error',
'prettier/prettier': [
'error',
{},
{
usePrettierrc: true,
},
],
},
overrides: [],
};