-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc.cjs
91 lines (74 loc) · 2.27 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
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
/**
* Room to Breathe
*
* The thinking behind this config is that less code is better
* therefore the code you *do* write has plenty of space to read
* and takes up less space on the screen, making it harder to
* write dense code.
*
* Reading code should be easy and fun, not a chore.
*
* If you find yourself needing to write dense code, step back
* start to think about how can break your solution into smaller
* pieces.
*
* The best solution is not the most complicated, it's the one
* that is the easiest to understand and change.
*/
module.exports = {
extends: [
// TODO: Integrate Astro linting
// 'plugin:astro/recommended',
'@antfu',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 13,
},
ignorePatterns: [
// Markdown files anywhere
'**/*.md',
// TSX files anywhere
'**/*.tsx',
// JSON Store path
'src/json/*',
],
rules: {
// Indent with 4 spaces
'indent': [ 'error', 4, {
SwitchCase: 1,
} ],
'jsonc/indent': [ 'error', 4 ],
'vue/html-indent': [ 'error', 4 ],
'vue/component-tags-order': [ 'error', {
order: [ 'template', 'script', 'style' ],
} ],
// Typescript Indent
'@typescript-eslint/indent': [ 'error', 4 ],
'space-in-parens': [ 'error', 'always' ],
'space-before-function-paren': [ 'error', 'always' ],
'@typescript-eslint/space-before-function-paren': [ 'error', 'always' ],
'object-curly-spacing': [ 'error', 'always' ],
'array-bracket-spacing': [ 'error', 'always' ],
'computed-property-spacing': [ 'error', 'always' ],
'template-curly-spacing': [ 'error', 'always' ],
// Enforce curly braces for all control statements
'curly': [ 'error', 'all' ],
'quotes': [ 'error', 'single' ],
// Disable semicolons
'semi': 'off',
'@typescript-eslint/semi': [ 'error', 'never' ],
'import/extensions': 0,
},
overrides: [
{
files: [
'./**/*.vue',
'./**/*.config.*',
],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
],
}