.eslintrc.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* eslint-env node */
  2. module.exports = {
  3. root: true,
  4. extends: ['sentry-app/strict'],
  5. globals: {
  6. expect: false,
  7. jest: true,
  8. MockApiClient: true,
  9. require: false,
  10. tick: true,
  11. },
  12. rules: {
  13. 'react-hooks/exhaustive-deps': [
  14. 'error',
  15. {additionalHooks: '(useEffectAfterFirstRender|useMemoWithPrevious)'},
  16. ],
  17. // TODO(@anonrig): Remove this from eslint-sentry-config
  18. 'space-infix-ops': 'off',
  19. 'object-shorthand': 'off',
  20. 'object-curly-spacing': 'off',
  21. 'import/no-amd': 'off',
  22. 'no-danger-with-children': 'off',
  23. 'no-fallthrough': 'off',
  24. 'no-obj-calls': 'off',
  25. 'array-bracket-spacing': 'off',
  26. 'computed-property-spacing': 'off',
  27. 'react/no-danger-with-children': 'off',
  28. },
  29. // JSON file formatting is handled by Biome. ESLint should not be linting
  30. // and formatting these files.
  31. ignorePatterns: ['*.json'],
  32. overrides: [
  33. {
  34. files: ['static/**/*.spec.{ts,js}', 'tests/js/**/*.{ts,js}'],
  35. extends: ['plugin:testing-library/react', 'sentry-app/strict'],
  36. rules: {
  37. // TODO(@anonrig): Remove this from eslint-sentry-config
  38. 'space-infix-ops': 'off',
  39. 'object-shorthand': 'off',
  40. 'object-curly-spacing': 'off',
  41. 'import/no-amd': 'off',
  42. 'no-danger-with-children': 'off',
  43. 'no-fallthrough': 'off',
  44. 'no-obj-calls': 'off',
  45. 'array-bracket-spacing': 'off',
  46. 'computed-property-spacing': 'off',
  47. 'react/no-danger-with-children': 'off',
  48. },
  49. },
  50. {
  51. // We specify rules explicitly for the sdk-loader here so we do not have
  52. // eslint ignore comments included in the source file, which is consumed
  53. // by users.
  54. files: ['**/js-sdk-loader.ts'],
  55. rules: {
  56. 'no-console': 'off',
  57. },
  58. },
  59. ],
  60. };