1.0.1 • Published 4 years ago

@sonder/eslint-config v1.0.1

Weekly downloads
501
License
UNLICENSED
Repository
github
Last release
4 years ago

Eslint Config Sonder npm version

Provide Sonder's .eslintrc as an extensible shared config

Installation

Install package and it's peer dependencies

yarn add @sonder/eslint-config babel-eslint eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-react --dev

Usage

Inside a .eslintrc file in your repository's root folder, add this config:

{
  "extends": "@sonder",
  "rules": {
    // Repo-specific rules to override this config
  }
}

Testing

To prove/validate that a rule is validating what it is supposed to, add a test each time a rule is added or modified in this repo, not the extended rule sets.

  • Files under test/error/ do not follow eslint rules and should throw eslint errors.
  • Files under test/pass/ follow eslint rules and should throw no error.

Add all validFiles and errorFiles to test/test.js and run:

yarn test
All checks passed!

Contributing

  1. Clone this repo - git clone git@github.com:Flatbook/eslint-config-sonder.git
  2. Update the rules in index.js
  3. Commit & Push changes to git - git commit -m "Add rule XYZ"
  4. Publish to npm - yarn publish --new-version minor