Files
dspace-angular/docs/lint/ts/rules/alias-imports.md
2025-05-16 18:13:48 +02:00

1.0 KiB

DSpace ESLint plugins > TypeScript rules > dspace-angular-ts/alias-imports


Unclear imports should be aliased for clarity


Source code

Examples

Valid code

correctly aliased imports
import { of as observableOf } from 'rxjs';

Invalid code & automatic fixes

imports without alias
import { of } from 'rxjs';

Will produce the following error(s):

This import must be aliased

Result of yarn lint --fix:

import { of as observableOf } from 'rxjs';
imports under the wrong alias
import { of as ofSomething } from 'rxjs';

Will produce the following error(s):

This import uses the wrong alias (should be {{ local }})

Result of yarn lint --fix:

import { of as observableOf } from 'rxjs';