.eslintrc.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. MethodDefinition: true
  57. }
  58. }
  59. ],
  60. 'jsdoc/require-description': 1,
  61. 'jsdoc/require-param-type': 'off',
  62. 'jsdoc/require-property-type': 'off',
  63. 'jsdoc/require-returns-type': 'off',
  64. 'jsdoc/require-returns': 'off'
  65. },
  66. settings: {
  67. jsdoc: {
  68. mode: 'typescript'
  69. },
  70. react: {
  71. version: 'detect'
  72. }
  73. }
  74. };