From 5e5cabad3e9f72e4fe77806881eec142d98537de Mon Sep 17 00:00:00 2001 From: Timo Bechtel <48655057+TimoBechtel@users.noreply.github.com> Date: Thu, 16 May 2024 18:47:52 +0200 Subject: [PATCH] feat(tsconfig): add tsconfig for react apps --- README.md | 8 ++++++++ tsconfig/react.json | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tsconfig/react.json diff --git a/README.md b/README.md index 787fd71..578328c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ echo '"@timobechtel/style/prettier/index.mjs"' > .prettierrc echo '{ "extends": "@timobechtel/style/tsconfig/core" }' > tsconfig.json ``` +#### Or with React + +```bash +echo '{ "extends": "@timobechtel/style/tsconfig/react" }' > tsconfig.json +``` + ### Eslint ```bash @@ -81,6 +87,8 @@ module.exports = { }; ``` +#### VSCode + Note: You should disable `source.organizeImports` in your VSCode config, as this collides with the `import/order` rule. Add the following to your VSCode config, e.g. `.vscode/settings.json` diff --git a/tsconfig/react.json b/tsconfig/react.json new file mode 100644 index 0000000..3ba5130 --- /dev/null +++ b/tsconfig/react.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./core.json", + "display": "TSConfig for React apps", + "compilerOptions": { + "moduleResolution": "bundler", + "module": "Preserve", + "noEmit": true, + "declaration": false, + "jsx": "react-jsx" + } +}