@atlassian/eslint-plugin-module-checks
v4.1.0
Published
Rules to check various aspects of your AMD or ES6 modules for correctness.
Downloads
27
Readme
eslint-plugin-module-checks
Rules to check various aspects of your AMD or ES6 modules for correctness.
Configuration
First include the plugin with npm install @atlassian/eslint-plugin-module-checks
, then include it in your ESLint config
{
"plugins": [
"@atlassian/module-checks"
],
...
}
Then enable the rules you want to use. For example:
Enable the rules that you would like to use, for example:
{
"rules": {
"module-checks/no-unused-deps": 2,
"module-checks/no-unordered-deps": 1
}
}
List of supported rules
- depend-on-require: Allow or disallow use of the
require
module dependency - named-define: Allow or disallow explicitly named modules
- no-unordered-deps: Disallow unordered module dependencies
- no-unused-deps: Disallow dependencies that are not used in the module body
List of borrowed rules
We borrow some rules from other ESLint plugins. They are listed below:
- no-assign-exports: Disallow assignment to
exports
when using Simplified CommonJS Wrapper - no-conditional-require: Disallow use of conditional
require
calls (off by default) - no-dynamic-require: Disallow use of dynamically generated paths in a
require
call (off by default) - no-invalid-define: Disallow invalid module definitions
- no-invalid-require: Disallow invalid
require
orrequirejs
calls - no-js-extension: Disallow
.js
extension in dependency paths - no-require-tourl: Disallow use of
require.toUrl
andrequire.nameToUrl
(off by default) - one-dependency-per-line: Enforce line-break rules for AMD dependencies (off by default)