1.1.0 • Published 2 years ago

eslint-plugin-loadable-component v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eslint-plugin-loadable-component

Unofficial lint support for @loadable/component.

Test CI codecov

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-loadable-component:

npm install eslint-plugin-loadable-component --save-dev

Or, with yarn:

yarn add -D eslint-plugin-loadable-component

Usage

Note: This plugin doesn't have "recommended" rule set at the moment. We are currently still considering of the right rules to be the recommended default set. Please make sure to enable rules based on your needs.

To get started, add loadable-component to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["loadable-component"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "loadable-component/no-empty-fallback": "warn",
    "loadable-component/no-full-dynamic-import": "error",
    "loadable-component/no-other-loadable-identifier": "error"
  }
}

Rules

NameTypeDocs
no-empty-fallbackBest PracticesLink
no-full-dynamic-importBest PracticesLink
no-other-loadable-idenfierPossible ErrorLink

Disabling Rule

You can disable certain rule by using ESLint directive syntax to hint ESLint to disable in specific line or entire file. You can find a list of ESLint directives here.

// eslint-disable-next-line no-empty-fallback
loadable(() => import('./foo.js'));

License

MIT