forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
54 lines (49 loc) · 1.31 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
module.exports = {
extends: ['@sveltejs'],
// TODO: add runes to eslint-plugin-svelte
globals: {
$state: true,
$derived: true,
$effect: true,
$props: true
},
overrides: [
{
// scripts and playground should be console logging so don't lint against them
files: ['playgrounds/**/*', 'scripts/**/*'],
rules: {
'no-console': 'off'
}
},
{
// the playgrounds can use public naming conventions since they're examples
files: ['playgrounds/**/*'],
rules: {
'lube/svelte-naming-convention': 'off'
}
},
{
files: ['packages/svelte/src/compiler/**/*'],
rules: {
'no-var': 'error'
}
}
],
plugins: ['lube'],
rules: {
'no-console': 'error',
'lube/svelte-naming-convention': ['error', { fixSameNames: true }],
// eslint isn't that well-versed with JSDoc to know that `foo: /** @type{..} */ (foo)` isn't a violation of this rule, so turn it off
'object-shorthand': 'off',
'no-var': 'off',
// TODO: enable these rules and run `pnpm lint:fix`
// skipping that for now so as to avoid impacting real work
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prefer-const': 'off',
'svelte/valid-compile': 'off',
quotes: 'off'
}
};