.eslintrc.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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:jsdoc/recommended',
  16. 'plugin:react/recommended',
  17. 'plugin:jest/recommended'
  18. ],
  19. parser: '@typescript-eslint/parser',
  20. parserOptions: {
  21. project: 'tsconfig.eslint.json'
  22. },
  23. plugins: ['@typescript-eslint', 'jest'],
  24. rules: {
  25. '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
  26. '@typescript-eslint/interface-name-prefix': [
  27. 'error',
  28. { prefixWithI: 'always' }
  29. ],
  30. '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
  31. '@typescript-eslint/no-var-requires': 'off',
  32. '@typescript-eslint/no-explicit-any': 'off',
  33. '@typescript-eslint/no-namespace': 'off',
  34. '@typescript-eslint/no-use-before-define': 'off',
  35. '@typescript-eslint/quotes': [
  36. 'error',
  37. 'single',
  38. { avoidEscape: true, allowTemplateLiterals: false }
  39. ],
  40. 'no-inner-declarations': 'off',
  41. 'no-prototype-builtins': 'off',
  42. 'no-control-regex': 'warn',
  43. 'no-undef': 'warn',
  44. 'no-case-declarations': 'warn',
  45. 'no-useless-escape': 'off',
  46. 'prefer-const': 'off',
  47. 'jest/no-jest-import': 'off',
  48. 'jest/no-export': 'warn',
  49. 'jest/no-try-expect': 'warn',
  50. 'jsdoc/require-jsdoc': [
  51. 1,
  52. {
  53. require: {
  54. FunctionExpression: true,
  55. ClassDeclaration: true
  56. }
  57. }
  58. ],
  59. 'jsdoc/require-param-type': 'off',
  60. 'jsdoc/require-property-type': 'off',
  61. 'jsdoc/require-returns-type': 'off',
  62. 'jsdoc/require-returns': 'off'
  63. },
  64. settings: {
  65. react: {
  66. version: 'detect'
  67. }
  68. }
  69. };