I can't get what I want out of either ESLint's sort-imports or import/order and it looks like both rules are stuck in a world of too many configuration options and debate. What I want feels simple, though:
../foo
) are sorted after absolute paths (foo
)../../foo
is before ../foo
I don't think this rule would be compatible with either of the above linked rules and I don't think it would need to be.
Fail:
import * as bar from 'bar.js';
import * as foo from 'foo.js';
import {alpha, beta} from 'alpha.js';
import {delta, gamma} from 'delta.js';
import a from 'baz.js';
import b from 'qux.js';
import w from './foo';
import x from '../foo';
import y from '../../foo';
import z from 'foo';
Pass:
import {alpha, beta} from 'alpha.js';
import * as bar from 'bar.js';
import a from 'baz.js';
import {delta, gamma} from 'delta.js';
import * as foo from 'foo.js';
import b from 'qux.js';
import z from 'foo';
import y from '../../foo';
import x from '../foo';
import w from './foo';
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too