-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve react+vite lib type checking errors
- Loading branch information
Showing
17 changed files
with
94 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
{ | ||
"extends": "@canonical/typescript-config-react", | ||
"extends": "@canonical/typescript-config-node", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"skipLibCheck": true | ||
"noEmit": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
import checker from "vite-plugin-checker"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [ | ||
react(), | ||
checker({ | ||
typescript: { tsconfigPath: "tsconfig.app.json" }, | ||
}), | ||
react() | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
## TS Example | ||
|
||
A simple example of using TS and Biome in a Typescript app. | ||
|
||
## Caveats | ||
### TSConfig | ||
#### `lib` override | ||
|
||
Some functions in this example (such as `setTimeout`) require the DOM API. | ||
Therefore, this package includes the DOM lib, which is not included by the base Typescript config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Canonical Typescript Configuration | ||
|
||
This package provides a central configuration for Canonical's Node TypeScript projects. | ||
|
||
### Installation | ||
|
||
#### Bun | ||
|
||
```bash | ||
bun add -d @canonical/typescript-config-node | ||
``` | ||
|
||
#### NPM | ||
|
||
```bash | ||
npm install --save-dev @canonical/typescript-config-node | ||
``` | ||
|
||
#### Yarn | ||
|
||
```bash | ||
yarn add --dev @canonical/typescript-config-node | ||
``` | ||
|
||
### Usage | ||
|
||
Create a `tsconfig.json` file in the root of your project and extend the configuration. | ||
|
||
```json | ||
{ | ||
"extends": "@canonical/typescript-config-node" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "@canonical/typescript-config-node", | ||
"version": "0.0.0-experimental.0", | ||
"description": "Canonical's standard TypeScript configuration for Node-based projects", | ||
"main": "tsconfig.json", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Canonical Webteam" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/canonical/ds25" | ||
}, | ||
"license": "LGPL-3.0", | ||
"bugs": { | ||
"url": "https://github.com/canonical/ds25/issues" | ||
}, | ||
"homepage": "https://github.com/canonical/ds25#readme", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"check": "bun run check:biome", | ||
"check:fix": "bun run check:biome:fix", | ||
"check:biome": "biome check *.json", | ||
"check:biome:fix": "biome check --write *.json" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.6.2" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.6.2" | ||
}, | ||
"dependencies": { | ||
"@types/node": "^22.9.0", | ||
"@canonical/typescript-config-base": "^0.1.1-experimental.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "@canonical/typescript-config-base", | ||
"compilerOptions": { | ||
"lib": ["ES2023", "DOM"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"extends": "@canonical/typescript-config-base", | ||
"extends": "@canonical/typescript-config-node", | ||
"compilerOptions": { | ||
"lib": ["ES2023", "DOM"], | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"jsx": "react-jsx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters