Browse Source

ci: Update eslint to apply testing-library/react rules to more spec files (#67228)

Ryan Albrecht 11 months ago
parent
commit
5178e51854
2 changed files with 3 additions and 11 deletions
  1. 0 1
      .eslintignore
  2. 3 10
      .eslintrc.js

+ 0 - 1
.eslintignore

@@ -1,7 +1,6 @@
 **/dist/**/*
 **/vendor/**/*
 **/tests/**/fixtures/**/*
-/scripts/*.js
 !.github
 !.github/workflows/scripts/*
 *.d.ts

+ 3 - 10
.eslintrc.js

@@ -1,18 +1,11 @@
 /* eslint-env node */
 
-const isRelaxed = !!process.env.SENTRY_ESLINT_RELAXED;
-
-// Strict ruleset that runs on pre-commit and in local environments
-const ADDITIONAL_HOOKS_TO_CHECK_DEPS_FOR =
-  '(useEffectAfterFirstRender|useMemoWithPrevious)';
-
 module.exports = {
   root: true,
-  extends: [isRelaxed ? 'sentry-app' : 'sentry-app/strict'],
+  extends: ['sentry-app/strict'],
   globals: {
     require: false,
     expect: false,
-    sinon: false,
     MockApiClient: true,
     tick: true,
     jest: true,
@@ -20,7 +13,7 @@ module.exports = {
   rules: {
     'react-hooks/exhaustive-deps': [
       'error',
-      {additionalHooks: ADDITIONAL_HOOKS_TO_CHECK_DEPS_FOR},
+      {additionalHooks: '(useEffectAfterFirstRender|useMemoWithPrevious)'},
     ],
 
     // TODO(@anonrig): Remove this from eslint-sentry-config
@@ -40,7 +33,7 @@ module.exports = {
   ignorePatterns: ['*.json'],
   overrides: [
     {
-      files: ['tests/js/**/*.{ts,js}'],
+      files: ['static/**/*.spec.{ts,js}', 'tests/js/**/*.{ts,js}'],
       extends: ['plugin:testing-library/react', 'sentry-app/strict'],
       rules: {
         // TODO(@anonrig): Remove this from eslint-sentry-config