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

semi-colons are not removed when import('./file') is used #3

Closed
faceyspacey opened this issue Mar 23, 2017 · 13 comments
Closed

semi-colons are not removed when import('./file') is used #3

faceyspacey opened this issue Mar 23, 2017 · 13 comments

Comments

@faceyspacey
Copy link

It appears the new import().next syntax breaks prettier-standard--at least when using it without an .eslintrc.js file.

@sheerun
Copy link
Owner

sheerun commented Mar 23, 2017

What eslint or prettier configuration can fix it?

@sheerun
Copy link
Owner

sheerun commented Mar 23, 2017

Hmm, it seems semicolons won't be removed if eslint encounters syntax error while parsing..

@sheerun
Copy link
Owner

sheerun commented Mar 23, 2017

@faceyspacey This needs to be fixed in here: https://github.com/prettier/prettier-eslint/issues

Could you raise this issue there?

@flybayer
Copy link

flybayer commented Apr 8, 2017

I think I'm having a similar issue.

Semicolons are not removed when I have ES6 classes with something = something else syntax like

  state = {
    ...
  }

  startRecording = (data) => {
    ...
  }

I tried using babel/semi as suggested in prettier/prettier-eslint#32 and prettier/prettier-eslint#56 but that's not working.

I have

  "eslintConfig": {
    "plugins": [
      "babel"
    ],
    "rules": {
      "babel/semi": [
        "error",
        "never"
      ]
    }
  },

@sheerun
Copy link
Owner

sheerun commented Apr 9, 2017

@flybayer Could you raise this issue to https://github.com/prettier/prettier-eslint/issues ?

@justsee
Copy link

justsee commented Apr 14, 2017

@flybayer thanks for the head's up on the relevant tickets.

babel/eslint-plugin-babel#121 was merged and the test case supplied outlines an appropriate .eslintrc.

Once that's in place and eslint-plugin-babel is installed files should be processed correctly.

@flybayer
Copy link

@justsee thank you for the .eslintrc link!

I got it working!

On top of prettier-standard, you must install babel-eslint and eslint-plugin-babel.

Then add this to package.json:

  "eslintConfig": {
    "parser": "babel-eslint",
    "plugins": [
      "babel"
    ],
    "rules": {
      "babel/semi": [
        2,
        "never"
      ]
    }
  }

@danawoodman
Copy link

danawoodman commented Apr 17, 2017

This is unfortunate as now it means you cannot use prettier-standard out of the gate with any project without configuration. Will this no longer be relevant when prettier-eslint fixes things or is this always going to be the case?

@sheerun
Copy link
Owner

sheerun commented Apr 17, 2017 via email

@sheerun
Copy link
Owner

sheerun commented Apr 18, 2017

This issue on prettier-eslint needs to be fixed first, please help to make it so:

prettier/prettier-eslint#68

@sheerun
Copy link
Owner

sheerun commented Apr 19, 2017

@faceyspacey This should be fixed in 4.1.0, could you check?

@sheerun
Copy link
Owner

sheerun commented Apr 19, 2017

Also, please feel free to add yourself to contributors list

@danawoodman
Copy link

@sheerun nice, this seems to do it! Thanks! 🍻

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 a pull request may close this issue.

5 participants