This package provide's Waymark's base JavaScript ESLint configuration. It is primarily an extension from eslint-config-airbnb.
This is intended to be used for any Waymark JavaScript projects (within the main repository or not).
(Borrowed from eslint-config-airbnb.)
First, install this package:
# For latest
npm install --save-dev github:stikdev/eslint-config-waymark
# For specific version (preferred)
npm install --save-dev github:stikdev/eslint-config-waymark#v0.1.0
Note: Don't forget to additionally install the dependencies!
Next, create an ESLint configuration file that
extends from eslint-config-waymark:
e.g. .eslintrc.json
{
"extends": ["eslint-config-waymark"]
}
This is a working spec of our JavaScript styleguide. It is meant (and should be expected) to evolve.
class-methods-use-thisis enabled. We currently have a lot of legacy code that uses class methods which fail to referencethis.- The
import/resolverplugin is not configured to look for a Webpack configuration. This means that any project that wishes to use this ESLint configuration and Webpack either has to (a) disable theimport/no-unresolvedrule or (b) specifyimport/resolverto look for the Webpack configuration. - Notice that
eslint-config-prettieris referenced in the configuration. This is making the presumption that a project using this configuration will also be using Prettier for formatting. It would be nice to makeprettier.js(included in this repository only for reference as Waymark's Prettier standard) more extensible, but "shareable configurations" aren't currently supported. So, for now, please use Prettier as well or you'll have to manually disable these rules/plugins in a config that extendseslint-config-waymark.
- It might be nice to split this out into a
eslint-config-waymark-core,eslint-config-waymark-react, etc. Right now there are a lot of peer dependencies when using this. - (Introduced in v0.1.1) Would like to be able to raise a warning if someone defines a static class method via
babel-plugin-transform-class-properties without using
thisinside the method. Same functionality as thebabel/no-invalid-thissetting, but something that plays nice with ourbabel-eslintparser.
To publish a new release to this project:
- Make changes and commits as needed
- Update the Changelog in the README
- Publish a new version (using semver)
npm version v0.1.1
- Push your changes
- Push your new tag
git push origin v0.1.1
After these steps, someone should be able to install your new version via:
npm install -save-dev github:stikdev/eslint-config-waymark#v0.1.1
- The initial release
- Adds
babel-eslintparser to ensure that static class methods don't cause linting errors.
- Now enforcing the
no-underscore-dangledefault from eslint-config-airbnb - Removes no-longer-necessary peer dependencies
- Adds required
babel-eslintpeer dependency
- Adds
eslint-plugin-react-hooksfor linting new react components made with hooks