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

eslint-config-auto

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-auto

Automatically configure esLint based on project dependancies

  • 0.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
increased by22.4%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-auto

This config will automatically configure the airbnb esLint rules and a range of other plugins, based on the contents of your projects package.json file.

Install

To install this config, run the following command.

npm install eslint-config-auto --save-dev

Configure

Create an .eslintrc file with the following contents.

{
  "extends": ["auto"]
}

You can now include html, json and markdown in the list of files passed to eslint to lint any JavaScript contained.

{
  "scripts": {
    "eslint": "eslint --color --ext .html,.js,.json,.jsx,.md,.ts,.tsx *.* src",
    "eslint:fix": "npm run eslint -- --fix"
  }
}

* If you have TypeScript installed you may need to remove any unused filetypes from the above.

Install Dependencies

After you have configured eslint to include this package, the first time you run eslint it will output the npm command to install the dependencies required for your project. Copy and paste this command into the console, and you are then ready to start linting.

Rules

AirBNB

The most appropreate version of the AirBNB eslint config will be automatically selected

Adjunct

The eslint-config-adjunct config is included, this will install a range of reasonable plugins based on your project's dependancies, that cover best practices, popular utility librarys, security and testing frameworks.

Babel

If the project includes Babel, then eslint-plugin-babel will be loaded and the parser will be set to babel-eslint.

Compat

If no transpiler is detected and env.browser = true in your .eslintrc, then eslint-plugin-compat is loaded.

Node

If env.node = true in your .eslintrc file, then eslint-plugin-node is loaded.

React

If a project contians React, then a React version of the AirBNB config will be used.

Prettier

If prettier is installed, any rules that may conflict with Prettier will be disabled. The plugin should read you Prettier config from your project's root.

The prettier configs for different eslint plugins are also automatically included based on which eslint plugins have been installed into your project.

TypeScript

If the project includes TypeScript, then the rules will adapt to lint typescipt files and the parser will be set to @typescript-eslint/parser for ts and tsx filetypes.

Keywords

FAQs

Package last updated on 29 Jun 2020

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