WordPress/gutenberg

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

Open

#17.050 aberto em 15 de ago. de 2019

Ver no GitHub
 (4 comments) (0 reactions) (0 assignees)JavaScript (3.893 forks)batch import
Good First IssueNeeds Dev[Priority] Low[Tool] ESLint plugin[Type] Enhancement

Métricas do repositório

Stars
 (9.607 stars)
Métricas de merge de PR
 (Mesclagem média 12d 18h) (509 fundiu PRs em 30d)

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"
}

Guia do colaborador