Skip to content

Commit 86ea026

Browse files
committed
feat(package): TS as a peer dependency
Added TypeScript as a peer dependency and updated the docs to match Fixes #14
1 parent de88391 commit 86ea026

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ TypeScript language service plugin to let more plugins work in Visual Studio.
1111

1212
Many language service plugins work perfectly in VS Code, but using them in Visual Studio will break due to various niggles. Ideally these would all be fixed without hacks like this but this plugin can be used as a temporary measure until then.
1313

14+
## Compatibility
15+
16+
* Node: >= 10.14
17+
* TypeScript >= 2.9
18+
1419
## Installation
1520

1621
```shell
@@ -64,10 +69,10 @@ Relative to the tsconfig. Null means do not set a working directory.
6469

6570
**useVSTypescript (bool - default true)**
6671

67-
Language service plugins should be using the version of typescript that's passed to them by tsserver. Tools they use, such as linters, tend to use the standard `require('typescript')` to pick up typescript.
68-
When tsserver is running from local npm depencencies, this is fine and both typescripts will be the same module. In Visual Studio, tsserver runs from a separate installation and so these modules are likely to be different. The result is various difficult to diagnose errors in plugins.
72+
Language service plugins should be using the version of TypeScript that's passed to them by tsserver. Tools they use, such as linters, tend to use the standard `require('typescript')` to pick up TypeScript.
73+
When tsserver is running from local npm depencencies, this is fine and both TypeScript will be the same module. In Visual Studio, tsserver runs from a separate installation and so these modules are likely to be different. The result is various difficult to diagnose errors in plugins.
6974

70-
This option mocks `require('typescript')` so that tools pick up the same typescript version that tsserver is running from.
75+
This option mocks `require('typescript')` so that tools pick up the same TypeScript version that tsserver is running from.
7176

7277
**onByDefault (bool - default true)**
7378

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
"typescript30": "npm:[email protected]",
4848
"typescript38": "npm:[email protected]"
4949
},
50+
"dependencies": {
51+
"mock-require": "^3.0.3"
52+
},
53+
"peerDependencies": {
54+
"typescript": ">=2.9"
55+
},
5056
"release": {
5157
"plugins": [
5258
"@semantic-release/commit-analyzer",
@@ -66,8 +72,5 @@
6672
"commitizen": {
6773
"path": "./node_modules/cz-conventional-changelog"
6874
}
69-
},
70-
"dependencies": {
71-
"mock-require": "^3.0.3"
7275
}
7376
}

0 commit comments

Comments
 (0)