Skip to content

Using with xo instead of eslint #382

@OmgImAlexis

Description

@OmgImAlexis

I'm trying to get this working with xo which is a wrapper around eslint.
If I remove the vue plugin everything works fine.

Tell us about your environment

  • XO Version: 0.18.2
  • ESLint Version: 4.9.0
  • eslint-plugin-vue Version: 4.2.2
  • Node Version: v9.5.0

Please show your full configuration:

{
  "xo": {
    "extends": [
      "plugin:vue/base"
    ],
    "settings": {
      "import/core-modules": [
        "vue"
      ]
    },
    "semicolon": true,
    "space": "2",
    "overrides": [{
      "parserOptions": {
        "parser": "babel-eslint",
        "ecmaVersion": 2017,
        "sourceType": "module"
      }
    }]
  }
}

What did you do? Please include the actual source code causing the issue.

return new Promise(async (resolve, reject) => {
  try {
    const res = await this.$http.post('/', {
      body: {
        ...creds
      }
    });
    localStorage.setItem('token', res.body.token);
    commit(LOGIN_SUCCESS);
    resolve();
  } catch (err) {
    reject(err);
  }
});

What did you expect to happen?

➜  slim git:(master) ✗ xo store/index.js

  store/index.js:15:25
  ✖  15:25  localStorage is not defined.  no-undef
  ✖  42:11  localStorage is not defined.  no-undef
  ✖  51:7   localStorage is not defined.  no-undef

  3 errors

What actually happened? Please include the actual, raw output from ESLint.

➜  slim git:(master) ✗ xo store/index.js

  store/index.js:35:50
  ✖  35:50  Parsing error: Unexpected token =>  

  1 error

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