Skip to content

ESLint Plugin: @wordpress/dependency-group wrong grouping with fixer #17050

Open

Description

Describe the bug
I have this sample import statements:

import { format } from '@wordpress/date'
import { pickBy } from 'lodash'
import { PanelBody } from '@wordpress/components'

Running wp-scripts lint-js --fix on this groups together the dependencies, but doesn't rearrange the location so I end up with:

/**
 * WordPress dependencies
 */
import { format } from '@wordpress/date'

/**
 * External dependencies
 */
import { pickBy } from 'lodash'
import { PanelBody } from '@wordpress/components'

You'll have to manually move the @wordpress/* dependencies together.

Expected behavior
The @wordpress/* / External / Internal dependencies would be sorted and grouped together.

Desktop (please complete the following information):
Relevant part of my devDependencies:

"devDependencies": {
    "@wordpress/eslint-plugin": "^2.4.0",
    "eslint": "^6.1.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first timeNeeds DevReady for, and needs developer effortsReady for, and needs developer efforts[Package] ESLint plugin/packages/eslint-plugin/packages/eslint-plugin[Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled laterUsed to indicate that the issue at hand isn't a top priority to address and can be handled later[Type] EnhancementA suggestion for improvement.A suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions