eslint-plugin-enterprise-extras
v1.1.2
Published
Extra eslint rules for enterprise environments focusing on React and Typescript
Downloads
4
Maintainers
Readme
eslint-plugin-enterprise-extras
This plugin adds extra ESLint rules that may be more suitable for an enterprise environment. The rules were created for use within Buildertrend, but feel free to request or propose any ESLint rules that may fall under this umbrella.
Installation
Install this ESLint plugin as a dev dependency:
npm install --save-dev eslint-plugin-enterprise-extras
Usage
Edit your project's .eslintrc.js
configuration to load the plugin:
module.exports = {
plugins: ["enterprise-extras"],
rules: {
// "enterprise-extras/no-href-assignment": "error"
// ...
// "enterprise-extras/...": "..."
}
}
Alternatively, you could use the recommended
or all
preset rule configurations:
module.exports = {
extends: ["plugin:enterprise-extras/recommended"],
// extends: ["plugin:enterprise-extras/all"],
rules: {
// You can override the recommended rules here
}
}
Supported Rules
✅ = Recommended
🔧 = Auto-fixable
| Name | ✅ | 🔧 | Description |
| -------------------------------------------------- | - | - | ----------- |
| no-href-assignment | ✅ | 🔧 | Prefers location.assign
instead of location.href =
|
| private-component-methods | ✅ | 🔧 | Requires that all methods of react components are private (except reserved lifecycle methods) |
| no-unhandled-scheduling | ✅ | | setTimeout
and setInterval
calls should be cleared |
LICENSE
MIT