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

how to easily use standard with prettier? #996

Open
capaj opened this issue Oct 2, 2017 · 7 comments

Comments

@capaj
Copy link
Contributor

commented Oct 2, 2017

I'd like to use prettier to format my code and standard.js for checking unused variables, triple equals and all it's rules. There is one problem though-in all of my repos, I need to disable few standard.js rules to make it work-like this:

{
  "extends": ["standard", "plugin:flowtype/recommended"],
  "rules": {
    "prettier/prettier": "error",
    "space-before-function-paren": "off",
    "standard/computed-property-even-spacing": "off",
    "flowtype/generic-spacing": "off",
    "no-unexpected-multiline": "off",
    "indent": "off",
    "jsx-quotes": "off"
  },
  "parser": "babel-eslint",
  "plugins": ["flowtype", "prettier"],
  "root": true
}

is there any way to get only standard rules which are not about formatting? Something like standard-config-noformatting that I could extend instead?

@whphhg

This comment has been minimized.

Copy link

commented Oct 7, 2017

I don't want to derail this issue, but can you please share further which packages are required for this to work?

I've been using prettier-standard and it was great so far, but after the update to 7.0.1 I ran into sheerun/prettier-standard#30 which is causing some issues.

@capaj

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2017

@whphhg there are quite a few. I should probably make a boilerplate or maybe try t oseparate those standard.js rules into standard-config-noformatting

"devDependencies": {
    "babel-eslint": "^8.0.1",
    "eslint": "^4.8.0",
    "eslint-config-prettier": "^2.6.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-config-standard-jsx": "^4.0.2",
    "eslint-plugin-flowtype": "^2.37.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.2.0",
    "eslint-plugin-prettier": "^2.3.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-react": "^7.4.0",
    "eslint-plugin-standard": "^3.0.1",
    "husky": "^0.14.3",
    "lint-staged": "^4.2.3",
    "prettier": "^1.7.3"
  },
  "lint-staged": {
    "*.{js,json,css}": ["prettier --write", "git add"],
    "*.js": ["eslint --fix", "git add"]
  }
@whphhg

This comment has been minimized.

Copy link

commented Oct 7, 2017

Thanks for sharing and updating the .eslintrc!

It's longer than my current devDep's but at least I know exactly what's going on and how to alter it through .eslintrc & .prettierrc (plus it's nicely grouped by eslint-).

@jasonkarns

This comment has been minimized.

Copy link

commented Dec 21, 2017

FWIW, I'm having success with following lint script:

lint
    prettier-standard $npm_package_directories_src'/**/*.js' && standard --fix | standard-tap
@lydell

This comment has been minimized.

Copy link

commented Jan 31, 2018

Sounds like you're looking for https://github.com/prettier/eslint-config-prettier?

@eddiemonge

This comment has been minimized.

Copy link

commented Feb 7, 2018

duplicate of #811 ?

@stale

This comment has been minimized.

Copy link

commented May 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.