.eslintrc.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/naming-convention': [
  26. 'error',
  27. {
  28. selector: 'interface',
  29. format: ['PascalCase'],
  30. custom: {
  31. regex: '^I[A-Z]',
  32. match: true
  33. }
  34. }
  35. ],
  36. '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
  37. '@typescript-eslint/no-use-before-define': 'off',
  38. '@typescript-eslint/camelcase': 'off',
  39. '@typescript-eslint/no-explicit-any': 'off',
  40. '@typescript-eslint/no-non-null-assertion': 'off',
  41. '@typescript-eslint/no-namespace': 'off',
  42. '@typescript-eslint/interface-name-prefix': 'off',
  43. '@typescript-eslint/explicit-function-return-type': 'off',
  44. '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
  45. '@typescript-eslint/ban-types': 'warn',
  46. '@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
  47. '@typescript-eslint/no-var-requires': 'off',
  48. '@typescript-eslint/no-empty-interface': 'off',
  49. '@typescript-eslint/triple-slash-reference': 'warn',
  50. '@typescript-eslint/no-inferrable-types': 'off',
  51. 'jest/no-conditional-expect': 'warn',
  52. 'jest/valid-title': 'warn',
  53. 'no-inner-declarations': 'off',
  54. 'no-prototype-builtins': 'off',
  55. 'no-control-regex': 'warn',
  56. 'no-undef': 'warn',
  57. 'no-case-declarations': 'warn',
  58. 'no-useless-escape': 'off',
  59. 'prefer-const': 'off',
  60. 'react/prop-types': 'warn'
  61. },
  62. settings: {
  63. react: {
  64. version: 'detect'
  65. }
  66. }
  67. };