.eslintrc.cjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. { ignoredNodes: ["VariableDeclaration[declarations.length=0]"] },
  30. ],
  31. "@typescript-eslint/no-non-null-assertion": "off",
  32. "@typescript-eslint/no-unused-vars": [
  33. "warn",
  34. { ignoreRestSiblings: true, argsIgnorePattern: "^_" },
  35. ],
  36. "@typescript-eslint/ban-ts-comment": "off",
  37. "@typescript-eslint/ban-types": [
  38. "error",
  39. {
  40. types: {
  41. "{}": false,
  42. },
  43. extendDefaults: true,
  44. },
  45. ],
  46. "@typescript-eslint/explicit-function-return-type": "error",
  47. "comma-dangle": ["error", "only-multiline"],
  48. "no-misleading-character-class": "off",
  49. },
  50. };