Giter VIP home page Giter VIP logo

eslint-config-rainforest's Introduction

Eslint Config at Rainforest

To install the eslint plugin simply execute in your terminal:

yarn add -DE @rainforestqa/eslint-config eslint @babel/core @babel/eslint-parser eslint-plugin-babel eslint-plugin-import eslint-plugin-jsx-a11y prettier

In your eslint configuration, add @rainforestqa/eslint-config to extends

Import the prettier config (prettier.config.js) as outlined in sharing configurations

optional:

If using react: yarn add -DE eslint-plugin-react

In your eslint configuration, add @rainforestqa/eslint-config/react to extends

If using flow: yarn add -DE eslint-plugin-flowtype

In your eslint configuration, add @rainforestqa/eslint-config/flow to extends

Editor configuration

VSCode

Install the eslint and prettier extensions add these to your settings file:

{
  "javascript.validate.enable": false, // turn off vscode's built in linter because it doesn't follow our eslint config
  "editor.codeActionsOnSave": {
    "source.fixAll": true // unless you want to manually fix the lint errors
  },
  "editor.tabSize": 2, // will conflict with prettier otherwise
  "editor.wordWrapColumn": 120,
  "css.validate": false, // not working for css modules currently
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

Also in projects that use flow, it's useful to install flow for vscode

Webstorm

The setup should be picked up automatically from the repository's .eslint.rc.* and package.json. Here is where to look in case something doesn't work as expected: Eslint - Choose Webstorm / Preferences from the main menu and type eslint into the seach bar, this will show up all related config sections:

  1. Languages & Frameworks / JavaScript / Code Quality Tools / ESLint is the main lint config section. Make sure the Enable checkbox on top is checked, the Node interpreter is set to the Project node version, and the ESLint package is from the local node_modules folder. The Automatic search option from the Configuration file section is working fine for most scenarios.
  2. Keymap allows you to setup key shortcuts for fixing lint problems.

Prettier - An official Prettier plugin is available starting from version 2018.1. Again go to Preferences but write prettier this time. The configuration is under Languages & Frameworks / JavaScript / Prettier and the only thing you can do is to point the IDE to the related package folder.

Versioning Policy

  • Patch release (x.y.z -> x.y.z+1): bugfixes and tooling updates mean that code that previously passed linting should continue to pass after the update.

  • Minor release (x.y.z -> x.y+1.0): a change to an existing rule means that code that previously failed linting may now pass, or a new configuration means that code that previously passed linting should continue to pass.

  • Major release (x.y.z -> x+1.0.0): a new rule, or a change to an existing rule, means that code that previously passed linting will not pass any more.

eslint-config-rainforest's People

Contributors

ajfunk avatar jkaipr avatar juliankrispel avatar prayogoa avatar pscohn avatar rockacola avatar ziahamza avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.