Permalink
Cannot retrieve contributors at this time
46 lines (39 sloc)
1004 Bytes
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-env node */ | |
| /* eslint import/no-nodejs-modules:0 */ | |
| const process = require('process'); | |
| const isRelaxed = !!process.env.SENTRY_ESLINT_RELAXED; | |
| const isCi = !!process.env.CI; | |
| // Strict ruleset that runs on pre-commit and in local environments | |
| const ADDITIONAL_HOOKS_TO_CHECK_DEPS_FOR = | |
| '(useEffectAfterFirstRender|useMemoWithPrevious)'; | |
| const strictRulesNotCi = { | |
| 'react-hooks/exhaustive-deps': [ | |
| 'error', | |
| {additionalHooks: ADDITIONAL_HOOKS_TO_CHECK_DEPS_FOR}, | |
| ], | |
| }; | |
| module.exports = { | |
| extends: [isRelaxed ? 'sentry-app' : 'sentry-app/strict'], | |
| globals: { | |
| require: false, | |
| expect: false, | |
| sinon: false, | |
| MockApiClient: true, | |
| TestStubs: true, | |
| tick: true, | |
| jest: true, | |
| }, | |
| rules: { | |
| 'react-hooks/exhaustive-deps': [ | |
| 'warn', | |
| {additionalHooks: ADDITIONAL_HOOKS_TO_CHECK_DEPS_FOR}, | |
| ], | |
| ...(!isRelaxed && !isCi ? strictRulesNotCi : {}), | |
| }, | |
| overrides: [ | |
| { | |
| files: ['*.ts', '*.tsx'], | |
| rules: {}, | |
| }, | |
| ], | |
| }; |