ESLint plugin providing comprehensive linting rules for ES2015+ import/export syntax with static analysis and module system enforcement.
80
A lint helper that ensures every dynamic import includes a webpack chunk name comment matching a kebab-case pattern.
valid: true and no messages when the source contains dynamic imports annotated with webpack chunk name comments matching feature-<slug> (for example, importing "./settings" with /* webpackChunkName: "feature-settings" */). @testvalid: false with one message when a dynamic import lacks a webpack chunk name comment, mentioning the imported module specifier. @testvalid: false with one message when a webpack chunk name comment is present but not kebab-case (for example, FeatureSettings), mentioning the offending chunk name. @test@generates
export interface ChunknameMessage {
line: number;
column: number;
message: string;
}
export interface ChunknameReport {
valid: boolean;
messages: ChunknameMessage[];
}
/**
* Lints JavaScript module source for webpack chunk name comments on dynamic imports.
* All chunk names must exist and match the kebab-case pattern `^[a-z]+(?:-[a-z0-9]+)*$`.
*
* @param source Module contents to lint.
* @returns Report with validity flag and collected messages.
*/
export function validateDynamicImports(source: string): ChunknameReport;Provides linting rule support for enforcing webpack chunk name comments on dynamic imports. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-eslint-plugin-import-xdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10