[New] import/order: add support for named imports by neurolag · Pull Request #3043 · import-js/eslint-plugin-import (original) (raw)
neurolag marked this pull request as ready for review
neurolag marked this pull request as ready for review
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request
| datasource | package | from | to |
|---|---|---|---|
| npm | eslint-plugin-import | 2.30.0 | 2.31.0 |
v2.31.0
Added
- support eslint v9 ([#2996], thanks [@G-Rath] [@michaelfaith])
- [
order]: allow validating named imports ([#3043], thanks [@manuth]) - [
extensions]: add thecheckTypeImportsoption ([#2817], thanks [@phryneas])
Fixed
ExportMap/ flat config: includelanguageOptionsin context ([#3052], thanks [@michaelfaith])- [
no-named-as-default]: Allow using an identifier if the export is both a named and a default export ([#3032], thanks [@akwodkiewicz]) - [
export]: False positive for exported overloaded functions in TS ([#3065], thanks [@liuxingbaoyu]) exportMap: export map cache is tainted by unreliable parse results ([#3062], thanks [@michaelfaith])exportMap: improve cacheKey when using flat config ([#3072], thanks [@michaelfaith])- adjust "is source type module" checks for flat config ([#2996], thanks [@G-Rath])
Changed
- [Docs] [
no-relative-packages]: fix typo ([#3066], thanks [@joshuaobrien]) - [Performance] [
no-cycle]: dont scc for each linted file ([#3068], thanks [@soryy708]) - [Docs] [
no-cycle]: adddisableSccto docs ([#3070], thanks [@soryy708]) - [Tests] use re-exported
RuleTester([#3071], thanks [@G-Rath]) - [Docs] [
no-restricted-paths]: fix grammar ([#3073], thanks [@unbeauvoyage]) - [Tests] [
no-default-export], [no-named-export]: add test case (thanks [@G-Rath])
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request
| datasource | package | from | to |
|---|---|---|---|
| npm | eslint-plugin-import | 2.30.0 | 2.31.0 |
v2.31.0
Added
- support eslint v9 ([#2996], thanks [@G-Rath] [@michaelfaith])
- [
order]: allow validating named imports ([#3043], thanks [@manuth]) - [
extensions]: add thecheckTypeImportsoption ([#2817], thanks [@phryneas])
Fixed
ExportMap/ flat config: includelanguageOptionsin context ([#3052], thanks [@michaelfaith])- [
no-named-as-default]: Allow using an identifier if the export is both a named and a default export ([#3032], thanks [@akwodkiewicz]) - [
export]: False positive for exported overloaded functions in TS ([#3065], thanks [@liuxingbaoyu]) exportMap: export map cache is tainted by unreliable parse results ([#3062], thanks [@michaelfaith])exportMap: improve cacheKey when using flat config ([#3072], thanks [@michaelfaith])- adjust "is source type module" checks for flat config ([#2996], thanks [@G-Rath])
Changed
- [Docs] [
no-relative-packages]: fix typo ([#3066], thanks [@joshuaobrien]) - [Performance] [
no-cycle]: dont scc for each linted file ([#3068], thanks [@soryy708]) - [Docs] [
no-cycle]: adddisableSccto docs ([#3070], thanks [@soryy708]) - [Tests] use re-exported
RuleTester([#3071], thanks [@G-Rath]) - [Docs] [
no-restricted-paths]: fix grammar ([#3073], thanks [@unbeauvoyage]) - [Tests] [
no-default-export], [no-named-export]: add test case (thanks [@G-Rath])
qdraw mentioned this pull request
This was referenced
Oct 28, 2024
falkenhawk added a commit to ovos/coding-standard that referenced this pull request
https://perfectionist.dev/rules/sort-named-imports https://perfectionist.dev/rules/sort-named-exports
We had named imports sorted in v1 when tslint was taking care of that. But it got lost during migration to eslint, as I wrongly assumed that import/order will take care of that. Later on, the support for sorting named imports (but still not exports) was added to the original eslint-plugin-import import-js/eslint-plugin-import#3043 but we have switched to eslint-plugin-import-x since and the porting request of that feature is still pending. un-ts/eslint-plugin-import-x#225
We could consider switching back to eslint-plugin-import but it still has a set of its own, still unresolved issues. Instead, I decided to try eslint-plugin-perfectionist and the sorting rules from that. Note we are sticking with import/order for sorting and grouping imports for the time being, as more time would be needed to convert the sorting and grouping config to achieve similar behaviour with the perfectionist/sort-imports rule.
There is also perfectionist/sort-exports rule, but it does not provide config options to define grouping and custom sorting, to achieve similar behaviour to import/order with our custom config applied, so for now we won't enforce that rule.
falkenhawk added a commit to ovos/coding-standard that referenced this pull request
https://perfectionist.dev/rules/sort-named-imports https://perfectionist.dev/rules/sort-named-exports
We had named imports sorted in v1 when tslint was taking care of that. But it got lost during migration to eslint, as I wrongly assumed that import/order will take care of that. Later on, the support for sorting named imports (but still not exports) was added to the original eslint-plugin-import import-js/eslint-plugin-import#3043 but we have switched to eslint-plugin-import-x since and the porting request of that feature is still pending. un-ts/eslint-plugin-import-x#225
We could consider switching back to eslint-plugin-import but it still has a set of its own, still unresolved issues. Instead, I decided to try eslint-plugin-perfectionist and the sorting rules from that. Note we are sticking with import/order for sorting and grouping imports for the time being, as more time would be needed to convert the sorting and grouping config to achieve similar behaviour with the perfectionist/sort-imports rule.
There is also perfectionist/sort-exports rule, but it does not provide config options to define grouping and custom sorting, to achieve similar behaviour to import/order with our custom config applied, so for now we won't enforce that rule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})