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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
| module.exports = { env: { browser: true, commonjs: true, es6: true, }, parserOptions: { ecmaVersion: 2020, sourceType: "module", }, extends: ["plugin:prettier/recommended", "prettier"], globals: { wx: true, App: true, Page: true, Component: true, getApp: true, getCurrentPages: true, Behavior: true, global: true, __wxConfig: true, }, ignorePatterns: ["*.wxs"], rules: { "prettier/prettier": "warn", "no-undef": "off", camelcase: ["error", { ignoreDestructuring: true }], "class-name-casing": "off", "no-console": ["warn", { allow: ["warn", "error"] }], "no-debugger": "error", "no-unused-expressions": [ "error", { allowShortCircuit: true, allowTernary: true }, ], "no-empty-interface": "off", "no-use-before-define": ["error", { functions: false }], "no-useless-constructor": "error", "prefer-const": "error", "prefer-destructuring": [ "error", { AssignmentExpression: { array: false, object: false, }, VariableDeclarator: { array: false, object: true, }, }, { enforceForRenamedProperties: false, }, ], "no-const-assign": "error", "no-new-object": "error", "no-prototype-builtins": "error", "no-array-constructor": "error", "array-callback-return": "warn", "prefer-template": "error", "no-useless-escape": "error", "wrap-iife": ["error", "outside"], "space-before-function-paren": [ "warn", { anonymous: "always", named: "never", asyncArrow: "always", }, ], "no-param-reassign": [ "warn", { props: true, ignorePropertyModificationsFor: [ "acc", "accumulator", "e", "ctx", "req", "request", "res", "response", "$scope", "staticContext", "state", ], }, ], "no-confusing-arrow": "warn", "no-dupe-class-members": "error", "no-iterator": "warn", "dot-notation": "warn", "one-var": ["warn", "never"], "no-multi-assign": "error", "no-unused-vars": [ "error", { args: "after-used", ignoreRestSiblings: true, argsIgnorePattern: "^_.+", varsIgnorePattern: "^_.+", }, ], eqeqeq: ["warn", "always"], "no-case-declarations": "error", "no-nested-ternary": "warn", "no-unneeded-ternary": "warn", "no-mixed-operators": [ "error", { groups: [ ["%", "**"], ["%", "+"], ["%", "-"], ["%", "*"], ["%", "/"], ["&", "|", "<<", ">>", ">>>"], ["==", "!=", "===", "!=="], ["&&", "||"], ], allowSamePrecedence: false, }, ], "no-else-return": [ "warn", { allowElseIf: false, }, ], "no-new-wrappers": "warn", indent: [ "warn", 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1, FunctionDeclaration: { parameters: 1, body: 1, }, FunctionExpression: { parameters: 1, body: 1, }, CallExpression: { arguments: 1, }, ArrayExpression: 1, ObjectExpression: 1, ImportDeclaration: 1, flatTernaryExpressions: false, ignoreComments: false, }, ], "linebreak-style": ["warn", "unix"], }, };
|