Skip to content

Commit 8ce00aa

Browse files
committed
Announce upcoming big release/fix. Update README
1 parent 3532db8 commit 8ce00aa

File tree

5 files changed

+48
-8
lines changed

5 files changed

+48
-8
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ You can turn on linting at the typechecker level by setting the `typeCheck` tsli
3838

3939
```
4040

41+
**Important**: Importing vue modules (ie. `import Hello from 'Hello.vue'`) will work fully within other .vue files (type information is retrieved)
42+
without the need for a wildcard declaration. However, `.ts` modules that import `.vue` modules still require the wildcard declaration file:
43+
44+
```
45+
// sfc.d.ts
46+
declare module "*.vue" {
47+
import Vue from "vue" // <-- this is not ideal, v2.0.0 will fix this!
48+
export default Vue
49+
}
50+
51+
```
52+
The above will give the type as `vue` which is not ideal and defeats the purpose of TypeScript (your Vue modules extend Vue with more type information
53+
that you have added on your module).
54+
I've found a solution to this and I'm currently working on preparing it for **a 2.0.0 release** where the wildcard definition will no longer
55+
be needed and type information from the module **will fully work!** Star the github repo
56+
and watch this issue: https://github.com/prograhammer/vscode-tslint-vue/issues/4. In the meantime, you can double check yourself using the
57+
Webpack plugin `fork-ts-checker-webpack-plugin`. See Webpack section further down below.
58+
59+
4160
### Setup tsconfig.json
4261

4362
This extension assumes you have a `tsconfig.json` file located at the root of your current project/workspace. In your tsconfig file, ensure you don't exclude `.vue` files and also provide the wildcard path alias `@` so that it points to `src`:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vscode-tslint",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "The umbrella project for the tslint client and server",
55
"main": " ",
66
"dependencies": {

tslint/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.4.2
2+
- Announce upcoming big release/fix. Update README.
3+
14
# 1.4.1
25
- Clean up and added README clarification.
36

tslint/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[VSCode extension](https://marketplace.visualstudio.com/items?itemName=prograhammer.tslint-vue) for [tslint](https://github.com/palantir/tslint) with added support for .vue files (single file component) and compiler/typechecker level linting. This is a fork of [vscode-tslint](https://github.com/Microsoft/vscode-tslint).
44

5-
*Note: See Quick Setup section further down for turning `typeCheck` on...*
5+
*Note: See Quick Setup section further down for **new details** on turning `typeCheck` on...*
66

77
![Important](vscode-tslint-vue2.gif "vscode-tslint-vue screencapture")
88

@@ -37,6 +37,23 @@ You can turn on linting at the typechecker level by setting the `typeCheck` tsli
3737
}
3838

3939
```
40+
**Important**: Importing vue modules (ie. `import Hello from 'Hello.vue'`) will work fully within other .vue files (type information is retrieved)
41+
without the need for a wildcard declaration. However, `.ts` modules that import `.vue` modules still require the wildcard declaration file:
42+
43+
```
44+
// sfc.d.ts
45+
declare module "*.vue" {
46+
import Vue from "vue" // <-- this is not ideal, v2.0.0 will fix this!
47+
export default Vue
48+
}
49+
50+
```
51+
The above will give the type as `vue` which is not ideal and defeats the purpose of TypeScript (your Vue modules extend Vue with more type information
52+
that you have added on your module).
53+
I've found a solution to this and I'm currently working on preparing it for **a 2.0.0 release** where the wildcard definition will no longer
54+
be needed and type information from the module **will fully work!** Star the github repo
55+
and watch this issue: https://github.com/prograhammer/vscode-tslint-vue/issues/4. In the meantime, you can double check yourself using the
56+
Webpack plugin `fork-ts-checker-webpack-plugin`. See Webpack section further down below.
4057

4158
### Setup tsconfig.json
4259

@@ -93,7 +110,8 @@ Vue functionality. You can try it out early and read more at this [issue here](h
93110

94111
### VNext
95112

96-
- This is a fork of [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) so you can find more information there. Soon
113+
This is a fork of [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) so you can find more information there. In upcoming
114+
v2.0.0 release
97115
I will update this code to fork from the newer, improved extension TSLint (vnext) [vscode-ts-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.ts-tslint). Please refer to the tslint [documentation](https://github.com/palantir/tslint) for how to configure the linting rules.
98116

99117
### Prerequisites
@@ -103,13 +121,13 @@ To install tslint and typescript globally you can run `npm install -g tslint typ
103121

104122
# FAQ
105123

106-
- How can I use tslint rules that require type information
124+
How can I use tslint rules that require type information?
107125

108-
Turn on typecheck in your VSCode settings.json (File > Preferences > Settings): `"tslint.typeCheck": true`.
126+
- Turn on typecheck in your VSCode settings.json (File > Preferences > Settings): `"tslint.typeCheck": true`.
109127

110-
- Linting does not seem to work what can I do?
128+
Linting does not seem to work what can I do?
111129

112-
Click on the `TSlint` status bar item at the bottom left of the status bar to see the output from the vscode-tslint-vue extension.
130+
- Click on the `TSlint` status bar item at the bottom left of the status bar to see the output from the vscode-tslint-vue extension.
113131
You can enable more tracing output by adding the setting "tslint.trace.server" with a value of "verbose" or "messages". If this doesn't
114132
help then please file an [issue](https://github.com/Microsoft/vscode-tslint-vue/issues/new) and include the trace output produced when running with the setting "tslint.trace.server" set to "verbose". This is a fork of [vscode-tslint](https://github.com/Microsoft/vscode-tslint) so the issue may be need
115133
to be resolved their.

tslint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tslint-vue",
33
"displayName": "TSLint Vue",
44
"description": "TSLint for Vue.js",
5-
"version": "1.4.1",
5+
"version": "1.4.2",
66
"author": "Microsoft Corporation",
77
"license": "MIT",
88
"publisher": "prograhammer",

0 commit comments

Comments
 (0)