Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Bug: router/index.js needs repositioning of import #333

Closed
codeofsumit opened this issue Feb 4, 2017 · 1 comment
Closed

Minor Bug: router/index.js needs repositioning of import #333

codeofsumit opened this issue Feb 4, 2017 · 1 comment

Comments

@codeofsumit
Copy link

codeofsumit commented Feb 4, 2017

Reproduce like this:

vue init webpack project
Choose eslint with airbnb preset
choose vue-router

after npm install && npm run dev, router/index.js will look like this:

import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

import Hello from 'components/Hello'; // <-- eslint error

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Hello',
      component: Hello,
    },
  ],
});

ESLint will throw an error as import Hello from 'components/Hello'; needs to be above Vue.use(Router);.

I would've created a PR (guess the fix is simple) but to be honest: I have not the slightest clue how vue-cli works 😊. Sorry.

@posva
Copy link
Member

posva commented Feb 6, 2017

This should be open on the relevant template repository. But there's already a fix for it at vuejs-templates/webpack#478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants