sort-imports
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"sort-imports": "error",
},
},
];import b from 'foo.js';
import a from 'bar.js';import a from 'foo.js';
import A from 'bar.js';import {c, d} from 'foo.js';
import {a, b} from 'bar.js';import 'module-without-export.js';
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 a from 'foo.js';
import b from 'bar.js';
import c from 'baz.js';import 'foo.js'
import * as bar from 'bar.js';
import {a, b} from 'baz.js';
import c from 'qux.js';
import {d} from 'quux.js';Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sort-imports
eslint
export default [
{
rules: {
"sort-imports": "error",
},
},
];sort-imports
eslint plugin · style
{
"rules": {
"sort-imports": "error"
}
}Biome does not have this rule.
Enforce a maximum number of statements allowed in function blocks