1.2.0 • Published 2 years ago

eslint-plugin-foo-bar v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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:

1.2.0

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago