-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
61 lines (61 loc) · 1.71 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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:svelte/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: ['./tsconfig.json'],
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
globals: {
$$Generic: 'readable',
$$Slots: 'readable',
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
{
files: ['*.js', '*.cjs'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
rules: {
// this rule is interfering with $$Generic, so we'll disable it for now
// see: https://github.com/sveltejs/eslint-plugin-svelte/issues/541
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
// allow unused function parameters that start with an underscore
argsIgnorePattern: '^_',
// allow destructuring of unused array elements that start with an underscore
destructuredArrayIgnorePattern: '^_',
// allow destructuring of unused fields in order to shrink an object shape
ignoreRestSiblings: true,
varsIgnorePattern: '^\\$\\$(Props|Events|Slots)$',
},
],
},
}