question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using with xo instead of eslint

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mysticateacommented, Feb 8, 2018

If the overrides is ESLint’s overrides, maybe you have to write files property to specify that the override entry affects what files.

0reactions
OmgImAlexiscommented, Feb 8, 2018

For anyone finding this you need to add the files property. This works perfectly. Thank you.

    "overrides": [
      {
        "files": [
          "**/*"
        ],
        "parserOptions": {
          "parser": "babel-eslint",
          "ecmaVersion": 2018,
          "sourceType": "module"
        }
      }
Read more comments on GitHub >

github_iconTop Results From Across the Web

xojs/xo: ❤️ JavaScript/TypeScript linter (ESLint ... - GitHub
Opinionated but configurable ESLint wrapper with lots of goodies included. Enforces strict and readable code. Never discuss code style on a pull request ......
Read more >
eslint-config-xo-react | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
eslint-config-xo-react - npm Package Health Analysis - Snyk
The npm package eslint-config-xo-react was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
Find and fix problems in your JavaScript code - ESLint ...
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Eslint-config-xo - npm.io
XO is an ESLint wrapper with great defaults. Here are some reason why you should use the XO CLI instead of this config:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found