https://github.com/privatenumber/vue-ast-utils
Utils for working with Vue 3 AST nodes
https://github.com/privatenumber/vue-ast-utils
ast utils vue vuejs3
Last synced: 7 months ago
JSON representation
Utils for working with Vue 3 AST nodes
- Host: GitHub
- URL: https://github.com/privatenumber/vue-ast-utils
- Owner: privatenumber
- Created: 2021-03-14T07:17:31.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2023-02-02T03:00:29.000Z (over 2 years ago)
- Last Synced: 2025-02-16T16:01:45.540Z (8 months ago)
- Topics: ast, utils, vue, vuejs3
- Language: TypeScript
- Homepage:
- Size: 80.1 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Utils for working with Vue 3 AST nodes
## 🙋♂️ Why?
Vue 3 comes with types, but ambient const enums cannot be accessed when building your project with [`isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules):```ts
import { NodeTypes } from '@vue/compiler-core';console.log(NodeTypes.ATTRIBUTE === Node.type);
// ⚠️ Cannot access ambient const enums when the '--isolatedModules' flag is provided. ts(2748)
```Related issue: [vue-next#1228](https://github.com/vuejs/vue-next/issues/1228)
These utils contain type checking so you don't need to import ambient types.
## 🚀 Install
```sh
npm i -D vue-ast-utils @vue/compiler-core
```