8.0.1 ā€¢ Published 1 year ago

@buildertrend/eslint-plugin-enterprise-extras v8.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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 | | unregister-events | āœ… | | Ensures all events registered in React components are unregistered when component unmounts | | no-unstable-dependencies | āœ… | | Helps find dependencies that are used in React hook dependency arrays that will change values every time the component render is called | | require-state-property-definition | āœ… | | Check for expected/unexpected state definitions in class components | | max-indentation | | | prevents code blocks from exceeded a specified number of indents | |no-deprecated-element | āœ… | šŸ”§ | Prevents deprecated elements from being used |

Contributing

https://btwiki.atlassian.net/wiki/spaces/dv/pages/2319942076/eslint-plugin-enterprise-extras

LICENSE

MIT