You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.eslintrc 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. root: true
  2. reportUnusedDisableDirectives: true
  3. ignorePatterns:
  4. - /web_src/js/vendor
  5. parserOptions:
  6. sourceType: module
  7. ecmaVersion: 2020
  8. plugins:
  9. - eslint-plugin-unicorn
  10. - eslint-plugin-import
  11. - eslint-plugin-sonarjs
  12. env:
  13. browser: true
  14. es6: true
  15. jquery: true
  16. node: true
  17. globals:
  18. __webpack_public_path__: true
  19. CodeMirror: false
  20. Dropzone: false
  21. SimpleMDE: false
  22. u2fApi: false
  23. Tribute: false
  24. overrides:
  25. - files: ["web_src/**/*worker.js"]
  26. env:
  27. worker: true
  28. rules:
  29. no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
  30. - files: ["build/generate-images.js"]
  31. rules:
  32. import/no-unresolved: [0]
  33. import/no-extraneous-dependencies: [0]
  34. rules:
  35. accessor-pairs: [2]
  36. array-bracket-newline: [0]
  37. array-bracket-spacing: [2, never]
  38. array-callback-return: [0]
  39. array-element-newline: [0]
  40. arrow-body-style: [0]
  41. arrow-parens: [2, always]
  42. arrow-spacing: [2, {before: true, after: true}]
  43. block-scoped-var: [2]
  44. brace-style: [2, 1tbs, {allowSingleLine: true}]
  45. camelcase: [0]
  46. capitalized-comments: [0]
  47. class-methods-use-this: [0]
  48. comma-dangle: [2, only-multiline]
  49. comma-spacing: [2, {before: false, after: true}]
  50. comma-style: [2, last]
  51. complexity: [0]
  52. computed-property-spacing: [2, never]
  53. consistent-return: [0]
  54. consistent-this: [0]
  55. constructor-super: [2]
  56. curly: [0]
  57. default-case-last: [2]
  58. default-case: [0]
  59. default-param-last: [0]
  60. dot-location: [2, property]
  61. dot-notation: [0]
  62. eol-last: [2]
  63. eqeqeq: [2]
  64. for-direction: [2]
  65. func-call-spacing: [2, never]
  66. func-name-matching: [2]
  67. func-names: [0]
  68. func-style: [0]
  69. function-call-argument-newline: [0]
  70. function-paren-newline: [0]
  71. generator-star-spacing: [0]
  72. getter-return: [2]
  73. grouped-accessor-pairs: [2]
  74. guard-for-in: [0]
  75. id-blacklist: [0]
  76. id-length: [0]
  77. id-match: [0]
  78. implicit-arrow-linebreak: [0]
  79. import/default: [0]
  80. import/dynamic-import-chunkname: [0]
  81. import/export: [2]
  82. import/exports-last: [0]
  83. import/extensions: [2, always, {ignorePackages: true}]
  84. import/first: [2]
  85. import/group-exports: [0]
  86. import/max-dependencies: [0]
  87. import/named: [2]
  88. import/namespace: [0]
  89. import/newline-after-import: [0]
  90. import/no-absolute-path: [0]
  91. import/no-amd: [0]
  92. import/no-anonymous-default-export: [0]
  93. import/no-commonjs: [0]
  94. import/no-cycle: [0]
  95. import/no-default-export: [0]
  96. import/no-deprecated: [0]
  97. import/no-dynamic-require: [0]
  98. import/no-extraneous-dependencies: [2]
  99. import/no-internal-modules: [0]
  100. import/no-mutable-exports: [2]
  101. import/no-named-as-default-member: [0]
  102. import/no-named-as-default: [2]
  103. import/no-named-default: [0]
  104. import/no-named-export: [0]
  105. import/no-namespace: [0]
  106. import/no-nodejs-modules: [0]
  107. import/no-relative-parent-imports: [0]
  108. import/no-restricted-paths: [0]
  109. import/no-self-import: [2]
  110. import/no-unassigned-import: [0]
  111. import/no-unresolved: [2, {commonjs: true}]
  112. import/no-unused-modules: [0]
  113. import/no-useless-path-segments: [2, {commonjs: true}]
  114. import/no-webpack-loader-syntax: [2]
  115. import/order: [0]
  116. import/prefer-default-export: [0]
  117. import/unambiguous: [0]
  118. indent: [2, 2, {SwitchCase: 1}]
  119. init-declarations: [0]
  120. key-spacing: [2]
  121. keyword-spacing: [2]
  122. line-comment-position: [0]
  123. linebreak-style: [2, unix]
  124. lines-around-comment: [0]
  125. lines-between-class-members: [0]
  126. max-classes-per-file: [0]
  127. max-depth: [0]
  128. max-len: [0]
  129. max-lines-per-function: [0]
  130. max-lines: [0]
  131. max-nested-callbacks: [0]
  132. max-params: [0]
  133. max-statements-per-line: [0]
  134. max-statements: [0]
  135. multiline-comment-style: [2, separate-lines]
  136. multiline-ternary: [0]
  137. new-cap: [0]
  138. new-parens: [2]
  139. newline-per-chained-call: [0]
  140. no-alert: [0]
  141. no-array-constructor: [2]
  142. no-async-promise-executor: [2]
  143. no-await-in-loop: [0]
  144. no-bitwise: [0]
  145. no-buffer-constructor: [0]
  146. no-caller: [2]
  147. no-case-declarations: [2]
  148. no-class-assign: [2]
  149. no-compare-neg-zero: [2]
  150. no-cond-assign: [2, except-parens]
  151. no-confusing-arrow: [0]
  152. no-console: [1, {allow: [info, warn, error]}]
  153. no-const-assign: [2]
  154. no-constant-condition: [0]
  155. no-constructor-return: [2]
  156. no-continue: [0]
  157. no-control-regex: [0]
  158. no-debugger: [1]
  159. no-delete-var: [2]
  160. no-div-regex: [0]
  161. no-dupe-args: [2]
  162. no-dupe-class-members: [2]
  163. no-dupe-else-if: [2]
  164. no-dupe-keys: [2]
  165. no-duplicate-case: [2]
  166. no-duplicate-imports: [2]
  167. no-else-return: [2]
  168. no-empty-character-class: [2]
  169. no-empty-function: [0]
  170. no-empty-pattern: [2]
  171. no-empty: [2, {allowEmptyCatch: true}]
  172. no-eq-null: [2]
  173. no-eval: [2]
  174. no-ex-assign: [2]
  175. no-extend-native: [2]
  176. no-extra-bind: [2]
  177. no-extra-boolean-cast: [2]
  178. no-extra-label: [0]
  179. no-extra-parens: [0]
  180. no-extra-semi: [2]
  181. no-fallthrough: [2]
  182. no-floating-decimal: [0]
  183. no-func-assign: [2]
  184. no-global-assign: [2]
  185. no-implicit-coercion: [0]
  186. no-implicit-globals: [0]
  187. no-implied-eval: [2]
  188. no-import-assign: [2]
  189. no-inline-comments: [0]
  190. no-inner-declarations: [2]
  191. no-invalid-regexp: [2]
  192. no-invalid-this: [0]
  193. no-irregular-whitespace: [2]
  194. no-iterator: [2]
  195. no-label-var: [2]
  196. no-labels: [2]
  197. no-lone-blocks: [2]
  198. no-lonely-if: [0]
  199. no-loop-func: [0]
  200. no-loss-of-precision: [2]
  201. no-magic-numbers: [0]
  202. no-misleading-character-class: [2]
  203. no-mixed-operators: [0]
  204. no-mixed-spaces-and-tabs: [2]
  205. no-multi-assign: [0]
  206. no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true, VariableDeclarator: true}}]
  207. no-multi-str: [2]
  208. no-negated-condition: [0]
  209. no-nested-ternary: [0]
  210. no-new-func: [2]
  211. no-new-object: [2]
  212. no-new-symbol: [2]
  213. no-new-wrappers: [2]
  214. no-new: [0]
  215. no-obj-calls: [2]
  216. no-octal-escape: [2]
  217. no-octal: [2]
  218. no-param-reassign: [0]
  219. no-plusplus: [0]
  220. no-promise-executor-return: [0]
  221. no-proto: [2]
  222. no-prototype-builtins: [2]
  223. no-redeclare: [2]
  224. no-regex-spaces: [2]
  225. no-restricted-exports: [0]
  226. no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top]
  227. no-restricted-imports: [0]
  228. no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement]
  229. no-return-assign: [0]
  230. no-return-await: [0]
  231. no-script-url: [2]
  232. no-self-assign: [2, {props: true}]
  233. no-self-compare: [2]
  234. no-sequences: [2]
  235. no-setter-return: [2]
  236. no-shadow-restricted-names: [2]
  237. no-shadow: [0]
  238. no-sparse-arrays: [2]
  239. no-tabs: [2]
  240. no-template-curly-in-string: [2]
  241. no-ternary: [0]
  242. no-this-before-super: [2]
  243. no-throw-literal: [2]
  244. no-trailing-spaces: [2]
  245. no-undef-init: [2]
  246. no-undef: [2, {typeof: true}]
  247. no-undefined: [0]
  248. no-underscore-dangle: [0]
  249. no-unexpected-multiline: [2]
  250. no-unmodified-loop-condition: [2]
  251. no-unneeded-ternary: [0]
  252. no-unreachable-loop: [2]
  253. no-unreachable: [2]
  254. no-unsafe-finally: [2]
  255. no-unsafe-negation: [2]
  256. no-unused-expressions: [2]
  257. no-unused-labels: [2]
  258. no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, ignoreRestSiblings: false}]
  259. no-use-before-define: [2, nofunc]
  260. no-useless-backreference: [0]
  261. no-useless-call: [2]
  262. no-useless-catch: [2]
  263. no-useless-computed-key: [2]
  264. no-useless-concat: [2]
  265. no-useless-constructor: [2]
  266. no-useless-escape: [2]
  267. no-useless-rename: [2]
  268. no-useless-return: [2]
  269. no-var: [2]
  270. no-void: [2]
  271. no-warning-comments: [0]
  272. no-whitespace-before-property: [2]
  273. no-with: [2]
  274. nonblock-statement-body-position: [2]
  275. object-curly-newline: [0]
  276. object-curly-spacing: [2, never]
  277. object-shorthand: [2, always]
  278. one-var-declaration-per-line: [0]
  279. one-var: [0]
  280. operator-assignment: [2, always]
  281. operator-linebreak: [2, after]
  282. padded-blocks: [2, never]
  283. padding-line-between-statements: [0]
  284. prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}]
  285. prefer-const: [2, {destructuring: all}]
  286. prefer-destructuring: [0]
  287. prefer-exponentiation-operator: [2]
  288. prefer-named-capture-group: [0]
  289. prefer-numeric-literals: [2]
  290. prefer-object-spread: [0]
  291. prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
  292. prefer-regex-literals: [2]
  293. prefer-rest-params: [2]
  294. prefer-spread: [2]
  295. prefer-template: [2]
  296. quote-props: [0]
  297. quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
  298. radix: [2, as-needed]
  299. require-atomic-updates: [0]
  300. require-await: [0]
  301. require-unicode-regexp: [0]
  302. require-yield: [2]
  303. rest-spread-spacing: [2, never]
  304. semi-spacing: [2, {before: false, after: true}]
  305. semi-style: [2, last]
  306. semi: [2, always, {omitLastInOneLineBlock: true}]
  307. sonarjs/cognitive-complexity: [0]
  308. sonarjs/max-switch-cases: [0]
  309. sonarjs/no-all-duplicated-branches: [2]
  310. sonarjs/no-collapsible-if: [0]
  311. sonarjs/no-collection-size-mischeck: [2]
  312. sonarjs/no-duplicate-string: [0]
  313. sonarjs/no-duplicated-branches: [0]
  314. sonarjs/no-element-overwrite: [2]
  315. sonarjs/no-extra-arguments: [0]
  316. sonarjs/no-identical-conditions: [2]
  317. sonarjs/no-identical-expressions: [0]
  318. sonarjs/no-identical-functions: [0]
  319. sonarjs/no-inverted-boolean-check: [2]
  320. sonarjs/no-one-iteration-loop: [2]
  321. sonarjs/no-redundant-boolean: [2]
  322. sonarjs/no-redundant-jump: [0]
  323. sonarjs/no-same-line-conditional: [2]
  324. sonarjs/no-small-switch: [0]
  325. sonarjs/no-unused-collection: [2]
  326. sonarjs/no-use-of-empty-return-value: [2]
  327. sonarjs/no-useless-catch: [0]
  328. sonarjs/prefer-immediate-return: [0]
  329. sonarjs/prefer-object-literal: [2]
  330. sonarjs/prefer-single-boolean-return: [0]
  331. sonarjs/prefer-while: [2]
  332. sort-imports: [0]
  333. sort-keys: [0]
  334. sort-vars: [0]
  335. space-before-blocks: [2, always]
  336. space-in-parens: [2, never]
  337. space-infix-ops: [2]
  338. space-unary-ops: [2]
  339. spaced-comment: [2, always]
  340. strict: [0]
  341. switch-colon-spacing: [2]
  342. symbol-description: [2]
  343. template-curly-spacing: [2, never]
  344. template-tag-spacing: [2, never]
  345. unicode-bom: [2, never]
  346. unicorn/better-regex: [0]
  347. unicorn/catch-error-name: [0]
  348. unicorn/consistent-function-scoping: [2]
  349. unicorn/custom-error-definition: [0]
  350. unicorn/error-message: [0]
  351. unicorn/escape-case: [0]
  352. unicorn/expiring-todo-comments: [0]
  353. unicorn/explicit-length-check: [0]
  354. unicorn/filename-case: [0]
  355. unicorn/import-index: [0]
  356. unicorn/new-for-builtins: [2]
  357. unicorn/no-abusive-eslint-disable: [0]
  358. unicorn/no-array-instanceof: [0]
  359. unicorn/no-console-spaces: [0]
  360. unicorn/no-fn-reference-in-iterator: [0]
  361. unicorn/no-for-loop: [0]
  362. unicorn/no-hex-escape: [0]
  363. unicorn/no-keyword-prefix: [0]
  364. unicorn/no-nested-ternary: [0]
  365. unicorn/no-new-buffer: [0]
  366. unicorn/no-null: [0]
  367. unicorn/no-process-exit: [0]
  368. unicorn/no-reduce: [2]
  369. unicorn/no-unreadable-array-destructuring: [0]
  370. unicorn/no-unsafe-regex: [0]
  371. unicorn/no-unused-properties: [2]
  372. unicorn/no-useless-undefined: [0]
  373. unicorn/no-zero-fractions: [2]
  374. unicorn/number-literal-case: [0]
  375. unicorn/prefer-add-event-listener: [2]
  376. unicorn/prefer-dataset: [2]
  377. unicorn/prefer-event-key: [2]
  378. unicorn/prefer-includes: [2]
  379. unicorn/prefer-modern-dom-apis: [0]
  380. unicorn/prefer-negative-index: [2]
  381. unicorn/prefer-node-append: [0]
  382. unicorn/prefer-node-remove: [0]
  383. unicorn/prefer-number-properties: [0]
  384. unicorn/prefer-optional-catch-binding: [2]
  385. unicorn/prefer-query-selector: [0]
  386. unicorn/prefer-reflect-apply: [0]
  387. unicorn/prefer-replace-all: [0]
  388. unicorn/prefer-set-has: [0]
  389. unicorn/prefer-spread: [0]
  390. unicorn/prefer-starts-ends-with: [2]
  391. unicorn/prefer-string-slice: [0]
  392. unicorn/prefer-text-content: [2]
  393. unicorn/prefer-trim-start-end: [2]
  394. unicorn/prefer-type-error: [0]
  395. unicorn/prevent-abbreviations: [0]
  396. unicorn/string-content: [0]
  397. unicorn/throw-new-error: [2]
  398. use-isnan: [2]
  399. valid-typeof: [2, {requireStringLiterals: true}]
  400. vars-on-top: [0]
  401. wrap-iife: [2, inside]
  402. wrap-regex: [0]
  403. yield-star-spacing: [2, after]
  404. yoda: [2, never]