Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amedia/eslint-config-react

Package Overview
Dependencies
Maintainers
51
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amedia/eslint-config-react

ESLint react configuration to be used by developers at Amedia

  • 5.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-13.91%
Maintainers
51
Weekly downloads
 
Created
Source

@amedia/eslint-config-react

Common ESLint/Prettier configuration for React that extends @amedia/eslint-config-base.

Install

You need to install this package and it's peer dependencies. You install the package by running:

npm i --save-dev @amedia/eslint-config-react

Then, to install the peer dependencies you can use install-peerdeps like this:

npx install-peerdeps --dev @amedia/eslint-config-react

Or you can do it manually by running:

npm info "@amedia/eslint-config-react" peerDependencies
npm install --save-dev @amedia/eslint-config-react

Usage

There are a few ways to include the eslint config in your project. Make sure you dont have any other settings for eslint or prettier already in your editor workspace or global. Select one of the options below:

Using package.json:

{
  "eslintConfig": {
    "extends": ["@amedia/eslint-config-react", "plugin:import/recommended"]
  }
}

Using .eslintrc:

{
  "extends": ["@amedia/eslint-config-react", "plugin:import/recommended"]
}

or .eslintrc.js:

module.exports = {
  extends: ['@amedia/eslint-config-react', 'plugin:import/recommended'],
};

You also need to set up a prettier config.

Prettier

This is how you use or extend the @amedia/eslint-config-base prettier config in your app. Select one of options below:

Using package.json:

{
  "prettier": "@amedia/eslint-config-base/prettier.config"
}

Using .prettierrc:

"@amedia/eslint-config-base/prettier.config"

or prettier.config.js:

module.exports = require('@amedia/eslint-config-base/prettier.config');

Are you using VS Code?

Install these extensions for VS Code:

create a folder .vscode, and a file settings.json with the following:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",

  "editor.formatOnSave": true,
  "[yaml]": {
    "editor.formatOnSave": false
  },
  "[javascript]": {
    "editor.detectIndentation": true
  },
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

Linting scripts

You might want to add these two scripts in you package.json.

"scripts": {
  "lint": "eslint bin lib",
  "lint-fix": "eslint --fix bin lib"
},

Keywords

FAQs

Package last updated on 01 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc