.eslintrc.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = {
  2. parser: '@typescript-eslint/parser',
  3. parserOptions: {
  4. ecmaVersion: 2022,
  5. sourceType: 'module',
  6. project: './tsconfig.json',
  7. },
  8. plugins: ['@typescript-eslint', 'prettier'],
  9. extends: [
  10. 'eslint:recommended',
  11. '@typescript-eslint/recommended',
  12. '@typescript-eslint/recommended-requiring-type-checking',
  13. 'prettier',
  14. ],
  15. root: true,
  16. env: {
  17. node: true,
  18. jest: true,
  19. },
  20. ignorePatterns: ['.eslintrc.js', 'jest.config.js', 'dist/'],
  21. rules: {
  22. '@typescript-eslint/interface-name-prefix': 'off',
  23. '@typescript-eslint/explicit-function-return-type': 'error',
  24. '@typescript-eslint/explicit-module-boundary-types': 'error',
  25. '@typescript-eslint/no-explicit-any': 'warn',
  26. '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
  27. '@typescript-eslint/prefer-nullish-coalescing': 'error',
  28. '@typescript-eslint/prefer-optional-chain': 'error',
  29. '@typescript-eslint/no-floating-promises': 'error',
  30. '@typescript-eslint/await-thenable': 'error',
  31. 'prettier/prettier': 'error',
  32. 'no-console': ['warn', { allow: ['warn', 'error'] }],
  33. 'prefer-const': 'error',
  34. 'no-var': 'error',
  35. },
  36. };