eslint-config-helpshift
v2.0.1
Published
Shareable ESLINT config containing rules used at Helpshift.
Maintainers
Readme
eslint-config-helpshift
A shareable ESLint configuration that enforces a consistent JavaScript/React coding style across all your projects.
Table of contents
- Installation
- Usage
- Adding to Your Project
- Using the
helpshiftconfig witheslint:recommended - Editor Integration
- Contributing
- License
Installation
First, install the package along with its peer dependencies:
npm install --save-dev eslint-config-helpshiftOr if you're using yarn:
yarn add --dev eslint-config-helpshiftUsage
Create or modify your .eslintrc.js file:
module.exports = {
extends: "eslint-config-helpshift",
// Your project-specific rules/overrides can go here
};Or if you're using JSON:
{
"extends": "eslint-config-helpshift"
}Adding to Your Project
We recommend adding the following scripts to your package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Using the helpshift config with eslint:recommended
There are several rules in the eslint:recommended ruleset that Helpshift style is not opinionated about that you might want to enforce in your project.
To use Helpshift style in conjunction with ESLint's recommended rule set, extend them both, making sure to list eslint-config-helpshift last:
{
"extends": ["eslint:recommended", "eslint-config-helpshift"],
"rules": {
// Additional, per-project rules...
}
}To see how the helpshift config compares with eslint:recommended, refer to the source code of index.js, which lists every ESLint rule along with whether (and how) it is enforced by the helpshift config.
Editor Integration
For the best experience, we recommend integrating ESLint with your editor:
VS Code
- Install the ESLint extension
- Add the following to your VS Code settings:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "javascriptreact"]
}Contributing
If you'd like to contribute to this ESLint config, please see our Contributing Guidelines.
License
MIT © Helpshift
