-
Notifications
You must be signed in to change notification settings - Fork 45
/
.eslintrc.js
79 lines (75 loc) · 2.49 KB
/
.eslintrc.js
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
module.exports = {
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
env: {
browser: true,
es6: true,
},
globals: {
ga: "readonly",
},
extends: ["airbnb-base", "plugin:storybook/recommended"],
plugins: ["jest", "svelte3"],
rules: {
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
"no-param-reassign": [
"error",
{ props: true, ignorePropertyModificationsFor: ["draft"] },
],
},
overrides: [
{
files: ["**/*.js"],
extends: ["prettier"],
plugins: ["prettier"],
rules: {
"prettier/prettier": "error",
},
},
{
files: ["**/*.svelte"],
processor: "svelte3/svelte3",
// Turn off all rules that might conflict with Prettier.[1] Note that this
// does not warn if a Svelte file disobeys Prettier rules. That's what the
// Prettier *plugin* does, but at the time of this writing, the
// eslint-plugin-svelte3 plugin discourages the use of the Prettier
// plugin for Svelte files.[2]
//
// [1] https://github.com/prettier/eslint-config-prettier
// [2] https://github.com/sveltejs/eslint-plugin-svelte3/blob/6900d670c9e85509b2d21decd91f1e75f7934596/OTHER_PLUGINS.md#eslint-plugin-prettier
extends: ["prettier"],
rules: {
"prefer-const": "off",
// Disable rules that do not work correctly with eslint-plugin-svelte3
//
// https://github.com/sveltejs/eslint-plugin-svelte3/blob/6900d670c9e85509b2d21decd91f1e75f7934596/OTHER_PLUGINS.md#eslint-plugin-import
"import/first": "off",
"import/no-duplicates": "off",
"import/no-mutable-exports": "off",
"import/no-unresolved": "off",
// Temporarily work around a bug in eslint-plugin-svelte3.
//
// https://github.com/sveltejs/eslint-plugin-svelte3/issues/41#issuecomment-572503966
"no-multiple-empty-lines": ["error", { max: 2, maxBOF: 2, maxEOF: 0 }],
},
// Eslint only allows regular CSS inside <style>, so we
// use this setting to ignore warnings about SCSS/LESS syntax
//
// https://github.com/sveltejs/eslint-plugin-svelte3#svelte3ignore-styles
settings: {
"svelte3/ignore-styles": () => true,
},
},
{
files: ["tests/**/*.test.js"],
plugins: ["jest"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
env: {
jest: true,
},
},
],
};