-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update eslint and use flat config
- Loading branch information
1 parent
6fa7141
commit b7140f9
Showing
4 changed files
with
404 additions
and
435 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js' | ||
import tseslint from 'typescript-eslint' | ||
import vitest from '@vitest/eslint-plugin' | ||
import eslintConfigPrettier from 'eslint-config-prettier' | ||
import globals from 'globals' | ||
|
||
export default tseslint.config( | ||
{ | ||
languageOptions: { | ||
sourceType: 'module' | ||
}, | ||
linterOptions: { | ||
reportUnusedDisableDirectives: 'error' | ||
} | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...tseslint.configs.stylistic, | ||
{ | ||
files: ['**/*.{js,mjs}'], | ||
rules: { | ||
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }] | ||
} | ||
}, | ||
{ | ||
rules: { | ||
'no-empty': ['error', { allowEmptyCatch: true }], | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }] | ||
} | ||
}, | ||
{ | ||
files: [ | ||
'examples/**/*.{js,mjs}', | ||
'tests/examples-overrides/**/*.{js,mjs}', | ||
'tests/fixtures/**/*.{js,mjs}' | ||
], | ||
languageOptions: { | ||
globals: globals.browser | ||
} | ||
}, | ||
{ | ||
files: [ | ||
'examples/**/backend-src/**/*.{js,mjs}', | ||
'examples/**/server.{js,mjs}' | ||
], | ||
languageOptions: { | ||
globals: globals.node | ||
} | ||
}, | ||
{ | ||
files: ['tests/**/*.{js,ts}'], | ||
...vitest.configs.recommended | ||
}, | ||
eslintConfigPrettier, | ||
{ | ||
ignores: ['dist/**', '.examples-temp/**', 'tests/.fixtures-temp/**'] | ||
} | ||
) |
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 |
---|---|---|
|
@@ -11,12 +11,12 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"@typescript-eslint/parser": "^6.11.0", | ||
"eslint": "^8.54.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-vitest": "^0.3.9", | ||
"@vitest/eslint-plugin": "^1.1.12", | ||
"eslint": "^9.15.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"globals": "^15.12.0", | ||
"prettier": "^3.1.0", | ||
"typescript": "^5.2.2" | ||
"typescript": "^5.2.2", | ||
"typescript-eslint": "^8.16.0" | ||
} | ||
} |
Oops, something went wrong.