Open karlhorky opened 8 months ago
Manually restore tsconfig.json
after installing the UpLeveled ESLint config:
tsconfig.json
file before installing UpLeveled ESLint configtsconfig.json
to restore the file after UpLeveled ESLint config has been installedThis also affects Expo (React Native) apps - create-expo
creates this default tsconfig.json
file which is overwritten by our own, causing TypeScript errors:
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"**/*.ts",
"**/*.tsx",
".expo/types/**/*.ts",
"expo-env.d.ts"
]
}
Let's try to fix this before the lecture on 21 June 2024.
When checking the possible solution for this issue, I am thinking of two possible ways
paths
object that is causing issues when it's removed to the tsconfig Templates that we are installing with the eslint-config-upleveled
. The two identified projects where this issue occurs are the Next.js and Expo projects. if the path alias is the way to go now, maybe we should adopt it alsoQuestions
Do we just want to include this particular paths
object that causes issues when it's removed or include everything from the original tsconfig created by these projects?
Currently, installing the UpLeveled ESLint config will create a new
tsconfig.json
file, overwriting any existing files.This is a problem on Next.js projects using shadcn/ui, which relies on the default import alias configuration
@/*
in thetsconfig.json
file, created bycreate-next-app
(see output below)We could merge in specific values from the existing
tsconfig.json
from students, starting with the"paths"
config.This also affects new Expo apps (
create-expo
): https://github.com/upleveled/eslint-config-upleveled/issues/343#issuecomment-2176593654