Rapid spam filtering system https://rspamd.com/
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.

94 lines
3.6 KiB

  1. import globals from "globals";
  2. import js from "@eslint/js";
  3. import stylistic from "@stylistic/eslint-plugin";
  4. export default [
  5. js.configs.all,
  6. stylistic.configs["all-flat"],
  7. {ignores: ["interface/js/lib/"]},
  8. {
  9. languageOptions: {
  10. ecmaVersion: 2016,
  11. globals: {
  12. ...globals.browser,
  13. define: false,
  14. },
  15. parserOptions: {
  16. ecmaVersion: 2020,
  17. },
  18. sourceType: "script",
  19. },
  20. plugins: {
  21. "@stylistic": stylistic,
  22. },
  23. rules: {
  24. "@stylistic/array-bracket-newline": ["error", "consistent"],
  25. "@stylistic/array-element-newline": "off",
  26. "@stylistic/brace-style": ["error", "1tbs", {allowSingleLine: true}],
  27. "@stylistic/comma-dangle": ["error", "only-multiline"],
  28. "@stylistic/dot-location": ["error", "property"],
  29. "@stylistic/function-call-argument-newline": "off",
  30. "@stylistic/function-paren-newline": "off",
  31. "@stylistic/indent-binary-ops": "off",
  32. "@stylistic/max-len": ["error", {code: 128}],
  33. "@stylistic/max-statements-per-line": ["error", {max: 2}],
  34. "@stylistic/multiline-comment-style": "off",
  35. "@stylistic/multiline-ternary": ["error", "always-multiline"],
  36. "@stylistic/newline-per-chained-call": ["error", {ignoreChainWithDepth: 5}],
  37. "@stylistic/no-extra-parens": ["error", "functions"],
  38. "@stylistic/object-property-newline": ["error", {allowAllPropertiesOnSameLine: true}],
  39. "@stylistic/padded-blocks": ["error", "never"],
  40. "@stylistic/quote-props": ["error", "consistent-as-needed"],
  41. "@stylistic/quotes": ["error", "double", {avoidEscape: true}],
  42. "@stylistic/semi": ["error", "always"],
  43. "@stylistic/space-before-function-paren": ["error", {
  44. anonymous: "always",
  45. named: "never",
  46. }],
  47. "camelcase": "off",
  48. "capitalized-comments": "off",
  49. "curly": ["error", "multi-line"],
  50. "func-names": "off",
  51. "func-style": ["error", "declaration"],
  52. "id-length": ["error", {min: 1}],
  53. "line-comment-position": "off",
  54. "logical-assignment-operators": ["error", "never"],
  55. "max-lines": "off",
  56. "max-lines-per-function": "off",
  57. "max-params": ["warn", 6],
  58. "max-statements": ["warn", 55],
  59. "multiline-comment-style": "off",
  60. "no-continue": "off",
  61. "no-inline-comments": "off",
  62. "no-invalid-this": "off",
  63. "no-magic-numbers": "off",
  64. "no-negated-condition": "off",
  65. "no-plusplus": "off",
  66. "no-ternary": "off",
  67. "no-unused-vars": ["error", {caughtErrors: "none"}],
  68. "object-shorthand": "off",
  69. "one-var": ["error", {initialized: "never"}],
  70. "prefer-named-capture-group": "off",
  71. "prefer-object-has-own": "off",
  72. "prefer-spread": "off",
  73. "prefer-template": "off",
  74. "require-unicode-regexp": "off",
  75. "sort-keys": "off",
  76. },
  77. },
  78. {
  79. files: ["**/*.mjs"],
  80. languageOptions: {ecmaVersion: 2020, sourceType: "module"},
  81. rules: {
  82. "sort-keys": "error",
  83. },
  84. },
  85. {
  86. // Playwright E2E tests
  87. files: ["test/playwright/tests/*.mjs"],
  88. rules: {
  89. "no-await-in-loop": "off", // Playwright operations in loops are often sequential and not independent
  90. },
  91. },
  92. ];