@weandthem/eslint-config
v0.0.48
Published
Shared ESLint config for We and Them projects
Downloads
14
Readme
ESLint Config
This repo serves as the shared ESLint config for We and Them projects.
Table of contents
Using this package
Install this package and its peer dependencies as dev dependencies in your project:
$ npm i -D eslint prettier @weandthem/eslint-config @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-import eslint-plugin-jest eslint-plugin-jest-formatting eslint-plugin-prettier eslint-plugin-react eslint-plugin-simple-import-sort eslint-plugin-spellcheck eslint-plugin-typescript-filenames eslint-plugin-unicorn
Extend your
.eslintrc.js
with this packageextends: ['@weandthem/eslint-config'],
Override rules in your local
.eslintrc.js
as necessary
Developing
Setup
Clone this repo
$ git clone https://github.com/WeAndThem/eslint-config.git
Enter the cloned directory
$ cd eslint-config
Install dependencies
$ npm install
VS Code is recommended because this repo includes environmental settings that help create a consistent development environment across engineers. Upon opening this repo in VS Code, you'll be prompted to install recommended extensions.
File Structure
.github/workflows/
GitHub Actions configs.vscode/
Shared VS Code configscripts/
Shell scripts used with Husky git hooksindex.js
Shared ESLint configuration
Development flow
Do not work on
master
! Create local branches off ofmaster
. We have git hooks configured to prevent committing or pushing tomaster
. Forking is disabled for this repo.Keep commits small and commit messages relevant. Prepend the Jira ticket number to at least one of your commits for reporting.
Example:
HAR-94: add sorting rule
pre-commit and pre-push hooks should help maintain consistent code styles, but can also be run manually as necessary:
$ npm run prettify
Test changes locally against another We and Them project by linking this module globally:
$ npm link
Then, in another We and Them project that consumes this config:
$ npm link @weandthem/eslint-config
Changes made in this project are immediately reflected in the other project until the link is broken.
Bump the project version in
package.json
Run
npm install
to update the version inpackage-lock.json
Commit
package.json
andpackage-lock.json
in an isolated commit with the following convention:$ git commit -m 'Release 0.0.6'
The GitHub action that publishes the package will read this commit and tag the release appropriately.
Open pull requests against
master
and select an assignee to review the changes.The assignee leaves any necessary comments and selects either "approve" or "reject" on GitHub.
Once the PR is approved, the author performs the merge.
A GitHub Action will publish the package automatically.
Projects consuming this config will need to run
npm update
to receive the changes.