eslint-plugin-consumer-linter
v0.0.4
Published
To guarantee that best practices are followed across the codebase, this ESLint plugin provides specific guidelines. These guidelines help preserve code consistency and avoid frequent mistakes in JavaScript and TypeScript projects.
Downloads
7
Maintainers
Readme
eslint-plugin-consumer-linter
To guarantee that best practices are followed across the codebase, this ESLint plugin provides specific guidelines. These guidelines help preserve code consistency and avoid frequent mistakes in JavaScript and TypeScript projects.
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-consumer-linter
:
npm install eslint-plugin-consumer-linter --save-dev
Usage
Add consumer-linter
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["consumer-linter"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"consumer-linter/rule-name": 2
}
}
Or to apply all custom rules without needing to define them individually
// .eslintrc.js
module.exports = {
plugins: ["consumer-linter"],
extends: ["plugin:consumer-linter/recommended"],
};
Rules
| Rule Name | Description | | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | no-export-default | Avoid using "export default" in your code, especially when it comes to TypeScript and JavaScript files that exclude stories or tests. | | no-useeffect-outside-hook | Avoid using useEffect in files that are not custom hooks. | | no-large-functions | Ensure that functions do not exceed 50 lines of code. Large functions can be harder to understand and maintain. |