-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy patheslint.config.mjs
More file actions
83 lines (81 loc) · 2.14 KB
/
eslint.config.mjs
File metadata and controls
83 lines (81 loc) · 2.14 KB
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
import blitzPlugin from '@blitz/eslint-plugin';
import { jsFileExtensions } from '@blitz/eslint-plugin/dist/configs/javascript.js';
import { getNamingConventionRule, tsFileExtensions } from '@blitz/eslint-plugin/dist/configs/typescript.js';
export default [
{
ignores: [
'**/dist',
'**/node_modules',
'**/.wrangler',
'**/liblab/build',
'**/.history',
'**/.next',
'**/starters',
],
},
...blitzPlugin.configs.recommended(),
{
rules: {
'@blitz/catch-error-name': 'off',
'@blitz/lines-around-comment': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@blitz/comment-syntax': 'off',
'@blitz/block-scope-case': 'off',
'array-bracket-spacing': ['error', 'never'],
'object-curly-newline': ['error', { consistent: true }],
'keyword-spacing': ['error', { before: true, after: true }],
'consistent-return': 'error',
semi: ['error', 'always'],
curly: ['error'],
'no-eval': ['error'],
'linebreak-style': ['error', 'unix'],
'arrow-spacing': ['error', { before: true, after: true }],
'multiline-comment-style': 'off',
},
},
{
files: ['**/*.tsx'],
rules: {
...getNamingConventionRule({}, true),
},
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
},
},
{
files: [...tsFileExtensions, ...jsFileExtensions, '**/*.tsx'],
ignores: ['functions/*'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['../'],
message: "Relative imports are not allowed. Please use '~/' instead.",
},
],
},
],
},
},
// Override for shared directory to allow relative imports
{
files: ['shared/**/*'],
rules: {
'no-restricted-imports': 'off',
},
},
// Override for test files to allow relative imports
{
files: ['tests/**/*'],
rules: {
'no-restricted-imports': 'off',
},
},
];