1
0

.eslintrc.cjs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // eslint-disable-next-line no-undef
  2. module.exports = {
  3. env: {
  4. browser: true,
  5. es6: true,
  6. },
  7. ignorePatterns: ["*.map", "dist/**", "test.(ts|js)"],
  8. extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
  9. globals: {
  10. Atomics: "readonly",
  11. SharedArrayBuffer: "readonly",
  12. GM: "readonly",
  13. unsafeWindow: "writable",
  14. },
  15. parser: "@typescript-eslint/parser",
  16. parserOptions: {
  17. ecmaVersion: "latest",
  18. },
  19. plugins: ["@typescript-eslint"],
  20. rules: {
  21. "no-unreachable": "off",
  22. quotes: ["error", "double"],
  23. semi: ["error", "always"],
  24. "eol-last": ["error", "always"],
  25. "no-async-promise-executor": "off",
  26. indent: [
  27. "error",
  28. 2,
  29. {
  30. ignoredNodes: ["VariableDeclaration[declarations.length=0]"],
  31. },
  32. ],
  33. "@typescript-eslint/no-non-null-assertion": "off",
  34. "@typescript-eslint/no-unused-vars": [
  35. "warn",
  36. {
  37. ignoreRestSiblings: true,
  38. argsIgnorePattern: "^_",
  39. },
  40. ],
  41. "@typescript-eslint/ban-ts-comment": "off",
  42. "@typescript-eslint/ban-types": [
  43. "error",
  44. {
  45. types: {
  46. "{}": false,
  47. },
  48. extendDefaults: true,
  49. },
  50. ],
  51. "@typescript-eslint/explicit-function-return-type": [
  52. "error",
  53. {
  54. allowConciseArrowFunctionExpressionsStartingWithVoid: true,
  55. allowExpressions: true,
  56. allowFunctionsWithoutTypeParameters: true,
  57. allowIIFEs: true,
  58. }
  59. ],
  60. "comma-dangle": ["error", "only-multiline"],
  61. "no-misleading-character-class": "off",
  62. },
  63. };