-
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.
🧵 Migrate to v9 ESLint and new flat config system
- Loading branch information
Showing
5 changed files
with
316 additions
and
286 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import js from '@eslint/js' | ||
import tseslint from 'typescript-eslint' | ||
import globals from 'globals' | ||
|
||
export default [ | ||
// Apply recommended rules for JavaScript and TypeScript | ||
js.configs.recommended, | ||
...tseslint.configs.recommended, | ||
|
||
// Customize rules & options | ||
{ | ||
languageOptions: { | ||
globals: { | ||
// Add browser globals like `window`, `document`, etc. | ||
...globals.browser, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'no-var': 'error', | ||
'prefer-const': 'error', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
// Allows for Go style _var ignoring | ||
varsIgnorePattern: '^_', | ||
argsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_', | ||
}, | ||
], | ||
'no-undef': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-constructor-return': 'error', | ||
'no-promise-executor-return': 'error', | ||
'prefer-template': 'error', | ||
'dot-notation': 'error', | ||
|
||
'func-style': [ | ||
'error', | ||
'declaration', | ||
{ | ||
allowArrowFunctions: true, | ||
}, | ||
], | ||
|
||
'object-shorthand': 'error', | ||
'spaced-comment': 'error', | ||
}, | ||
}, | ||
] |
Oops, something went wrong.