Currently experiencing difficulties with using array includes in conjunction with TypeScript. Numerous sources suggest adding the ES2016 lib option (or higher) to tsconfig.json. Despite trying various combinations of lib and target settings, none have proven effective.
Experimented with options such as ES2016.Array.Include, ES2016, ESNext.Array, and ESNext individually and collectively, but to no avail. Also attempted altering the target setting without success, utilizing the tsconfig.json configuration recommended for Vue.
Contemplating alternate approaches aside from includes, or is this possibly a TypeScript "issue"?
https://i.sstatic.net/hRpMF.png
Error-inducing code snippet:
import { useRoute } from 'vue-router'
const isRead = computed(() => {
route.name!.includes('create') || route.name!.includes('edit') ? false : true
})
tsconfig.json
{
"compilerOptions": {
// "noImplicitAny": true,
"allowJs": true,
"outDir": "build",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"jsx": "preserve",
"jsxImportSource": "vue",
"noImplicitThis": true,
"strict": true,
"verbatimModuleSyntax": true,
"target": "ESNext",
"useDefineForClassFields": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
},
}