@vue/tsconfig
Advanced tools
Comparing version 0.5.1 to 0.6.0
{ | ||
"name": "@vue/tsconfig", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "A base TSConfig for working with Vue.js", | ||
"main": "tsconfig.json", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
@@ -21,7 +24,17 @@ "type": "git", | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"peerDependencies": { | ||
"typescript": "5.x", | ||
"vue": "^3.3.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"typescript": { | ||
"optional": true | ||
}, | ||
"vue": { | ||
"optional": true | ||
} | ||
} | ||
} | ||
} |
@@ -6,4 +6,5 @@ # `@vue/tsconfig` | ||
Requires TypeScript >= 5.0. For TypeScript v4.5 to v4.9, please use [v0.1.x](https://www.npmjs.com/package/@vue/tsconfig/v/0.1.3). | ||
Requires Vue.js >= 3.3. | ||
[See below for the changes in v0.3.x.](#migrating-from-typescript--50) | ||
[See below for the breaking changes in v0.3.x.](#migrating-from-typescript--50) | ||
@@ -37,3 +38,3 @@ ## Installation | ||
```sh | ||
npm add -D @tsconfig/node18 @types/node@18 | ||
npm add -D @tsconfig/node22 @types/node@22 | ||
``` | ||
@@ -44,3 +45,3 @@ | ||
```json | ||
"extends": "@tsconfig/node18/tsconfig.json", | ||
"extends": "@tsconfig/node22/tsconfig.json", | ||
"compilerOptions": { | ||
@@ -55,3 +56,3 @@ "types": ["node"] | ||
"extends": [ | ||
"@tsconfig/node18/tsconfig.json", | ||
"@tsconfig/node22/tsconfig.json", | ||
"@vue/tsconfig/tsconfig.json" | ||
@@ -64,3 +65,3 @@ ], | ||
Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node18/tsconfig.json` so that it takes precedence. | ||
Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node22/tsconfig.json` so that it takes precedence. | ||
@@ -67,0 +68,0 @@ ## Emitting Declaration Files |
@@ -6,12 +6,2 @@ { | ||
"noEmit": true, | ||
// When type-checking with solution-style tsconfigs, though with `noEmit: true`, there won't | ||
// be any `.d.ts` files emitted, but tsc still writes a `.tsbuildinfo` file to the `outDir` | ||
// for each project. If we don't explicitly set the `outDir`, it will be in the same folder | ||
// as the `tsconfig.json` file, which would look messy. | ||
// Setting it to `./dist/` isn't ideal either, because it would pollute the `dist` folder. | ||
// So we set it to a hidden folder in `node_modules` to avoid polluting the project root. | ||
// FIXME: | ||
// This caused a regression: https://github.com/vuejs/tsconfig/issues/27 | ||
// Need to find a better solution. | ||
// "outDir": "./node_modules/.cache/vue-tsbuildinfo", | ||
@@ -27,9 +17,9 @@ // As long as you are using a build tool, we recommend you to author and ship in ES modules. | ||
// So here we enable some resolution features that are only available in bundlers. | ||
"moduleResolution": "bundler", | ||
"moduleResolution": "Bundler", | ||
"resolveJsonModule": true, | ||
// `allowImportingTsExtensions` can only be used when `noEmit` or `emitDeclarationOnly` is set. | ||
// But `noEmit` may cause problems with solution-style tsconfigs: | ||
// <https://github.com/microsoft/TypeScript/issues/49844> | ||
// And `emitDeclarationOnly` is not always wanted. | ||
// Considering it's not likely to be commonly used in Vue codebases, we don't enable it here. | ||
"allowImportingTsExtensions": true, | ||
// Even files without `import` or `export` are treated as modules. | ||
// It helps to avoid mysterious errors such as `Cannot redeclare block-scoped variable 'name`. | ||
// https://www.totaltypescript.com/cannot-redeclare-block-scoped-variable#solution-3-your-module-isnt-a-module | ||
"moduleDetection": "force", | ||
@@ -59,3 +49,3 @@ // Required in Vue projects | ||
"target": "ESNext", | ||
// For spec compilance. | ||
// For spec compliance. | ||
// `true` by default if the `target` is `ES2020` or higher. | ||
@@ -62,0 +52,0 @@ // Explicitly set it to `true` here in case some users want to overwrite the `target`. |
11328
8
102
2
77