Socket
Book a DemoInstallSign in
Socket

eslint-plugin-foo-bar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-foo-bar

ESLint plugin for foo-bar rule.

latest
npmnpm
Version
1.2.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-foo-bar

This rule is created for educational purposes to explain how to create an ESLint custom rule and plugin.

ESLint plugin that only allows you to assign "bar" to const foo.

For example, the rule would give an error for the following:

const foo = "baz"; // Bad :(

The rule accepts the following:

const foo = "bar"; // Good :)

Tutorial

For a tutorial on how to create a custom rule in a plugin using eslint-plugin-foo-bar as an example, refer to the [ESlint Custom Rule & Plugin Tutorial](TODO: add link).

Use in Your Project

Install the rule in your project:

npm install --save-dev eslint-plugin-foo-bar

Add the plugin and rule to your ESLint configuration file:

// .eslintrc.js

module.exports = {
  // ...rest of configuration
  plugins: [
    "eslint-plugin-foo-bar"
  ],
  rules: [
    "eslint-plugin-foo-bar/foo-bar": "error"
  ]
};

Further Reading

To learn more about ESLint, creating custom rules, and plugins, refer to the following documentation:

  • ESLint docs home
  • Custom Rule docs
  • Plugin docs

Keywords

eslint

FAQs

Package last updated on 22 Mar 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.