.eslintrc.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es6: true,
  5. commonjs: true,
  6. node: true,
  7. 'jest/globals': true
  8. },
  9. root: true,
  10. extends: [
  11. 'eslint:recommended',
  12. 'plugin:@typescript-eslint/eslint-recommended',
  13. 'plugin:@typescript-eslint/recommended',
  14. 'prettier/@typescript-eslint',
  15. 'plugin:react/recommended',
  16. 'plugin:jest/recommended'
  17. ],
  18. parser: '@typescript-eslint/parser',
  19. parserOptions: {
  20. project: 'tsconfig.eslint.json'
  21. },
  22. plugins: ['@typescript-eslint', 'jest'],
  23. rules: {
  24. '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
  25. '@typescript-eslint/interface-name-prefix': [
  26. 'error',
  27. { prefixWithI: 'always' }
  28. ],
  29. '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
  30. '@typescript-eslint/no-use-before-define': 'off',
  31. '@typescript-eslint/camelcase': 'off',
  32. '@typescript-eslint/no-explicit-any': 'off',
  33. '@typescript-eslint/no-non-null-assertion': 'off',
  34. '@typescript-eslint/no-namespace': 'off',
  35. '@typescript-eslint/explicit-function-return-type': 'off',
  36. '@typescript-eslint/ban-ts-ignore': 'warn',
  37. '@typescript-eslint/no-var-requires': 'off',
  38. '@typescript-eslint/no-empty-interface': 'off',
  39. '@typescript-eslint/triple-slash-reference': 'warn',
  40. '@typescript-eslint/no-inferrable-types': 'off',
  41. 'no-inner-declarations': 'off',
  42. 'no-prototype-builtins': 'off',
  43. 'no-control-regex': 'warn',
  44. 'no-undef': 'warn',
  45. 'no-case-declarations': 'warn',
  46. 'no-useless-escape': 'off',
  47. 'prefer-const': 'off',
  48. 'jest/no-jest-import': 'off',
  49. 'jest/no-export': 'warn',
  50. 'jest/no-try-expect': 'warn',
  51. 'jest/expect-expect': 'off'
  52. },
  53. settings: {
  54. react: {
  55. version: 'detect'
  56. }
  57. }
  58. };