.eslintrc.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-empty-interface': 'off',
  34. '@typescript-eslint/no-namespace': 'off',
  35. '@typescript-eslint/no-use-before-define': 'off',
  36. '@typescript-eslint/quotes': [
  37. 'error',
  38. 'single',
  39. { avoidEscape: true, allowTemplateLiterals: false }
  40. ],
  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. 'jsdoc/require-jsdoc': [
  52. 1,
  53. {
  54. require: {
  55. FunctionExpression: true,
  56. ClassDeclaration: true,
  57. MethodDefinition: true
  58. }
  59. }
  60. ],
  61. 'jsdoc/require-description': 1,
  62. 'jsdoc/require-param-type': 'off',
  63. 'jsdoc/require-property-type': 'off',
  64. 'jsdoc/require-returns-type': 'off',
  65. 'jsdoc/require-returns': 'off'
  66. },
  67. settings: {
  68. jsdoc: {
  69. mode: 'typescript'
  70. },
  71. react: {
  72. version: 'detect'
  73. }
  74. }
  75. };