Skip to content

Commit ed2c28d

Browse files
committed
Update docs
1 parent b35817f commit ed2c28d

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
## 0.0.1
1818

19-
- [`1c76c20`](https://github.com/ota-meshi/typescript-eslint-parser-for-extra-files/commit/1c76c20cf7c7617b157356e44eb2dc7e463dfb6f) Thanks [@ota-meshi](https://github.com/ota-meshi)! - First release 🎉
19+
- [`1c76c20`](https://github.com/ota-meshi/typescript-eslint-parser-for-extra-files/commit/1c76c20cf7c7617b157356e44eb2dc7e463dfb6f) First release 🎉

README.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ This parser is in the ***experimental stages*** of development.
1010

1111
A custom ESLint parser that provides type information when importing `*.vue`, `*.svelte`, and `*.astro` files.
1212

13-
`@typescript-eslint/parser` provides type information mostly well, but if you import extra files (other than `*.ts`, `*.tsx`, `*.d.ts`, `*.js`, `*.jsx`, and `*.json`) it treats it as `any` type.
13+
`@typescript-eslint/parser` provides type information mostly well, but if you import extra files (other than `*.ts`, `*.tsx`, `*.d.ts`, `*.js`, `*.jsx`, and `*.json`) it treats it as `any` type.
14+
15+
e.g.
16+
17+
```vue
18+
<script lang="ts">
19+
import HelloWorld from './components/HelloWorld.vue' // <- typescript program can't parse it. because it will read including template and style.
20+
21+
export default {
22+
name: 'App',
23+
components: {
24+
HelloWorld // <- so type information is `any`
25+
}
26+
}
27+
</script>
28+
```
29+
30+
See also <https://github.com/vuejs/vue-eslint-parser/issues/104>, and <https://github.com/typescript-eslint/typescript-eslint/issues/2865>.
31+
1432
This parser can be used to provide type information for importing `*.vue`, `*.svelte`, and `*.astro` files.
1533

1634
This parser is used in combination with [vue-eslint-parser], [svelte-eslint-parser], and [astro-eslint-parser].
@@ -174,10 +192,10 @@ npm install --save-dev astrojs-compiler-sync@latest @astrojs/compiler
174192

175193
- Angle bracket type assertions cannot be used.
176194

177-
This parser parses as JSX enabled.
178-
Therefore, angle bracket type assertions cannot be used. Use the `as` operator instead.
195+
This parser parses as JSX enabled.
196+
Therefore, angle bracket type assertions cannot be used. Use the `as` operator instead.
179197

180-
[The TypeScript Handbook - JSX > The `as` operator](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator)
198+
[The TypeScript Handbook - JSX > The `as` operator](https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator)
181199

182200
## 🍻 Contributing
183201

0 commit comments

Comments
 (0)