.eslintrc.js 1.8 KB

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