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

Migrate linting from standard to XO #20

Merged
merged 1 commit into from
Oct 15, 2016
Merged

Migrate linting from standard to XO #20

merged 1 commit into from
Oct 15, 2016

Conversation

jfmengels
Copy link
Contributor

@jfmengels jfmengels commented Oct 15, 2016

Migrate linting from standard to XO, to have a consistent linter and style accross the Zeit projects, as requested by @leo.

Notes:

  • I added a comment to disable ava/no-ignored-test-files. It's a rule that warns you against using ava in files that will not be run by AVA (because they are not in the default or custom glob, which in this case is "build/test/*.js").

You could:

  • Leave the comment as is, or disable the rule altogether (on such a small project, that's probably the way to go as the test process is already set up)
  • Or modify the AVA config so that it transpiles your code like the following:
{
  "...": "...",
  "ava": {
    "...": "...",
    "babel": {
      "babelrc": true, // If you have a babelrc file
      "presets": ["es2015", "stage-2"] // along with plugins, if you don't
    },
    "require": [ // Similar to `ava --require babel-register`
      "babel-register"
    ]
  }
}

That way, you get:

  • the safety of that eslint rule
  • You don't have to build your tests (if that makes things easier)
  • You may get better error reports, with regards to stacktraces and reports of where the error comes from

@leo
Copy link
Contributor

leo commented Oct 15, 2016

It's ok like that, thanks! 😊

@leo leo merged commit 665e6a2 into vercel:master Oct 15, 2016
@jfmengels jfmengels deleted the xo branch October 15, 2016 10:33
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

Successfully merging this pull request may close these issues.

2 participants