|
1 | 1 | { |
2 | | - "env": { |
3 | | - "browser": true, |
4 | | - "node": true, |
5 | | - "es2021": true, |
6 | | - "es2022": true, |
7 | | - "webextensions": true |
8 | | - }, |
9 | | - "extends": ["eslint:recommended", "airbnb-base"], |
10 | | - "globals": { |
11 | | - "_browser": "writable", |
12 | | - "browser": "readonly" |
13 | | - }, |
14 | | - "ignorePatterns": [ |
15 | | - "/etc", |
16 | | - "build", |
17 | | - "dist", |
18 | | - "node_modules" |
19 | | - ], |
20 | | - "overrides": [ |
21 | | - { |
22 | | - "files": ["*.svelte"], |
23 | | - "processor": "svelte3/svelte3" |
24 | | - } |
25 | | - ], |
26 | | - "parserOptions": { |
27 | | - "ecmaVersion": "latest", |
28 | | - "sourceType": "module" |
29 | | - }, |
30 | | - "plugins": ["svelte3"], |
31 | | - "rules": { |
32 | | - "array-callback-return": "off", |
33 | | - "arrow-body-style": "off", |
34 | | - "arrow-parens": ["error", "as-needed"], |
35 | | - "comma-dangle": ["error", "never"], |
36 | | - "consistent-return": "off", |
37 | | - "default-case": "off", |
38 | | - "eqeqeq": ["error", "smart"], |
39 | | - "global-require": "off", |
40 | | - "guard-for-in": "warn", |
41 | | - "import/extensions": "off", |
42 | | - "import/first": "off", |
43 | | - "import/no-mutable-exports": "off", |
44 | | - "import/no-extraneous-dependencies": ["error", { |
45 | | - "devDependencies": true |
46 | | - }], |
47 | | - "import/prefer-default-export": "off", |
48 | | - "import/no-unresolved": "off", |
49 | | - "indent": ["error", 4, {"SwitchCase": 1}], |
50 | | - "max-len": "off", |
51 | | - "no-alert":"off", |
52 | | - "no-await-in-loop":"warn", |
53 | | - "no-confusing-arrow": ["warn", { |
54 | | - "allowParens": true, |
55 | | - "onlyOneSimpleParam": true |
56 | | - }], |
57 | | - "no-console": ["warn", {"allow": ["info", "warn", "error"]}], |
58 | | - "no-continue": "off", |
59 | | - "no-else-return": ["error", {"allowElseIf": true}], |
60 | | - "no-nested-ternary": "off", |
61 | | - "no-param-reassign": ["warn", { "props": false }], |
62 | | - "no-plusplus": "off", |
63 | | - "no-restricted-syntax": "off", |
64 | | - "no-return-assign": "off", |
65 | | - "no-underscore-dangle":"off", |
66 | | - "no-unused-expressions": "off", |
67 | | - "no-use-before-define": ["error", { |
68 | | - "functions": false, |
69 | | - "classes": true, |
70 | | - "variables": true, |
71 | | - "allowNamedExports": false |
72 | | - }], |
73 | | - "object-curly-newline": ["error", {"consistent": true}], |
74 | | - "object-curly-spacing": ["error", "never"], |
75 | | - "one-var": "off", |
76 | | - "one-var-declaration-per-line": "off", |
77 | | - "prefer-destructuring": "off", |
78 | | - "prefer-object-spread": "warn", |
79 | | - "quotes": ["error", "double"], |
80 | | - "import/no-namespace": "warn" |
81 | | - } |
| 2 | + "env": { |
| 3 | + "browser": true, |
| 4 | + "es2021": true, |
| 5 | + "node": true |
| 6 | + }, |
| 7 | + "extends": ["prettier"], |
| 8 | + "globals": { |
| 9 | + "browser": "readonly", |
| 10 | + "webkit": "readonly" |
| 11 | + }, |
| 12 | + "ignorePatterns": ["node_modules", "xcode"], |
| 13 | + "parserOptions": { |
| 14 | + "ecmaVersion": 13, |
| 15 | + "sourceType": "module" |
| 16 | + }, |
| 17 | + "overrides": [ |
| 18 | + { |
| 19 | + "files": ["*.svelte"], |
| 20 | + // why use this instead of the svelte3 plugin? |
| 21 | + // eslint prettier errors are ignored for stylelint, and... |
| 22 | + // https://github.com/prettier/eslint-plugin-prettier#svelte-support |
| 23 | + "parser": "svelte-eslint-parser" |
| 24 | + } |
| 25 | + ], |
| 26 | + "plugins": ["prettier"], |
| 27 | + "rules": { |
| 28 | + "curly": ["error", "multi-line"], |
| 29 | + "eqeqeq": ["error", "smart"], |
| 30 | + "max-len": [ |
| 31 | + "error", |
| 32 | + { |
| 33 | + "code": 80, |
| 34 | + "ignoreRegExpLiterals": true, |
| 35 | + "tabWidth": 4 |
| 36 | + } |
| 37 | + ], |
| 38 | + "no-bitwise": "error", |
| 39 | + "no-console": [1, {"allow": ["error", "info", "warn"]}], |
| 40 | + "no-duplicate-imports": "error", |
| 41 | + "no-mixed-operators": "error", |
| 42 | + "no-multi-str": "error", |
| 43 | + "no-restricted-syntax": [ |
| 44 | + "error", |
| 45 | + { |
| 46 | + "selector": "VariableDeclaration[kind='var'][declare!=true]", |
| 47 | + "message": "Unexpected var, use let or const instead." |
| 48 | + } |
| 49 | + ], |
| 50 | + "no-useless-concat": "error", |
| 51 | + "no-unused-vars": [ |
| 52 | + "error", |
| 53 | + { |
| 54 | + "args": "all", |
| 55 | + "argsIgnorePattern": "^_", |
| 56 | + "caughtErrors": "all", |
| 57 | + "caughtErrorsIgnorePattern": "^_", |
| 58 | + "destructuredArrayIgnorePattern": "^_" |
| 59 | + } |
| 60 | + ], |
| 61 | + "no-undef": "error", |
| 62 | + "no-use-before-define": [ |
| 63 | + "error", |
| 64 | + { |
| 65 | + "classes": true, |
| 66 | + "functions": false, |
| 67 | + "variables": true |
| 68 | + } |
| 69 | + ], |
| 70 | + "no-var": "off", |
| 71 | + "operator-assignment": ["error", "always"], |
| 72 | + "padding-line-between-statements": [ |
| 73 | + "error", |
| 74 | + // { |
| 75 | + // "blankLine": "always", |
| 76 | + // "prev": "*", |
| 77 | + // "next": ["return", "throw"] |
| 78 | + // }, |
| 79 | + // { |
| 80 | + // "blankLine": "always", |
| 81 | + // "prev": ["const", "let", "var"], |
| 82 | + // "next": "*" |
| 83 | + // }, |
| 84 | + // { |
| 85 | + // "blankLine": "any", |
| 86 | + // "prev": ["const", "let", "var"], |
| 87 | + // "next": ["const", "let", "var"] |
| 88 | + // }, |
| 89 | + { |
| 90 | + "blankLine": "always", |
| 91 | + "prev": ["directive", "import"], |
| 92 | + "next": "*" |
| 93 | + }, |
| 94 | + { |
| 95 | + "blankLine": "any", |
| 96 | + "prev": ["directive", "import"], |
| 97 | + "next": ["directive", "import"] |
| 98 | + } |
| 99 | + ], |
| 100 | + "prefer-const": "error", |
| 101 | + "prefer-template": "error", |
| 102 | + "quotes": [ |
| 103 | + "error", |
| 104 | + "double", |
| 105 | + {"allowTemplateLiterals": false, "avoidEscape": true} |
| 106 | + ], |
| 107 | + "prettier/prettier": "error" |
| 108 | + } |
82 | 109 | } |
0 commit comments