Skip to content

Feat/FIB-1968 - Update profico eslint plugin so that we have import order for type imports#12

Closed
carloProfico wants to merge 3 commits intomainfrom
FIB-1968-update-profico-eslint-plugin-so-that-we-have-import-order-for-type-imports
Closed

Feat/FIB-1968 - Update profico eslint plugin so that we have import order for type imports#12
carloProfico wants to merge 3 commits intomainfrom
FIB-1968-update-profico-eslint-plugin-so-that-we-have-import-order-for-type-imports

Conversation

@carloProfico
Copy link

We want to make a rule that will separate import type from import values, for example:

from this:

import type PreCoolType from './precooltype';
import { something } from './something';
import { something2 } from './something'2;

to this:

import { something } from './something';
import { something2 } from './something'2;

import type PreCoolType from './precooltype';

Also, this needs to work with the grouped imports rule to keep those imports in their groups (namespaces, absolute imports, relative imports)

I am not sure how this will work with the existing grouped imports plugin. I will be testing that, since I am now familiar with this repo, any suggestions are welcome.

- Implemented a new ESLint rule to enforce separation of type imports and value imports.
- Added utility functions for categorizing and processing imports in .
- Created test cases for valid and invalid import scenarios in .
- Updated linter configuration to include the new type imports rule.
- Updated the import processing logic to handle absolute and relative imports with appropriate newline management.
- Enhanced type import detection in utility functions to improve accuracy.
- Added new type imports in test cases for better coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant