-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
113 lines (104 loc) · 2.53 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const path = require('node:path')
/** @type {import('eslint').Linter.Config} */
const config = {
root: true,
reportUnusedDisableDirectives: true,
ignorePatterns: ['actions/**/dist', 'www/src/lib/sanity/types.ts'],
extends: ['@zazen', 'plugin:svelte/recommended', 'prettier'],
plugins: ['import-sorting'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
extraFileExtensions: ['.svelte'],
},
env: { browser: true },
settings: {
'import-sorting/known-framework':
/^((@sveltejs|svelte)(\/|-preprocess|$)|(@?sanity(\/|$)))/.source,
'import-sorting/known-first-party': /^\$(app|lib)(\/|$)/.source,
},
rules: {
/**
* Deprecated rule.
*/
'no-return-await': 'off',
/**
* Explicitly initialising props variables to `undefined` lets Svelte
* know the props are optional.
*/
'no-undef-init': 'off',
'import/no-extraneous-dependencies': 'off',
'import/order': 'off',
// 'import/order': [
// 'error',
// {
// alphabetize: {
// caseInsensitive: true,
// order: 'asc',
// },
// groups: [
// 'builtin',
// 'external',
// 'internal',
// 'parent',
// ['sibling', 'index'],
// ],
// 'newlines-between': 'always',
// pathGroups: [
// {
// pattern:
// '{@sveltejs/**,svelte/**,svelte?(-preprocess),@sanity/**,sanity/**,sanity}',
// group: 'builtin',
// position: 'after',
// },
// {
// pattern: '$?(app|lib)/**',
// group: 'internal',
// position: 'after',
// },
// {
// pattern: '*.+(css)',
// group: 'index',
// position: 'after',
// patternOptions: {
// matchBase: true,
// },
// },
// ],
// pathGroupsExcludedImportTypes: ['svelte'],
// },
// ],
'import-sorting/order': 'error',
'prefer-let/prefer-let': 'off',
'unicorn/switch-case-braces': ['error', 'avoid'],
yoda: 'off',
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'import/extensions': 'off',
'import/no-mutable-exports': 'off',
'svelte/no-at-html-tags': 'off',
'svelte/no-dupe-style-properties': 'warn',
},
},
{ files: ['*.cjs'], env: { node: true } },
{
files: ['*.ts', '*.tsx'],
extends: ['@zazen/eslint-config/typescript'],
parserOptions: {
project: path.resolve('studio', 'tsconfig.json'),
},
rules: {
'import/extensions': ['off'],
},
},
],
}
module.exports = config