Skip to content

import/order: Impose custom ordering within groups #1378

Open
@futpib

Description

@futpib

For example, new option could look like this:

{
	"withinGroups": {
		"external": [
			"ramda",
			"react"
		]
	}
}

With this option, this would pass 👍:

import { compose } from 'ramda';
import React from 'react';

And this would fail 👎:

import React from 'react';
import { compose } from 'ramda'; // error: should be placed above `react`

If a package without configured order is imported, it could be ignored:

import { compose } from 'ramda';
import somethingElse from 'something-else'; // could be placed anywhere within the "external" group, as it is not mentioned in the config
import React from 'react';

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions