Merge pull request #2039 from modelcontextprotocol/v2/chore/1959-no-floating-promises
chore(lint): enable @typescript-eslint/no-floating-promises in all five ESLint scopes
This commit is contained in:
commit
405d0f4d0d
1 changed files with 656 additions and 113 deletions
|
|
@ -16,4 +16,22 @@ export default defineConfig([
|
|||
globals: globals.node,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Type-aware pass for `no-floating-promises` (#1959). The rule needs type
|
||||
// information, which `tseslint.configs.recommended` does not provide, and
|
||||
// the parser needs a project that literally contains the linted file — so
|
||||
// both of this client's tsconfig projects are listed, exactly as
|
||||
// `npm run typecheck` runs them (`src` is in the first, `__tests__` only
|
||||
// in the second).
|
||||
files: ["**/*.ts"],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ["./tsconfig.json", "./tsconfig.test.json"],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue