.eslintrc.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. 'no-inner-declarations': 'off',
  52. 'no-prototype-builtins': 'off',
  53. 'no-control-regex': 'warn',
  54. 'no-undef': 'warn',
  55. 'no-case-declarations': 'warn',
  56. 'no-useless-escape': 'off',
  57. 'prefer-const': 'off',
  58. 'react/prop-types': 'warn'
  59. },
  60. settings: {
  61. react: {
  62. version: 'detect'
  63. }
  64. }
  65. };