mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(ts) disable noUncheckedIndexedAccess because of the huge count of errors
https://nuxt.com/docs/4.x/getting-started/upgrade#default-typescript-configuration-changes
This commit is contained in:
parent
8e6f812a9a
commit
72d574a039
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
// necessary for a peculiar edge case where the symlinked locale to data/ yields an error with ESLint
|
|
||||||
"extends": "../tsconfig.json"
|
|
||||||
}
|
|
@ -61,6 +61,13 @@ if (process.platform === 'win32') {
|
|||||||
__dirname = __dirname.slice(1);
|
__dirname = __dirname.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tsConfig = {
|
||||||
|
compilerOptions: {
|
||||||
|
allowImportingTsExtensions: true,
|
||||||
|
noUncheckedIndexedAccess: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const esBuildOptions = {
|
const esBuildOptions = {
|
||||||
supported: {
|
supported: {
|
||||||
'top-level-await': true,
|
'top-level-await': true,
|
||||||
@ -120,6 +127,9 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
compatibilityDate: '2024-07-06',
|
compatibilityDate: '2024-07-06',
|
||||||
nitro: {
|
nitro: {
|
||||||
|
typescript: {
|
||||||
|
tsConfig,
|
||||||
|
},
|
||||||
rollupConfig: {
|
rollupConfig: {
|
||||||
external: [
|
external: [
|
||||||
'canvas',
|
'canvas',
|
||||||
@ -220,12 +230,7 @@ export default defineNuxtConfig({
|
|||||||
typescript: {
|
typescript: {
|
||||||
typeCheck: !process.env.RUN_SNAPSHOT_TESTS &&
|
typeCheck: !process.env.RUN_SNAPSHOT_TESTS &&
|
||||||
(process.env.APP_ENV || process.env.NODE_ENV) !== 'production',
|
(process.env.APP_ENV || process.env.NODE_ENV) !== 'production',
|
||||||
tsConfig: {
|
tsConfig,
|
||||||
compilerOptions: {
|
|
||||||
baseUrl: './',
|
|
||||||
allowImportingTsExtensions: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
postcss: {
|
postcss: {
|
||||||
plugins: {
|
plugins: {
|
||||||
@ -235,6 +240,11 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
|
'prepare:types'({ nodeTsConfig, sharedTsConfig }) {
|
||||||
|
// somewhy, allowImportingTsExtensions is ignored in Nuxt
|
||||||
|
nodeTsConfig.compilerOptions = { ...nodeTsConfig.compilerOptions, ...tsConfig.compilerOptions };
|
||||||
|
sharedTsConfig.compilerOptions = { ...sharedTsConfig.compilerOptions, ...tsConfig.compilerOptions };
|
||||||
|
},
|
||||||
async 'pages:extend'(routes) {
|
async 'pages:extend'(routes) {
|
||||||
for (const code of codes) {
|
for (const code of codes) {
|
||||||
for (const subroute of configByLocale[code].nouns.subroutes || []) {
|
for (const subroute of configByLocale[code].nouns.subroutes || []) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user