.eslintrc.js 1.7 KB

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