GithubHelp home page GithubHelp logo

eslint-config-react's Introduction

Eslint Setup of me.rinta ๐Ÿ“ฆ

These are my settings for ESLint โšก๏ธ

What it does

  • Lints JavaScript based on the latest standards
  • Fixes issues and formatting errors with ESlint Formatter
  • Check for accessibility rules on JSX elements.

Local / Per Project Install

  1. If you don't already have a package.json file, create one with npm init.

  2. Then we need to install everything needed by the config:

npx install-peerdeps --dev @me.rinta/eslint-config-react
  1. You can see in your package.json there are now a big list of devDependencies.

  2. Create a .eslintrc of .eslint.config.js file in the root of your project's directory (it should live where package.json does). Your eslint config file should look like this:

{
  "extends": [
    "@me.rinta/eslint-config-react"
  ]
}
  1. You can add two scripts to your package.json to lint and/or fix:
"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
},

With VS Code

Once you have done. You probably want your editor to lint and fix for you.

  1. Install the ESLint package
  2. Now we need to setup some VS Code settings via Code/File โ†’ Preferences โ†’ Settings. Click to the {} icon in the top right corner and add this :
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

With Create React App

  1. You need to eject first npm run eject or yarn eject
  2. Run npx install-peerdeps --dev @me.rinta/eslint-config-react
  3. Open your package.json and replace "extends": "react-app" with "extends": ["@me.rinta/eslint-config-react"]

eslint-config-react's People

Contributors

rinta01 avatar

Watchers

 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.