import-js/eslint-plugin-import

[import/order] Breaking change in v2.27

Open

#2722 aperta il 20 feb 2023

Vedi su GitHub
 (9 commenti) (10 reazioni) (0 assegnatari)JavaScript (1540 fork)batch import
bughelp wanted

Metriche repository

Star
 (4946 star)
Metriche merge PR
 (Merge medio 138g 22h) (3 PR mergiate in 30 g)

Descrizione

In version 2.27.0 it was introduced a new strategy which splits the imports paths in segments and compares them independently.

However, this leads to different results for the same inputs in some cases, for example:

import {screen} from '@testing-library/react';
import {checkDropdown} from '@testing/form';

this is the "right" order as by v2.26 because:

compareString('@testing-library/react', '@testing/form') === -1

but in v2.27 it is reported as error because:

compareString('@testing-library', '@testing') === 1

I don't know if the current behavior is the right one, but it is definitely a breaking change

Guida contributor