.eslintrc.js 720 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* eslint-env node */
  2. /* eslint import/no-nodejs-modules:0 */
  3. const process = require('process');
  4. const isRelaxed = !!process.env.SENTRY_ESLINT_RELAXED;
  5. const isCi = !!process.env.CI;
  6. // Strict ruleset that runs on pre-commit and in local environments
  7. const strictRulesNotCi = {
  8. 'react-hooks/exhaustive-deps': ['error'],
  9. };
  10. module.exports = {
  11. extends: [isRelaxed ? 'sentry-app' : 'sentry-app/strict'],
  12. globals: {
  13. require: false,
  14. expect: false,
  15. sinon: false,
  16. MockApiClient: true,
  17. TestStubs: true,
  18. tick: true,
  19. jest: true,
  20. },
  21. rules: {
  22. ...(!isRelaxed && !isCi ? strictRulesNotCi : {}),
  23. },
  24. overrides: [
  25. {
  26. files: ['*.ts', '*.tsx'],
  27. rules: {},
  28. },
  29. ],
  30. };