Skip to content

Commit

Permalink
chore: enable unused-vars caughtErrors: all internally (#8369)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Feb 22, 2024
1 parent b17c453 commit 813ad93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ export default tseslint.config(
],
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
{
caughtErrors: 'all',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
Expand Down Expand Up @@ -472,7 +476,7 @@ export default tseslint.config(
files: ['packages/ast-spec/src/**/*.{ts,tsx,cts,mts}'],
rules: {
// disallow ALL unused vars
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'all' }],
'@typescript-eslint/sort-type-constituents': 'error',
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/website/src/hooks/useMediaQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const useMediaQuery = (mediaQuery: string): boolean => {

try {
mediaQueryList.addEventListener('change', documentChangeHandler);
} catch (e) {
} catch {
// Safari isn't supporting mediaQueryList.addEventListener
// eslint-disable-next-line deprecation/deprecation
mediaQueryList.addListener(documentChangeHandler);
Expand All @@ -32,7 +32,7 @@ const useMediaQuery = (mediaQuery: string): boolean => {
return () => {
try {
mediaQueryList.removeEventListener('change', documentChangeHandler);
} catch (e) {
} catch {
// Safari isn't supporting mediaQueryList.removeEventListener
// eslint-disable-next-line deprecation/deprecation
mediaQueryList.removeListener(documentChangeHandler);
Expand Down

0 comments on commit 813ad93

Please sign in to comment.