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 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. root: true
  2. reportUnusedDisableDirectives: true
  3. ignorePatterns:
  4. - /web_src/js/vendor
  5. parserOptions:
  6. sourceType: module
  7. ecmaVersion: 2021
  8. plugins:
  9. - eslint-plugin-unicorn
  10. - eslint-plugin-import
  11. - eslint-plugin-vue
  12. - eslint-plugin-html
  13. - eslint-plugin-github
  14. extends:
  15. - plugin:vue/recommended
  16. env:
  17. es2021: true
  18. node: true
  19. globals:
  20. __webpack_public_path__: true
  21. CodeMirror: false
  22. Dropzone: false
  23. SimpleMDE: false
  24. u2fApi: false
  25. settings:
  26. html/html-extensions: [".tmpl"]
  27. overrides:
  28. - files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
  29. env:
  30. browser: true
  31. jquery: true
  32. node: false
  33. - files: ["templates/**/*.tmpl"]
  34. rules:
  35. no-tabs: [0]
  36. indent: [2, tab, {SwitchCase: 1}]
  37. - files: ["web_src/**/*worker.js"]
  38. env:
  39. worker: true
  40. rules:
  41. 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]
  42. - files: ["build/generate-images.js"]
  43. rules:
  44. import/no-unresolved: [0]
  45. import/no-extraneous-dependencies: [0]
  46. - files: ["*.test.js"]
  47. env:
  48. jest: true
  49. - files: ["*.config.js"]
  50. rules:
  51. import/no-unused-modules: [0]
  52. rules:
  53. accessor-pairs: [2]
  54. array-bracket-newline: [0]
  55. array-bracket-spacing: [2, never]
  56. array-callback-return: [0]
  57. array-element-newline: [0]
  58. arrow-body-style: [0]
  59. arrow-parens: [2, always]
  60. arrow-spacing: [2, {before: true, after: true}]
  61. block-scoped-var: [2]
  62. brace-style: [2, 1tbs, {allowSingleLine: true}]
  63. camelcase: [0]
  64. capitalized-comments: [0]
  65. class-methods-use-this: [0]
  66. comma-dangle: [2, only-multiline]
  67. comma-spacing: [2, {before: false, after: true}]
  68. comma-style: [2, last]
  69. complexity: [0]
  70. computed-property-spacing: [2, never]
  71. consistent-return: [0]
  72. consistent-this: [0]
  73. constructor-super: [2]
  74. curly: [0]
  75. default-case-last: [2]
  76. default-case: [0]
  77. default-param-last: [0]
  78. dot-location: [2, property]
  79. dot-notation: [0]
  80. eol-last: [2]
  81. eqeqeq: [2]
  82. for-direction: [2]
  83. func-call-spacing: [2, never]
  84. func-name-matching: [2]
  85. func-names: [0]
  86. func-style: [0]
  87. function-call-argument-newline: [0]
  88. function-paren-newline: [0]
  89. generator-star-spacing: [0]
  90. getter-return: [2]
  91. github/array-foreach: [2]
  92. github/async-currenttarget: [2]
  93. github/async-preventdefault: [2]
  94. github/authenticity-token: [0]
  95. github/get-attribute: [2]
  96. github/js-class-name: [0]
  97. github/no-blur: [0]
  98. github/no-d-none: [0]
  99. github/no-dataset: [2]
  100. github/no-implicit-buggy-globals: [0]
  101. github/no-inner-html: [0]
  102. github/no-innerText: [2]
  103. github/no-then: [2]
  104. github/no-useless-passive: [2]
  105. github/prefer-observers: [0]
  106. github/require-passive-events: [2]
  107. github/unescaped-html-literal: [0]
  108. grouped-accessor-pairs: [2]
  109. guard-for-in: [0]
  110. id-blacklist: [0]
  111. id-length: [0]
  112. id-match: [0]
  113. implicit-arrow-linebreak: [0]
  114. import/default: [0]
  115. import/dynamic-import-chunkname: [0]
  116. import/export: [2]
  117. import/exports-last: [0]
  118. import/extensions: [2, always, {ignorePackages: true}]
  119. import/first: [2]
  120. import/group-exports: [0]
  121. import/max-dependencies: [0]
  122. import/named: [2]
  123. import/namespace: [0]
  124. import/newline-after-import: [0]
  125. import/no-absolute-path: [0]
  126. import/no-amd: [0]
  127. import/no-anonymous-default-export: [0]
  128. import/no-commonjs: [0]
  129. import/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
  130. import/no-default-export: [0]
  131. import/no-deprecated: [0]
  132. import/no-dynamic-require: [0]
  133. import/no-extraneous-dependencies: [2]
  134. import/no-import-module-exports: [0]
  135. import/no-internal-modules: [0]
  136. import/no-mutable-exports: [2]
  137. import/no-named-as-default-member: [0]
  138. import/no-named-as-default: [2]
  139. import/no-named-default: [0]
  140. import/no-named-export: [0]
  141. import/no-namespace: [0]
  142. import/no-nodejs-modules: [0]
  143. import/no-relative-packages: [0]
  144. import/no-relative-parent-imports: [0]
  145. import/no-restricted-paths: [0]
  146. import/no-self-import: [2]
  147. import/no-unassigned-import: [0]
  148. import/no-unresolved: [2, {commonjs: true}]
  149. import/no-unused-modules: [2, {unusedExports: true}]
  150. import/no-useless-path-segments: [2, {commonjs: true}]
  151. import/no-webpack-loader-syntax: [2]
  152. import/order: [0]
  153. import/prefer-default-export: [0]
  154. import/unambiguous: [0]
  155. indent: [2, 2, {SwitchCase: 1}]
  156. init-declarations: [0]
  157. key-spacing: [2]
  158. keyword-spacing: [2]
  159. line-comment-position: [0]
  160. linebreak-style: [2, unix]
  161. lines-around-comment: [0]
  162. lines-between-class-members: [0]
  163. max-classes-per-file: [0]
  164. max-depth: [0]
  165. max-len: [0]
  166. max-lines-per-function: [0]
  167. max-lines: [0]
  168. max-nested-callbacks: [0]
  169. max-params: [0]
  170. max-statements-per-line: [0]
  171. max-statements: [0]
  172. multiline-comment-style: [2, separate-lines]
  173. multiline-ternary: [0]
  174. new-cap: [0]
  175. new-parens: [2]
  176. newline-per-chained-call: [0]
  177. no-alert: [0]
  178. no-array-constructor: [2]
  179. no-async-promise-executor: [2]
  180. no-await-in-loop: [0]
  181. no-bitwise: [0]
  182. no-buffer-constructor: [0]
  183. no-caller: [2]
  184. no-case-declarations: [2]
  185. no-class-assign: [2]
  186. no-compare-neg-zero: [2]
  187. no-cond-assign: [2, except-parens]
  188. no-confusing-arrow: [0]
  189. no-console: [1, {allow: [info, warn, error]}]
  190. no-const-assign: [2]
  191. no-constant-condition: [0]
  192. no-constructor-return: [2]
  193. no-continue: [0]
  194. no-control-regex: [0]
  195. no-debugger: [1]
  196. no-delete-var: [2]
  197. no-div-regex: [0]
  198. no-dupe-args: [2]
  199. no-dupe-class-members: [2]
  200. no-dupe-else-if: [2]
  201. no-dupe-keys: [2]
  202. no-duplicate-case: [2]
  203. no-duplicate-imports: [2]
  204. no-else-return: [2]
  205. no-empty-character-class: [2]
  206. no-empty-function: [0]
  207. no-empty-pattern: [2]
  208. no-empty: [2, {allowEmptyCatch: true}]
  209. no-eq-null: [2]
  210. no-eval: [2]
  211. no-ex-assign: [2]
  212. no-extend-native: [2]
  213. no-extra-bind: [2]
  214. no-extra-boolean-cast: [2]
  215. no-extra-label: [0]
  216. no-extra-parens: [0]
  217. no-extra-semi: [2]
  218. no-fallthrough: [2]
  219. no-floating-decimal: [0]
  220. no-func-assign: [2]
  221. no-global-assign: [2]
  222. no-implicit-coercion: [0]
  223. no-implicit-globals: [0]
  224. no-implied-eval: [2]
  225. no-import-assign: [2]
  226. no-inline-comments: [0]
  227. no-inner-declarations: [2]
  228. no-invalid-regexp: [2]
  229. no-invalid-this: [0]
  230. no-irregular-whitespace: [2]
  231. no-iterator: [2]
  232. no-label-var: [2]
  233. no-labels: [2]
  234. no-lone-blocks: [2]
  235. no-lonely-if: [0]
  236. no-loop-func: [0]
  237. no-loss-of-precision: [2]
  238. no-magic-numbers: [0]
  239. no-misleading-character-class: [2]
  240. no-mixed-operators: [0]
  241. no-mixed-spaces-and-tabs: [2]
  242. no-multi-assign: [0]
  243. no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true}}]
  244. no-multi-str: [2]
  245. no-negated-condition: [0]
  246. no-nested-ternary: [0]
  247. no-new-func: [2]
  248. no-new-object: [2]
  249. no-new-symbol: [2]
  250. no-new-wrappers: [2]
  251. no-new: [0]
  252. no-nonoctal-decimal-escape: [2]
  253. no-obj-calls: [2]
  254. no-octal-escape: [2]
  255. no-octal: [2]
  256. no-param-reassign: [0]
  257. no-plusplus: [0]
  258. no-promise-executor-return: [0]
  259. no-proto: [2]
  260. no-prototype-builtins: [2]
  261. no-redeclare: [2]
  262. no-regex-spaces: [2]
  263. no-restricted-exports: [0]
  264. 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]
  265. no-restricted-imports: [0]
  266. no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement]
  267. no-return-assign: [0]
  268. no-return-await: [0]
  269. no-script-url: [2]
  270. no-self-assign: [2, {props: true}]
  271. no-self-compare: [2]
  272. no-sequences: [2]
  273. no-setter-return: [2]
  274. no-shadow-restricted-names: [2]
  275. no-shadow: [0]
  276. no-sparse-arrays: [2]
  277. no-tabs: [2]
  278. no-template-curly-in-string: [2]
  279. no-ternary: [0]
  280. no-this-before-super: [2]
  281. no-throw-literal: [2]
  282. no-trailing-spaces: [2]
  283. no-undef-init: [2]
  284. no-undef: [2, {typeof: true}]
  285. no-undefined: [0]
  286. no-underscore-dangle: [0]
  287. no-unexpected-multiline: [2]
  288. no-unmodified-loop-condition: [2]
  289. no-unneeded-ternary: [0]
  290. no-unreachable-loop: [2]
  291. no-unreachable: [2]
  292. no-unsafe-finally: [2]
  293. no-unsafe-negation: [2]
  294. no-unused-expressions: [2]
  295. no-unused-labels: [2]
  296. no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, ignoreRestSiblings: false}]
  297. no-use-before-define: [2, nofunc]
  298. no-useless-backreference: [0]
  299. no-useless-call: [2]
  300. no-useless-catch: [2]
  301. no-useless-computed-key: [2]
  302. no-useless-concat: [2]
  303. no-useless-constructor: [2]
  304. no-useless-escape: [2]
  305. no-useless-rename: [2]
  306. no-useless-return: [2]
  307. no-var: [2]
  308. no-void: [2]
  309. no-warning-comments: [0]
  310. no-whitespace-before-property: [2]
  311. no-with: [2]
  312. nonblock-statement-body-position: [2]
  313. object-curly-newline: [0]
  314. object-curly-spacing: [2, never]
  315. object-shorthand: [2, always]
  316. one-var-declaration-per-line: [0]
  317. one-var: [0]
  318. operator-assignment: [2, always]
  319. operator-linebreak: [2, after]
  320. padded-blocks: [2, never]
  321. padding-line-between-statements: [0]
  322. prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}]
  323. prefer-const: [2, {destructuring: all}]
  324. prefer-destructuring: [0]
  325. prefer-exponentiation-operator: [2]
  326. prefer-named-capture-group: [0]
  327. prefer-numeric-literals: [2]
  328. prefer-object-spread: [0]
  329. prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
  330. prefer-regex-literals: [2]
  331. prefer-rest-params: [2]
  332. prefer-spread: [2]
  333. prefer-template: [2]
  334. quote-props: [0]
  335. quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
  336. radix: [2, as-needed]
  337. require-atomic-updates: [0]
  338. require-await: [0]
  339. require-unicode-regexp: [0]
  340. require-yield: [2]
  341. rest-spread-spacing: [2, never]
  342. semi-spacing: [2, {before: false, after: true}]
  343. semi-style: [2, last]
  344. semi: [2, always, {omitLastInOneLineBlock: true}]
  345. sort-imports: [0]
  346. sort-keys: [0]
  347. sort-vars: [0]
  348. space-before-blocks: [2, always]
  349. space-in-parens: [2, never]
  350. space-infix-ops: [2]
  351. space-unary-ops: [2]
  352. spaced-comment: [2, always]
  353. strict: [0]
  354. switch-colon-spacing: [2]
  355. symbol-description: [2]
  356. template-curly-spacing: [2, never]
  357. template-tag-spacing: [2, never]
  358. unicode-bom: [2, never]
  359. unicorn/better-regex: [0]
  360. unicorn/catch-error-name: [0]
  361. unicorn/consistent-destructuring: [2]
  362. unicorn/consistent-function-scoping: [2]
  363. unicorn/custom-error-definition: [0]
  364. unicorn/empty-brace-spaces: [2]
  365. unicorn/error-message: [0]
  366. unicorn/escape-case: [0]
  367. unicorn/expiring-todo-comments: [0]
  368. unicorn/explicit-length-check: [0]
  369. unicorn/filename-case: [0]
  370. unicorn/import-index: [0]
  371. unicorn/import-style: [0]
  372. unicorn/new-for-builtins: [2]
  373. unicorn/no-abusive-eslint-disable: [0]
  374. unicorn/no-array-for-each: [0]
  375. unicorn/no-array-instanceof: [0]
  376. unicorn/no-array-method-this-argument: [2]
  377. unicorn/no-array-push-push: [2]
  378. unicorn/no-console-spaces: [0]
  379. unicorn/no-document-cookie: [2]
  380. unicorn/no-empty-file: [2]
  381. unicorn/no-fn-reference-in-iterator: [0]
  382. unicorn/no-for-loop: [0]
  383. unicorn/no-hex-escape: [0]
  384. unicorn/no-invalid-remove-event-listener: [2]
  385. unicorn/no-keyword-prefix: [0]
  386. unicorn/no-lonely-if: [2]
  387. unicorn/no-nested-ternary: [0]
  388. unicorn/no-new-array: [0]
  389. unicorn/no-new-buffer: [0]
  390. unicorn/no-null: [0]
  391. unicorn/no-object-as-default-parameter: [2]
  392. unicorn/no-process-exit: [0]
  393. unicorn/no-reduce: [2]
  394. unicorn/no-static-only-class: [2]
  395. unicorn/no-this-assignment: [2]
  396. unicorn/no-unreadable-array-destructuring: [0]
  397. unicorn/no-unsafe-regex: [0]
  398. unicorn/no-unused-properties: [2]
  399. unicorn/no-useless-fallback-in-spread: [2]
  400. unicorn/no-useless-length-check: [2]
  401. unicorn/no-useless-spread: [2]
  402. unicorn/no-useless-undefined: [0]
  403. unicorn/no-zero-fractions: [2]
  404. unicorn/number-literal-case: [0]
  405. unicorn/numeric-separators-style: [0]
  406. unicorn/prefer-add-event-listener: [2]
  407. unicorn/prefer-array-find: [2]
  408. unicorn/prefer-array-flat-map: [2]
  409. unicorn/prefer-array-flat: [2]
  410. unicorn/prefer-array-index-of: [2]
  411. unicorn/prefer-array-some: [2]
  412. unicorn/prefer-at: [0]
  413. unicorn/prefer-dataset: [2]
  414. unicorn/prefer-date-now: [2]
  415. unicorn/prefer-default-parameters: [0]
  416. unicorn/prefer-event-key: [2]
  417. unicorn/prefer-export-from: [2]
  418. unicorn/prefer-includes: [2]
  419. unicorn/prefer-math-trunc: [2]
  420. unicorn/prefer-modern-dom-apis: [0]
  421. unicorn/prefer-module: [2]
  422. unicorn/prefer-negative-index: [2]
  423. unicorn/prefer-node-append: [0]
  424. unicorn/prefer-node-protocol: [0]
  425. unicorn/prefer-node-remove: [0]
  426. unicorn/prefer-number-properties: [0]
  427. unicorn/prefer-object-from-entries: [2]
  428. unicorn/prefer-object-has-own: [0]
  429. unicorn/prefer-optional-catch-binding: [2]
  430. unicorn/prefer-prototype-methods: [0]
  431. unicorn/prefer-query-selector: [0]
  432. unicorn/prefer-reflect-apply: [0]
  433. unicorn/prefer-regexp-test: [2]
  434. unicorn/prefer-replace-all: [0]
  435. unicorn/prefer-set-has: [0]
  436. unicorn/prefer-spread: [0]
  437. unicorn/prefer-starts-ends-with: [2]
  438. unicorn/prefer-string-slice: [0]
  439. unicorn/prefer-switch: [0]
  440. unicorn/prefer-ternary: [0]
  441. unicorn/prefer-text-content: [2]
  442. unicorn/prefer-top-level-await: [0]
  443. unicorn/prefer-trim-start-end: [2]
  444. unicorn/prefer-type-error: [0]
  445. unicorn/prevent-abbreviations: [0]
  446. unicorn/require-array-join-separator: [2]
  447. unicorn/require-number-to-fixed-digits-argument: [2]
  448. unicorn/require-post-message-target-origin: [0]
  449. unicorn/string-content: [0]
  450. unicorn/template-indent: [2]
  451. unicorn/throw-new-error: [2]
  452. use-isnan: [2]
  453. valid-typeof: [2, {requireStringLiterals: true}]
  454. vars-on-top: [0]
  455. vue/attributes-order: [0]
  456. vue/component-definition-name-casing: [0]
  457. vue/html-closing-bracket-spacing: [0]
  458. vue/max-attributes-per-line: [0]
  459. vue/one-component-per-file: [0]
  460. wrap-iife: [2, inside]
  461. wrap-regex: [0]
  462. yield-star-spacing: [2, after]
  463. yoda: [2, never]