imports-first
`imports-first` is the old name of `first`.
Next step
imports-first ships in eslint-plugin-import-next, with 13 of its 59 rules in the recommended preset.
npm install -D eslint-plugin-import-nextimport { configs } from 'eslint-plugin-import-next';
export default [configs.recommended];
❌ This rule is deprecated. It was replaced by first.
imports-first is the old name of first. eslint-plugin-import 2.32.0 still exports it, deprecated, as first with a deprecated meta; this plugin does the same. It reports what first reports, for the same options. Use first in new configs.
Rule Details
| Aspect | Details |
|---|---|
| Status | Deprecated (meta.deprecated: true), replaced by first |
| Reports | Exactly what first reports, with the same options |
| In presets | No preset enables it |
| Options | The same as first: "absolute-first" or "disable-absolute-first" |
Why it exists
A config that registers this plugin under the import key and names import/imports-first, or a // eslint-disable-next-line import/imports-first comment, would otherwise stop ESLint with "Could not find rule". With this entry it loads and behaves as first.
Configuration
// eslint.config.js
import importNext from 'eslint-plugin-import-next';
export default [
{
plugins: { 'import-next': importNext },
rules: { 'import-next/imports-first': 'error' },
},
];Prefer the replacement:
rules: { 'import-next/first': 'error' }Further Reading
Use this rule
npm install -D eslint-plugin-import-nextimport importNext from 'eslint-plugin-import-next';export default [ { plugins: { 'import-next': importNext }, rules: { 'import-next/imports-first': 'error' }, },];npm install -D oxlint-plugin-import-next{ "jsPlugins": ["oxlint-plugin-import-next"], "rules": { "import-next/imports-first": "error" }}import { defineConfig } from 'vite-plus';export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-import-next'], rules: { 'import-next/imports-first': 'error', }, },});oxlint-plugin-import-next re-exports eslint-plugin-import-next/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.
Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.