I'm trying to use TypeScript's new satisfies operator to keep the most specific type for a variable in my code, but ESLint is throwing a Parsing error: ',' expected.
error on the closing curly bracket of the object when I add satisfies Prisma.gameInclude;
to the end of it.
Here's how the object in question looks:
const includeFields = {
participants: true,
queue: {
include: {
gamemode: {
include: {
character_pool: {
include: {
characters: true,
},
},
},
},
},
},
} satisfies Prisma.gameInclude;
^ Parsing error: ',' expected.
And here's my .eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
overrides: [],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "unused-imports"],
rules: {
"unused-imports/no-unused-imports": "error",
},
};
I've tried adding the parserOptions.project
property to it pointing to my tsconfig, but no luck.
Reading through some PRs and issues for typescript-eslint I found our that it does already support the satisfies operator. I'm currently on its latest version, 5.56.0.
How can I fix this?
tailwind.config.ts
in an electron-forge app. help edit: nevermind, i restarted vscode and it fix my problem after updating typescript. thank you! – Teakettle