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

eslint-find-rules

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-find-rules

Find built-in ESLint rules you don't have in your custom config.

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by13.33%
Maintainers
2
Weekly downloads
 
Created
Source

eslint-find-rules

Join the chat at https://gitter.im/sarbbottam/eslint-find-rules

Use this for your own ESLint shareable configuration to list current configured rules, all-available rules, unused rules, and plugin rules.

Build Status Code Coverage version downloads MIT License PRs Welcome All Contributors

Acknowledgement

This module is an extended version of eslint-find-new-rules

Installation

Simply install locally as a development dependency to your project's package:

npm install --save-dev eslint-find-rules

Usage

The intended usage is as an npm script:

{
  ...
  "scripts": {
    "eslint-find-option-rules": "eslint-find-rules [option] <file> [flag]"
  }
  ...
}
available options are -c|--current, -a|--all-available, -p|--plugin, -u|--unused
available flag is -n|--no-error

By default it will error out only for -u|--unused, however if you do not want the process to exit with a non-zero exit code, use the -n|--no-error along with -u|--unused

Then run it with: $ npm run eslint-find-option-rules -s (the -s is to silence npm output).

Specify a file

This is really handy in an actual config module (like eslint-config-kentcdodds) where you could also do:

// available options are -c|--current, -a|--all-available, -p|--plugin, -u|--unused
eslint-find-rules --option ./index.js

This is resolved, relative to the process.cwd() which, in the context of npm scripts is always the location of your package.json.

You may specify any config format supported by ESLint.

Absolute Path

You can also provide an absolute path:

eslint-find-rules --option ~/Developer/eslint-config-kentcdodds/index.js

Please note that any tested ESLint config file must reside below your project's root.

Default to main

It will also default to the main in your package.json, so you can omit the path/to/file argument:

eslint-find-rules --option

As a required module

var getRuleFinder = require('./eslint-find-rules')
var ruleFinder = getRuleFinder('path/to/eslint-config')

// default to the `main` in your `package.json`
// var ruleFinder = getRuleFinder()

// get all the current, plugin, available and unused rules
// without referring the extended files or documentation

ruleFinder.getCurrentRules()

ruleFinder.getCurrentRulesDetailed()

ruleFinder.getPluginRules()

ruleFinder.getAllAvailableRules()

ruleFinder.getUnusedRules()

Log the difference between two config files

{
  ...
  "scripts": {
    "eslint-diff-rules": "eslint-diff-rules <file1> <file2>"
  }
  ...
}

Contributors

Thanks goes to these wonderful people (emoji key):

Sarbbottam Bandyopadhyay
Sarbbottam Bandyopadhyay

💻 📖 ⚠️ 👀
Andreas Windt
Andreas Windt

💻 📖 ⚠️ 👀
Kent C. Dodds
Kent C. Dodds

💻 📖 ⚠️ 👀
Michał Gołębiowski
Michał Gołębiowski

💻
Jeroen Engels
Jeroen Engels

📖
Dustin Specker
Dustin Specker

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Special thanks to @mgol who created the original script.

LICENSE

MIT

FAQs

Package last updated on 20 Apr 2016

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