Skip to content

Instantly share code, notes, and snippets.

@progapandist
Last active April 9, 2019 21:29
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save progapandist/0c28831364c560d982b8bbed48226c96 to your computer and use it in GitHub Desktop.
Save progapandist/0c28831364c560d982b8bbed48226c96 to your computer and use it in GitHub Desktop.
{
"name": "evil_chat",
"private": true,
"dependencies": {
"@rails/webpacker": "^3.2.0",
"coffeescript": "1.12.7",
"normalize.css": "^7.0.0"
},
"scripts": {
"lint-staged": "$(yarn bin)/lint-staged"
},
"lint-staged": {
"config/webpack/**/*.js": [
"prettier --write",
"eslint",
"git add"
],
"frontend/**/*.js": [
"prettier --write",
"eslint",
"git add"
],
"frontend/**/*.css": [
"prettier --write",
"stylelint --fix",
"git add"
]
},
"pre-commit": [
"lint-staged"
],
"devDependencies": {
"webpack-dev-server": "^2.9.7",
"babel-eslint": "^8.0.1",
"eslint": "^4.8.0",
"eslint-config-airbnb-base": "^12.0.1",
"eslint-config-prettier": "^2.6.0",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-prettier": "^2.3.1",
"lint-staged": "^4.2.3",
"pre-commit": "^1.2.2",
"prettier": "^1.7.3",
"stylelint": "^8.1.1",
"stylelint-config-standard": "^17.0.0"
}
}
@vill
Copy link

vill commented Dec 7, 2017

Hi. I think it's better to use:

  1. .lintstagedrc instead of the block "lint-staged": {...}. package.json is a file only for dependencies and not for package configurations in my opinion.
  2. yarn [run] lint-staged (It’s also possible to leave out the run in this command, each script can be executed with its name) instead of the "$(yarn bin)/lint-staged"

Can try to use overcommit for the front-end and back-end code, though stylelint support is still not supposed to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment