
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
typescript-eslint-parser-for-extra-files
Advanced tools
An experimental ESLint custom parser for Vue, Svelte, and Astro for use with TypeScript. It provides type information in combination with each framework's ESLint custom parser.
An experimental ESLint custom parser for Vue, Svelte, and Astro for use with TypeScript. It provides type information in combination with each framework's ESLint custom parser.
This parser is in the experimental stages of development.
A custom ESLint parser that provides type information when importing *.vue, *.svelte, and *.astro files.
@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.
e.g.
<script lang="ts">
import HelloWorld from './components/HelloWorld.vue' // <- typescript program can't parse it. because it will read including template and style.
export default {
name: 'App',
components: {
HelloWorld // <- so type information is `any`
}
}
</script>
See also https://github.com/vuejs/vue-eslint-parser/issues/104, and https://github.com/typescript-eslint/typescript-eslint/issues/2865.
This parser can be used to provide type information for importing *.vue, *.svelte, and *.astro files.
This parser is used in combination with vue-eslint-parser, svelte-eslint-parser, and astro-eslint-parser.
npm install --save-dev typescript-eslint-parser-for-extra-files @typescript-eslint/parser@latest typescript@latest
Install vue v3.2.41 or newer.
npm install --save-dev vue@latest
Install svelte2tsx v0.5.20 or newer.
npm install --save-dev svelte2tsx@latest svelte
Install astrojs-compiler-sync v0.3.1 or newer.
npm install --save-dev astrojs-compiler-sync@latest @astrojs/compiler
include in your tsconfig.json to include the component files (*.vue, *.svelte, and *.astro).{
"include": [
"**/*.vue", // with Vue
"**/*.svelte", // with Svelte
"**/*.astro", // with Astro
"**/*.ts",
"**/*.tsx"
]
}
overrides.parserOptions.parser option in your .eslintrc.cjs file.{
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "typescript-eslint-parser-for-extra-files",
"parserOptions": {
"project": "./tsconfig.json"
},
},
{
"files": ["*.vue"],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "typescript-eslint-parser-for-extra-files",
// Or
// "parser": {
// "ts": require("typescript-eslint-parser-for-extra-files")
// }
"project": "./tsconfig.json"
},
}
]
}
{
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "typescript-eslint-parser-for-extra-files",
"parserOptions": {
"project": "./tsconfig.json"
},
},
{
"files": ["*.svelte"],
"parser": "svelte-eslint-parser",
"parserOptions": {
"parser": "typescript-eslint-parser-for-extra-files",
// Or
// "parser": {
// "ts": require("typescript-eslint-parser-for-extra-files")
// }
"project": "./tsconfig.json"
},
}
]
}
{
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "typescript-eslint-parser-for-extra-files",
"parserOptions": {
"project": "./tsconfig.json"
},
},
{
"files": ["*.astro"],
"parser": "astro-eslint-parser",
"parserOptions": {
"parser": "typescript-eslint-parser-for-extra-files",
"project": "./tsconfig.json"
},
}
]
}
Angle bracket type assertions cannot be used:
This parser parses as JSX enabled, therefore angle bracket type assertions cannot be used. Use the as operator instead.
Welcome contributing!
Please use GitHub's Issues/PRs.
See the LICENSE file for license rights and limitations (MIT).
FAQs
An experimental ESLint custom parser for Vue, Svelte, and Astro for use with TypeScript. It provides type information in combination with each framework's ESLint custom parser.
The npm package typescript-eslint-parser-for-extra-files receives a total of 2,004 weekly downloads. As such, typescript-eslint-parser-for-extra-files popularity was classified as popular.
We found that typescript-eslint-parser-for-extra-files demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.