admin管理员组文章数量:1245127
I'm importing some resources in my Vue file. The fact that it's Vue, though, have nothing to do with my question, I believe.
I import them as such:
import Vue from 'vue'
import { mapState, mapMutations } from 'vuex'
import ChessPiece from '../assets/classes/chesspiece'
import 'vue-awesome/icons/rotate-left'
import 'vue-awesome/icons/search'
ESLint then tells me:
Absolute imports should e before relative imports
I'm just wondering, why is this?
I'm importing some resources in my Vue file. The fact that it's Vue, though, have nothing to do with my question, I believe.
I import them as such:
import Vue from 'vue'
import { mapState, mapMutations } from 'vuex'
import ChessPiece from '../assets/classes/chesspiece'
import 'vue-awesome/icons/rotate-left'
import 'vue-awesome/icons/search'
ESLint then tells me:
Absolute imports should e before relative imports
I'm just wondering, why is this?
Share Improve this question asked Dec 10, 2017 at 1:05 Magnus BuvarpMagnus Buvarp 9767 silver badges19 bronze badges 2- 1 It probably the linter preference github./benmosher/eslint-plugin-import/blob/master/docs/… – Nandu Kalidindi Commented Dec 10, 2017 at 1:11
- 1 probably a carry-over or as a result from/of eslint-config-airbnb. – codeislife Commented Mar 12, 2018 at 23:49
1 Answer
Reset to default 14It's just an coding convention to make everything cleaner.
Usually absolute imports es from external library, and relative imports from your code.
本文标签: javascriptWhy should absolute imports come before relative importsStack Overflow
版权声明:本文标题:javascript - Why should absolute imports come before relative imports? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740209368a2241708.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论