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.
Install this ESLint plugin as a dev dependency:
npm install --save-dev eslint-plugin-enterprise-extras
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
}
}
✅ = 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 |
MIT