https://github.com/calvin-ll/import-sort-parser-babel-vue
An import-sort parser for Vue based on import-sort-parser-babylon
https://github.com/calvin-ll/import-sort-parser-babel-vue
Last synced: over 1 year ago
JSON representation
An import-sort parser for Vue based on import-sort-parser-babylon
- Host: GitHub
- URL: https://github.com/calvin-ll/import-sort-parser-babel-vue
- Owner: Calvin-LL
- License: mit
- Created: 2020-04-18T19:57:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:44:56.000Z (over 3 years ago)
- Last Synced: 2025-02-16T17:25:20.453Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 367 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# import-sort-parser-babel-vue
Vue parser for import-sort. Works with typescript or flow in Vue Single File Components, or just plain typescript or flow code. Most of the code is from [import-sort-parser-babylon](https://github.com/renke/import-sort/tree/master/packages/import-sort-parser-babylon).
# Set-up
[See more about importsortrc](https://github.com/renke/import-sort#using-a-different-style-or-parser)
#### Add the following in `.importsortrc`
```
".js, .jsx, .es6, .es, .mjs, .ts, .tsx, .vue": {
"parser": "import-sort-parser-babel-vue",
"style": "eslint"
}
```
#### Or add the following in `package.json`
```
"importSort": {
".js, .jsx, .es6, .es, .mjs, .ts, .tsx, .vue": {
"parser": "import-sort-parser-babel-vue",
"style": "eslint"
}
}
```
Personally I prefer `"style": "module"`, you'll need to install `import-sort-style-module`.
# Result
The extra line above the first import is unavoidable because of the design of [import-sort](https://github.com/renke/import-sort)
```
import Vue from "vue";
export default Vue.extend({
});
@import "@/assets/mixins";
.container {
}
```