@mgtitimoli/eslint-config-react

0.2.1 • Public • Published

@mgtitimoli / eslint-config-react

An ESLint Shareable Config to be used on projects that use React

Installation

$ npm install --save-dev \
eslint \
eslint-plugin-react \
@mgtitimoli/eslint-config-react

😱 What?! Why I also need to install all these packages?!

I completely understand your feeling, so let me briefly enumerate the reasons of why they are required:

I guess you won't be here if you did not know ESLint, but just in case, taken for their page:

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, its goal is to provide a pluggable linting utility for JavaScript.

This is the THE GUY 😎 in this config; all of the rules specified here are from this excellent plugin

Usage

General

ESLint allows being configured using a widely amount of flavours, but I personally find the followings very practical:

  • Place all the settings under an eslintConfig entry in your package.json:
{
    "name": "my-awesome-project",
    "eslintConfig": {
        "extends": "@mgtitimoli/eslint-config-react"
    }
}
  • Create an .eslintrc.json to hold all the configuration:
{
    "extends": "@mgtitimoli/eslint-config-react"
}

Custom

This configuration, at the same time, extends the following configurations:

You can pick just the one(s) that you need, specifying them as follows:

  • For example, if you would want to use only jsx configuration, then your .eslintrc.json should contain:
{
    "extends": "@mgtitimoli/eslint-config/jsx"
}

Other configurations

You might also be interested in the following configurations:

License

Unlicense

Readme

Keywords

Package Sidebar

Install

npm i @mgtitimoli/eslint-config-react

Weekly Downloads

2

Version

0.2.1

License

Unlicense

Last publish

Collaborators

  • mgtitimoli