sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

semi-colons not being removed #15

Closed AlecRust closed 7 years ago

AlecRust commented 7 years ago

Running prettier-standard 'src/*.js' formats my code with prettier, but also adds back in semi-colons so it no longer adheres to Standard.

I can work around it by adding an .eslintrc of the following, but I expected this to be default behaviour:

{
  "rules": {
    "semi": ["error", "never"]
  }
}

Is there a way to pass options to the underlying prettier instance? Could then pass --no-semi, but ideally this package would handle this anyway.

sheerun commented 7 years ago

That shoudn't happend. Could post the file?

AlecRust commented 7 years ago

@sheerun what file are you after? I'm running this like prettier-standard 'src/**/*.js'. Should note this is still happening in v6.0.0.

sheerun commented 7 years ago

The defualt behavior is to strip semicolons. It seems you have .eslintrc somewhere that disables this behavior. Then you're left with overriding this with another .eslintrc.

Here's what happens for me:

prettier-standard --version
6.0.0
echo "foo; bar;" | prettier-standard
foo
bar

The behavior you're describing would be a bug, but I need a way to reproduce it, if it really is.

AlecRust commented 7 years ago

@sheerun I don't have an .eslintrc in the project as I'm using Standard, but yes I do have one at ~/.eslintrc containing the following:

{
  "extends": [
    "eslint:recommended"
  ]
}

Removing this fixes the problem. Should prettier-standard be picking this up though?

sheerun commented 7 years ago

Well, that's the default behavior of eslint itself as well.