sheerun / prettier-standard

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

prettier-standard on vscode #46

Closed yuriploc closed 6 years ago

yuriploc commented 6 years ago

I love what the package does on cli. Is there a way of formatting with it in vscode?

I have the dbaeumer.vscode-eslint-1.4.5 extension installed and I would like to keep using my .eslintrc

Edit: my .estlintc

{
  "extends": ["standard"],
  "rules": {
    "camelcase": 0
  },
  "env": {
    "browser": true,
    "es6": true
  },
  "globals": {
    "app": true,
    "moment": true
  }
}
sheerun commented 6 years ago

maybe use this with prettier-eslint option

yuriploc commented 6 years ago

Awesome!

For documentation purposes, my files (or at least, the most important parts):

settings.json

{
    "prettier.eslintIntegration": true,
    "editor.formatOnSave": false,
    "[javascript]": {
        "editor.formatOnSave": true
    },
    "javascript.validate.enable": true,
    "eslint.alwaysShowStatus": true
}

devDependencies in package.json:

"devDependencies": {
    "eslint": "^4.15.0",
    "eslint-config-standard": "^11.0.0-beta.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-node": "^5.2.1",
    "eslint-plugin-promise": "^3.6.0",
    "eslint-plugin-standard": "^3.0.1",
    "prettier": "^1.10.2",
    "prettier-standard": "^8.0.0",
}

.eslint is still the same.

Thank you @sheerun

OlivierCuyp commented 5 years ago

@sheerun I followed the issue #811 on standard repo. I was hoping to find some conclusion after a long reading but the simple solution doesn't seems to be ready yet... This project is the closest to what I expect/need (semistandard + prettier). But unfortunately, the vscode prettier-standard extension isn't based on this project and thus missing the semicolon option... Could you and @numso merge your efforts ?

benjick commented 5 years ago

How would I use this in atom?

NathanielHill commented 5 years ago

@sheerun

I'm just using a simple vscode extension to run prettier-standard on files when saved.

Is there a way to get linting as I type? That's the one thing I miss from standard and the standard vscode extension.

I'd prefer to do that without adding back dependencies. One of the nice features of prettier-standard is that it significantly reduced my explicit dependencies and config :ok_hand:

sheerun commented 5 years ago

prettier-standard doesn't support linting. You can use e.g. healthier for linting

NathanielHill commented 5 years ago

I ended up switching to vanilla prettier and using healthier for linting. The only difference in my code base between this module and vanilla prettier was spaces after function names. Not a big deal for me, and worth sticking with the main package. But, nice project and thanks for the work :+1: :+1:

(I was trying this, because I naively thought I could use prettier and standard together)