.eslintrc.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. node: true,
  5. es6: true,
  6. jest: true,
  7. 'cypress/globals': true,
  8. },
  9. parser: '@typescript-eslint/parser',
  10. extends: [
  11. 'eslint:recommended',
  12. 'plugin:@typescript-eslint/recommended',
  13. 'plugin:react/recommended',
  14. 'plugin:react-hooks/recommended',
  15. // turns off the rules which may conflict with prettier
  16. 'prettier',
  17. 'plugin:cypress/recommended',
  18. ],
  19. plugins: ['@emotion', '@typescript-eslint', 'cypress'],
  20. settings: {
  21. react: {
  22. version: 'detect',
  23. },
  24. },
  25. rules: {
  26. // taken care of by typescript
  27. 'react/prop-types': 'off',
  28. // disable explicit return types
  29. '@typescript-eslint/explicit-module-boundary-types': 'off',
  30. // allow "_" prefixed function arguments
  31. '@typescript-eslint/no-unused-vars': [
  32. 'warn',
  33. { 'args': 'after-used', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true },
  34. ],
  35. '@typescript-eslint/no-empty-function': 'warn',
  36. '@typescript-eslint/class-name-casing': 'off',
  37. '@typescript-eslint/ban-ts-comment': [
  38. 'error',
  39. {
  40. 'ts-ignore': 'allow-with-description',
  41. },
  42. ],
  43. '@typescript-eslint/ban-types': [
  44. 'error',
  45. {
  46. types: {
  47. object: false,
  48. },
  49. },
  50. ],
  51. // force using Logger object
  52. 'no-console': ['warn'],
  53. // sort import member order
  54. // can be removed once https://github.com/trivago/prettier-plugin-sort-imports/pull/44 gets released
  55. 'sort-imports': [
  56. 'warn',
  57. {
  58. 'ignoreDeclarationSort': true,
  59. },
  60. ],
  61. // make sure we use the proper Emotion imports
  62. '@emotion/pkg-renaming': 'error',
  63. '@emotion/no-vanilla': 'error',
  64. '@emotion/syntax-preference': [2, 'string'],
  65. },
  66. }