Skip to content

Instantly share code, notes, and snippets.

@jankalfus
Last active April 24, 2018 13:19
Show Gist options
  • Save jankalfus/50d6f5fc1fb822583ab5d6ee969cee9d to your computer and use it in GitHub Desktop.
Save jankalfus/50d6f5fc1fb822583ab5d6ee969cee9d to your computer and use it in GitHub Desktop.
Setup linters, hooks

package.json dev dependencies

"devDependencies": {
	"eslint-watch": "^3.1.4",
	"husky": "^0.14.3",
	"prettier": "1.12.1",
	"pretty-quick": "^1.4.1",
	"stylelint": "^9.2.0",
	"stylelint-scss": "^3.0.1"
}

package.json scripts

	"precommit": "pretty-quick --staged && npm run lint-precommit",
	"prepush": "npm run lint-prepush",
	"lint-watch": "esw src --color --watch",
	"lint-precommit": "npm run lint-scss && npm run lint-js",
	"lint-prepush": "npm run lint-scss && npm run lint-js-strict",
	"lint-scss": "stylelint src/**/*.scss",
	"lint-js": "eslint src/**/*.js",
	"lint-js-strict": "npm run lint-js -- --max-warnings=0"--max-warnings=0"

.editorconfig

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_size = 4
max_line_length = 100
trim_trailing_whitespace = true

[*.json]
indent_style = tab
indent_size = 2

.stylelintrc.json

{
	"plugins": ["stylelint-scss"]
}

.prettierrc

{
	"singleQuote": true,
	"trailingComma": "es5",
	"printWidth": 100,
	"tabWidth":4,
	"useTabs": true,
	"arrowParens": "always"
}

.eslintrc.json

{
	"extends": ["react-app"],
	"rules": {
		"no-console": "warn"
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment