Skip to content

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

Closed
@codeofsumit

Description

@codeofsumit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions