-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ts eslint rules on unused vars -- especially for imports
- Loading branch information
Showing
2 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
import { default as defaultConfig } from '@epic-web/config/eslint' | ||
|
||
const ERROR = 'error' | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
export default [ | ||
...defaultConfig, | ||
// add custom config objects here: | ||
// https://github.com/epicweb-dev/config/blob/main/docs/decisions/008-new-ts-eslint-rules.md | ||
// I agree with not needing a lint rule to yell at you about using `any` in a type | ||
{ | ||
plugins: { | ||
'@typescript-eslint': (await import('typescript-eslint')).plugin, | ||
}, | ||
rules: { | ||
// I prefer error over warn from the default config | ||
'@typescript-eslint/no-unused-vars': [ | ||
ERROR, | ||
{ | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
varsIgnorePattern: '^ignored', | ||
}, | ||
], | ||
}, | ||
}, | ||
] |