Skip to content

helpshift/eslint-config-helpshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-helpshift

A shareable ESLint configuration that enforces a consistent JavaScript/React coding style across all your projects.

Table of contents

Installation

First, install the package along with its peer dependencies:

npm install --save-dev eslint-config-helpshift

Or if you're using yarn:

yarn add --dev eslint-config-helpshift

Usage

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

  1. Install the ESLint extension
  2. 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

About

A shareable ESLint configuration that enforces a consistent JavaScript/React coding style across all your projects.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •