.eslintrc.cjs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module.exports = {
  2. // https://eslint.org/docs/latest/use/configure/configuration-files
  3. env: {
  4. browser: true,
  5. es6: true,
  6. node: true,
  7. },
  8. extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
  9. parser: '@typescript-eslint/parser',
  10. parserOptions: {
  11. project: 'tsconfig.json',
  12. sourceType: 'module',
  13. tsconfigRootDir: __dirname,
  14. },
  15. plugins: ['@typescript-eslint'],
  16. rules: {
  17. '@typescript-eslint/adjacent-overload-signatures': 'error',
  18. '@typescript-eslint/no-empty-function': 'error',
  19. '@typescript-eslint/no-empty-interface': 'warn',
  20. '@typescript-eslint/no-floating-promises': 'warn',
  21. '@typescript-eslint/await-thenable': 'error',
  22. '@typescript-eslint/no-namespace': 'error',
  23. '@typescript-eslint/no-unnecessary-type-assertion': 'error',
  24. '@typescript-eslint/prefer-for-of': 'warn',
  25. '@typescript-eslint/triple-slash-reference': 'error',
  26. '@typescript-eslint/unified-signatures': 'warn',
  27. 'no-shadow': 'off',
  28. '@typescript-eslint/no-shadow': 'warn',
  29. 'constructor-super': 'error',
  30. eqeqeq: ['error', 'always'],
  31. 'no-cond-assign': 'error',
  32. 'no-duplicate-case': 'error',
  33. 'no-duplicate-imports': 'error',
  34. 'no-empty': [
  35. 'error',
  36. {
  37. allowEmptyCatch: true,
  38. },
  39. ],
  40. 'no-invalid-this': 'error',
  41. 'no-new-wrappers': 'error',
  42. 'no-param-reassign': 'error',
  43. 'no-redeclare': 'error',
  44. 'no-sequences': 'error',
  45. 'no-throw-literal': 'error',
  46. 'no-unsafe-finally': 'error',
  47. 'no-unused-labels': 'error',
  48. 'no-var': 'warn',
  49. 'no-void': 'off',
  50. 'prefer-const': 'warn',
  51. 'prefer-spread': 'off',
  52. },
  53. ignorePatterns: ['src/**/*.test.ts'],
  54. };