|
| 1 | +jsdoc = require("eslint-plugin-jsdoc"); |
| 2 | + |
| 3 | +const config = [{ |
| 4 | + plugins: { |
| 5 | + jsdoc, |
| 6 | + }, |
| 7 | + |
| 8 | + languageOptions: { |
| 9 | + globals: { |
| 10 | + _: "readonly", |
| 11 | + $: "readonly", |
| 12 | + fuzzy: "readonly", |
| 13 | + jQuery: "readonly", |
| 14 | + moment: "readonly", |
| 15 | + odoo: "readonly", |
| 16 | + openerp: "readonly", |
| 17 | + owl: "readonly", |
| 18 | + luxon: "readonly", |
| 19 | + }, |
| 20 | + |
| 21 | + ecmaVersion: 2024, |
| 22 | + sourceType: "script", |
| 23 | + }, |
| 24 | + |
| 25 | + rules: { |
| 26 | + "accessor-pairs": "warn", |
| 27 | + "array-callback-return": "warn", |
| 28 | + "callback-return": "warn", |
| 29 | + "capitalized-comments": ["warn", "always", { |
| 30 | + ignoreConsecutiveComments: true, |
| 31 | + ignoreInlineComments: true, |
| 32 | + }], |
| 33 | + complexity: ["warn", 15], |
| 34 | + "constructor-super": "warn", |
| 35 | + "dot-notation": "warn", |
| 36 | + eqeqeq: "warn", |
| 37 | + "global-require": "warn", |
| 38 | + "handle-callback-err": "warn", |
| 39 | + "id-blacklist": "warn", |
| 40 | + "id-match": "warn", |
| 41 | + "init-declarations": "error", |
| 42 | + "max-depth": "warn", |
| 43 | + "max-nested-callbacks": "warn", |
| 44 | + "max-statements-per-line": "warn", |
| 45 | + "no-alert": "warn", |
| 46 | + "no-array-constructor": "warn", |
| 47 | + "no-caller": "warn", |
| 48 | + "no-case-declarations": "warn", |
| 49 | + "no-class-assign": "warn", |
| 50 | + "no-cond-assign": "error", |
| 51 | + "no-const-assign": "error", |
| 52 | + "no-constant-condition": "warn", |
| 53 | + "no-control-regex": "warn", |
| 54 | + "no-debugger": "error", |
| 55 | + "no-delete-var": "warn", |
| 56 | + "no-div-regex": "warn", |
| 57 | + "no-dupe-args": "error", |
| 58 | + "no-dupe-class-members": "error", |
| 59 | + "no-dupe-keys": "error", |
| 60 | + "no-duplicate-case": "error", |
| 61 | + "no-duplicate-imports": "error", |
| 62 | + "no-else-return": "warn", |
| 63 | + "no-empty-character-class": "warn", |
| 64 | + "no-empty-function": "error", |
| 65 | + "no-empty-pattern": "error", |
| 66 | + "no-empty": "warn", |
| 67 | + "no-eq-null": "error", |
| 68 | + "no-eval": "error", |
| 69 | + "no-ex-assign": "error", |
| 70 | + "no-extend-native": "warn", |
| 71 | + "no-extra-bind": "warn", |
| 72 | + "no-extra-boolean-cast": "warn", |
| 73 | + "no-extra-label": "warn", |
| 74 | + "no-fallthrough": "warn", |
| 75 | + "no-func-assign": "error", |
| 76 | + "no-global-assign": "error", |
| 77 | + "no-implicit-coercion": ["warn", { |
| 78 | + allow: ["~"], |
| 79 | + }], |
| 80 | + "no-implicit-globals": "warn", |
| 81 | + "no-implied-eval": "warn", |
| 82 | + "no-inline-comments": "warn", |
| 83 | + "no-inner-declarations": "warn", |
| 84 | + "no-invalid-regexp": "warn", |
| 85 | + "no-irregular-whitespace": "warn", |
| 86 | + "no-iterator": "warn", |
| 87 | + "no-label-var": "warn", |
| 88 | + "no-labels": "warn", |
| 89 | + "no-lone-blocks": "warn", |
| 90 | + "no-lonely-if": "error", |
| 91 | + "no-mixed-requires": "error", |
| 92 | + "no-multi-str": "warn", |
| 93 | + "no-native-reassign": "error", |
| 94 | + "no-negated-condition": "warn", |
| 95 | + "no-negated-in-lhs": "error", |
| 96 | + "no-new-func": "warn", |
| 97 | + "no-new-object": "warn", |
| 98 | + "no-new-require": "warn", |
| 99 | + "no-new-symbol": "warn", |
| 100 | + "no-new-wrappers": "warn", |
| 101 | + "no-new": "warn", |
| 102 | + "no-obj-calls": "warn", |
| 103 | + "no-octal-escape": "warn", |
| 104 | + "no-octal": "warn", |
| 105 | + "no-param-reassign": "warn", |
| 106 | + "no-path-concat": "warn", |
| 107 | + "no-process-env": "warn", |
| 108 | + "no-process-exit": "warn", |
| 109 | + "no-proto": "warn", |
| 110 | + "no-prototype-builtins": "warn", |
| 111 | + "no-redeclare": "warn", |
| 112 | + "no-regex-spaces": "warn", |
| 113 | + "no-restricted-globals": "warn", |
| 114 | + "no-restricted-imports": "warn", |
| 115 | + "no-restricted-modules": "warn", |
| 116 | + "no-restricted-syntax": "warn", |
| 117 | + "no-return-assign": "error", |
| 118 | + "no-script-url": "warn", |
| 119 | + "no-self-assign": "warn", |
| 120 | + "no-self-compare": "warn", |
| 121 | + "no-sequences": "warn", |
| 122 | + "no-shadow-restricted-names": "warn", |
| 123 | + "no-shadow": "warn", |
| 124 | + "no-sparse-arrays": "warn", |
| 125 | + "no-sync": "warn", |
| 126 | + "no-this-before-super": "warn", |
| 127 | + "no-throw-literal": "warn", |
| 128 | + "no-undef-init": "warn", |
| 129 | + "no-undef": "error", |
| 130 | + "no-unmodified-loop-condition": "warn", |
| 131 | + "no-unneeded-ternary": "error", |
| 132 | + "no-unreachable": "error", |
| 133 | + "no-unsafe-finally": "error", |
| 134 | + "no-unused-expressions": "error", |
| 135 | + "no-unused-labels": "error", |
| 136 | + "no-unused-vars": "error", |
| 137 | + "no-use-before-define": "error", |
| 138 | + "no-useless-call": "warn", |
| 139 | + "no-useless-computed-key": "warn", |
| 140 | + "no-useless-concat": "warn", |
| 141 | + "no-useless-constructor": "warn", |
| 142 | + "no-useless-escape": "warn", |
| 143 | + "no-useless-rename": "warn", |
| 144 | + "no-void": "warn", |
| 145 | + "no-with": "warn", |
| 146 | + "operator-assignment": ["error", "always"], |
| 147 | + "prefer-const": "warn", |
| 148 | + radix: "warn", |
| 149 | + "require-yield": "warn", |
| 150 | + "sort-imports": "warn", |
| 151 | + "spaced-comment": ["error", "always"], |
| 152 | + strict: ["error", "function"], |
| 153 | + "use-isnan": "error", |
| 154 | + |
| 155 | + "jsdoc/check-tag-names": "warn", |
| 156 | + "jsdoc/check-types": "warn", |
| 157 | + "jsdoc/require-param-description": "off", |
| 158 | + "jsdoc/require-return": "off", |
| 159 | + "jsdoc/require-return-description": "off", |
| 160 | + "jsdoc/require-return-type": "off", |
| 161 | + |
| 162 | + "valid-typeof": "warn", |
| 163 | + yoda: "warn", |
| 164 | + }, |
| 165 | + |
| 166 | + settings: { |
| 167 | + jsdoc: { |
| 168 | + tagNamePreference: { |
| 169 | + arg: "param", |
| 170 | + argument: "param", |
| 171 | + augments: "extends", |
| 172 | + constructor: "class", |
| 173 | + exception: "throws", |
| 174 | + func: "function", |
| 175 | + method: "function", |
| 176 | + prop: "property", |
| 177 | + return: "returns", |
| 178 | + virtual: "abstract", |
| 179 | + yield: "yields", |
| 180 | + }, |
| 181 | + preferredTypes: { |
| 182 | + array: "Array", |
| 183 | + bool: "Boolean", |
| 184 | + boolean: "Boolean", |
| 185 | + number: "Number", |
| 186 | + object: "Object", |
| 187 | + str: "String", |
| 188 | + string: "String", |
| 189 | + }, |
| 190 | + }, |
| 191 | + }, |
| 192 | + |
| 193 | +}, { |
| 194 | + files: ["**/*.esm.js"], |
| 195 | + |
| 196 | + languageOptions: { |
| 197 | + ecmaVersion: 2024, |
| 198 | + sourceType: "module", |
| 199 | + }, |
| 200 | +}]; |
| 201 | + |
| 202 | +module.exports = config |
0 commit comments