forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
107 lines (107 loc) · 2.68 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module.exports = {
extends: './packages/eslint-config/shared.js',
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroupsExcludedImportTypes: ['react'],
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'after',
},
{
pattern: '@redwoodjs/**',
group: 'external',
position: 'after',
},
{
pattern: 'src/lib/test',
group: 'parent',
position: 'before',
},
{
pattern: 'src/**',
group: 'parent',
position: 'before',
},
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
curly: 'error',
},
overrides: [
{
files: ['packages/structure/**'],
rules: {
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-case-declarations': 'off',
'prefer-const': 'off',
'no-empty': 'warn',
'no-unused-expressions': 'off',
},
},
// Browser Context
//
// We prevent "window" from being used, and instead require "global".
// This is because prerender runs in the NodeJS context it's undefined.
{
files: [
'packages/auth/src/**',
'packages/forms/src/**',
'packages/prerender/src/browserUtils/**',
'packages/router/src/**',
'packages/web/src/**',
],
env: {
es6: true,
browser: true,
},
globals: {
React: 'readonly', // We auto-import React via Babel.
window: 'off', // Developers should use `global` instead of window. Since window is undefined in NodeJS.
},
},
// Entry.js rules
{
files: ['packages/web/src/entry/index.js'],
env: {
es6: true,
browser: true,
},
globals: {
React: 'readonly',
},
},
// NodeJS Context
{
files: [
'packages/api/src/**',
'packages/api-server/src/**',
'packages/cli/src/**',
'packages/core/src/**',
'packages/core/config/**',
'packages/create-redwood-app/src/create-redwood-app.js',
'packages/dev-server/src/**',
'packages/internal/src/**',
'packages/prerender/src/**',
'packages/structure/src/**',
'packages/testing/src/**',
'packages/eslint-config/*.js',
'packages/eslint-plugin-redwood/src/**',
],
env: {
es6: true,
node: true,
},
},
],
}