jlengstorf / learn-rollup

This is an example project to accompany a tutorial on using Rollup.
https://code.lengstorf.com/learn-rollup-js/
ISC License
191 stars 61 forks source link

error Strings must use singlequote quotes #21

Closed zhangwei900808 closed 7 years ago

zhangwei900808 commented 7 years ago
qq20170109-215502 2x
/**
 * Says hello.
 * @param  {String} name a name
 * @return {String}      a greeting for `name`
 */
export function sayHelloTo( name ) {
  const toSay = `Hello, ${name}!`;

  return toSay;
}

/**
 * Says goodbye.
 * @param  {String} name a name
 * @return {String}      a farewell for `name`
 */
export function sayGoodbyeTo( name ) {
  const toSay = `Later, ${name}!`;

  return toSay;
}
jlengstorf commented 7 years ago

It looks like ESLint isn't quite set up correctly. Can you point me to the repo where you're getting this error?

zhangwei900808 commented 7 years ago

yes, It's found in part-2-starer switch

jlengstorf commented 7 years ago

Sorry, I meant your repo — can you link me to your repo that isn't working?

stasgavrylov commented 7 years ago

@jlengstorf @zhangwei900808 the problem is not in the repo itself, but rather in the article - https://code.lengstorf.com/learn-rollup-js/ I also stumbled across it, but managed to find a solution. In step 3 "Update rollup.config.js" part you put eslint plugin after babel, but it should be placed before, since in that case it lints the code already transpiled by Babel. I'd sent a PR, but the article is not in the repo :)

Btw, thanks for the tutorial, it's awesome.

jlengstorf commented 7 years ago

Thanks, @stasgavrylov! I do keep the articles on GitHub (here's the section you're referencing): https://github.com/jlengstorf/code.lengstorf.com/blob/master/content/blog/learn-rollup-js.md#update-rollupconfigjs-1

If you have time to submit a PR, that would be very much appreciated. Thanks so much for posting the solution here, either way.

stasgavrylov commented 7 years ago

@jlengstorf I'm glad I could help, and PR is already waiting. Thanks for pointing me to the article repo.