1.0.1 • Published 2 years ago

eslint-lazy-load-rule v1.0.1

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

Eslint lazy loading rule

Gives warning when lazy loading is possible (lazy-load-rule)

When load time is important factor of your frontend application, you can use this rule to warn you whenever lazy loading is possible.

Rule Details

This rule aims to help eliminate any lazy-loadable code that is not lazy-loaded.

Examples of incorrect code for this rule:

import {foo} from 'foo';
if(true) foo();

Examples of correct code for this rule: Currently allows to use in logical statement or conditional statement;

import {foo} from 'foo';
true || foo();
true && foo();
true ? foo() : '';
true ? '' : foo();

Further Reading

Best to use with max-line and max-line-per-function for reminding youself to put excess code in different module.