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

eslint-config-adjunct

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-adjunct

A reasonable collection of plugins to use alongside your main esLint configuration

  • 4.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
increased by64.36%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-adjunct

A reasonable collection of plugins to use alongside your main esLint configuration.

This config is designed to be used alongside any of the major esLint configs, such as airbnb, standard or eslint:recommended. It provides a range of useful plugins that are often too time-consuming to setup and provides an easy way to install just the plugins you need, based on your project's dependencies.

Install

To install this config, run the following command.

npm install eslint-config-adjunct --save-dev

Configure

Extend your .eslintrc, with adjunct, which should be the last item in the extends array. For example if your using eslint-config-airbnb as your main rule set, your .eslintrc should look like this:

{
  "extends": ["airbnb", "adjunct"]
}

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 *.{html,js,json,jsx,md} src/*.{html,js,json,jsx,md}",
    "eslint:fix": "npm run eslint -- --fix"
  }
}

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. Cut'n'paste this command into the console, and you are then ready to start linting.

Plugins

Base Plugins

The following esLint plugins are always loaded in this configuration:

Library Plugins

These plugins will be loaded in based on your project dependencies in package.json. If a supported library is part of your project then it's related esLint plugins will be loaded. The following packages are supported:

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.

Test Libraries

Test plugins are loaded based on which testing tools you have listed in devDependencies of package.json. The following test plugins are supported:

Rules

In the most part the default rules are used for the plugins listed above, with the following exceptions.

Markdown

When linting code snippets in Markdown files, a few rules relating to globals and unused vars are disabled.

Tests

For test files a few rules are turned off, to better to support normal unit test code styles.

Switch-Case

Adds the fallthrough: 'never' option to the newline-between-switch-case rule.

// Good

switch (foo) {
  case 1:
    something()
    break

  case 2:
  case 3:
    somethingElse()
    break

  default:
    defaultThing()
}

Disabled rules

The following rules are disabled due to them being considered unduly restrictive or unhelpful.

  • jest/no-disabled-tests
  • react-redux/prefer-separate-component-file
  • redux-saga/no-unhandled-errors
  • lodash/prefer over native rules
  • lodash-fp/use-fp
  • unicorn/no-reduce
  • unicorn/no-null

The following rules are disabled due to clashing with other plugins

  • array-func/prefer-array-from
  • import/order
  • sort-imports

License

Copyright © 2019-20 David J. Bradshaw. Licensed under the MIT License.

Keywords

FAQs

Package last updated on 27 May 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