The styleguide, lint files, and requireable helpers for consistent style at GoDaddy.
There are many useful features:
jscs. Many rules will fix themselves!
This styleguide is used by dozens of product teams at GoDaddy. Have a question or comment? Open an issue!
There are two ways to install and use this styleguide depending on your own tooling preference: directly using pre-built binaries.
npm i godaddy-style --save-dev
godaddy-js-stylebinaries in your
"scripts":"eslint": "godaddy-js-style-eslint lib/ test/""jscs": "godaddy-js-style-jscs lib/ test/""lint": "godaddy-js-style-lint lib/ test/"
n.b. All CLI flags are exposed through fashion-show. Auto-fix will be enabled by the
Due to issues with the babel-eslint parser plugin, ES5 isn't directly supported (yet). However, if you're still using ES5, you can add an
--es5 argument when calling the pre-built binaries, and we will switch to using the espree parser, which should allow eslint to work. The downside being that you can't use any ES6 features if you use the
--es5 argument; it's all or nothing for the moment.
"scripts":"eslint": "godaddy-js-style-eslint --es5 lib/ test/""jscs": "godaddy-js-style-jscs --es5 lib/ test/""lint": "godaddy-js-style-lint --es5 lib/ test/"
This project includes dotfiles with comments under the
dotfiles directory, but you should use the distributable versions of these files under
The styleguide uses
eslint for all correctness focused linting. All strictly style related checking (i.e. whitespace) is handled by
jscs. Only the rules exclusive to
eslint have been enabled or disabled accordingly to make sure there is no overlap with
The styleguide uses
jscs for all strictly style related checking. Many
jscs rules have auto-fixing enabled.
This section is a place for additional best practices that may be useful but are not strictly enforced by this styleguide. Have something to add here? Great! Submit a PR.
.eslintrcfile at the root of your project:
"extends": "./node_modules/godaddy-style/dist/.eslintrc""rules":// Disable the 'max-params' rule"max-params": 0
.eslintrcfile in your
"scripts":"eslint": "godaddy-js-style-eslint -c .eslintrc lib/ test/"
Fork this repository and submit a pull request.
Proposed modifications to the style guide should modify the files in
/dotfiles before running
npm run build when submitting a pull request. This repository utilizes the fashion-show module to generate the
/dist files to be checked in.
Great. We'd love to talk about it. Fork this repository and submit a pull-request.
No problem. Reach out to us by opening an issue