Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

eslint-config-adjunct

3.0.0 • Public • Published

eslint-config-adjunct

Greenkeeper badge

A mildly opinionated collection of the best esLint 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 extra rules to enhance the linting of your code.

Install

To run this config you will need to install it along with it's peerDependancies.

npx install-peerdeps --dev eslint-config-adjunct

If you have problems with the above command, then you will need to run install-peerdeps locally.

npm install -g install-peerdeps
install-peerdeps --dev eslint-config-adjunct

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 have any contained JavaScript linted.

{
  "scripts": {
    "eslint": "eslint --color  *.{html,js,json,md} src/*.{html,js,json,md}",
    "eslint:fix": "npm run eslint -- --fix"
  }
}

Plugins

The following esLint plugins are contained in this configuration.

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.

Switch-Case

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

// Good
 
switch (foo) {
  case 1:
    something()
    break
 
  case 2:
  case 3:
    somethingElse()
    break
 
  default:
    defaultThing()
}

License

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

Install

npm i eslint-config-adjunct

DownloadsWeekly Downloads

76

Version

3.0.0

License

MIT

Unpacked Size

12 kB

Total Files

23

Last publish

Collaborators

  • avatar