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.

84 lines
3.3 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. sourceType: "script",
  16. },
  17. plugins: {
  18. "@stylistic": stylistic,
  19. },
  20. rules: {
  21. "@stylistic/array-bracket-newline": ["error", "consistent"],
  22. "@stylistic/array-element-newline": "off",
  23. "@stylistic/brace-style": ["error", "1tbs", {allowSingleLine: true}],
  24. "@stylistic/comma-dangle": ["error", "only-multiline"],
  25. "@stylistic/dot-location": ["error", "property"],
  26. "@stylistic/function-call-argument-newline": "off",
  27. "@stylistic/function-paren-newline": "off",
  28. "@stylistic/indent-binary-ops": "off",
  29. "@stylistic/max-len": ["error", {code: 128}],
  30. "@stylistic/max-statements-per-line": ["error", {max: 2}],
  31. "@stylistic/multiline-comment-style": "off",
  32. "@stylistic/multiline-ternary": ["error", "always-multiline"],
  33. "@stylistic/newline-per-chained-call": ["error", {ignoreChainWithDepth: 5}],
  34. "@stylistic/no-extra-parens": ["error", "functions"],
  35. "@stylistic/object-property-newline": ["error", {allowAllPropertiesOnSameLine: true}],
  36. "@stylistic/padded-blocks": ["error", "never"],
  37. "@stylistic/quote-props": ["error", "consistent-as-needed"],
  38. "@stylistic/quotes": ["error", "double", {avoidEscape: true}],
  39. "@stylistic/semi": ["error", "always"],
  40. "@stylistic/space-before-function-paren": ["error", {
  41. anonymous: "always",
  42. named: "never",
  43. }],
  44. "camelcase": "off",
  45. "capitalized-comments": "off",
  46. "curly": ["error", "multi-line"],
  47. "func-names": "off",
  48. "func-style": ["error", "declaration"],
  49. "id-length": ["error", {min: 1}],
  50. "line-comment-position": "off",
  51. "logical-assignment-operators": ["error", "never"],
  52. "max-lines": "off",
  53. "max-lines-per-function": "off",
  54. "max-params": ["warn", 6],
  55. "max-statements": ["warn", 55],
  56. "multiline-comment-style": "off",
  57. "no-continue": "off",
  58. "no-inline-comments": "off",
  59. "no-invalid-this": "off",
  60. "no-magic-numbers": "off",
  61. "no-negated-condition": "off",
  62. "no-plusplus": "off",
  63. "no-ternary": "off",
  64. "no-unused-vars": ["error", {caughtErrors: "none"}],
  65. "object-shorthand": "off",
  66. "one-var": ["error", {initialized: "never"}],
  67. "prefer-named-capture-group": "off",
  68. "prefer-object-has-own": "off",
  69. "prefer-spread": "off",
  70. "prefer-template": "off",
  71. "require-unicode-regexp": "off",
  72. "sort-keys": "off",
  73. },
  74. },
  75. {
  76. files: ["**/*.mjs"],
  77. languageOptions: {ecmaVersion: 2020, sourceType: "module"},
  78. rules: {
  79. "sort-keys": "error",
  80. },
  81. },
  82. ];