eslint-config-import

raw JSON →
0.13.0 verified Sat Apr 25 auth: no javascript maintenance

Pre-fabricated ESLint shareable configs for eslint-plugin-import. Current stable version is 0.13.0, but the plugin itself is now at v2.32.0. This package provides three configs: 'import' (basic rules), 'import/warnings' (common mistakes), and 'import/es7-jsx' (ES7/JSX). It is a sibling package that depends on eslint-plugin-import 0.13.x. Note that the plugin has evolved significantly since then; usage with modern ESLint and TypeScript is best handled via the plugin's built-in configs or flat config. Rarely updated; consider using eslint-plugin-import directly.

error ESLint: Configuration for rule 'import/no-unresolved' is invalid
cause The config tries to apply rules that are not available in the installed version of eslint-plugin-import.
fix
Ensure eslint-plugin-import version matches the expected peer dependency (0.13.x) or upgrade to a newer config.
error Cannot find module 'eslint-plugin-import'
cause The peer dependency eslint-plugin-import is not installed.
fix
Run: npm install --save-dev eslint-plugin-import@0.13.x
error Parsing error: The keyword 'import' is reserved
cause ESLint parser is not set to support ES modules; the 'import' config assumes a modern parser.
fix
Use a config that sets parserOptions.sourceType: 'module', such as 'eslint-config-import/es7-jsx' or configure your own parserOptions.
deprecated The 'eslint-config-import' package is outdated. Consider using the built-in config from eslint-plugin-import directly.
fix Remove 'eslint-config-import' from extends and instead use 'plugin:import/recommended' or 'plugin:import/errors' from eslint-plugin-import.
gotcha The recommended config 'import' may conflict with other configs that set parser options.
fix If using the 'es7-jsx' config, ensure no other config overrides parserOptions.sourceType or ecmaFeatures.jsx.
breaking eslint-plugin-import v2.x is not compatible with eslint-config-import v0.13.x.
fix Downgrade eslint-plugin-import to 0.13.x or use eslint-plugin-import's built-in configs instead.
gotcha The 'es7-jsx' config sets parser: 'babel-eslint' which may be outdated; ESLint v9+ deprecated babel-eslint in favor of @babel/eslint-parser.
fix Use @babel/eslint-parser directly in your ESLint config, or use a more modern config.
npm install eslint-config-import
yarn add eslint-config-import
pnpm add eslint-config-import

This shows how to use the 'warnings' config in ESLint. Note the peer dependency version constraint.

// .eslintrc.js
module.exports = {
  extends: ['eslint-config-import/warnings'],
  rules: {
    // additional rules
  }
};

// Ensure eslint-plugin-import is installed (peer dependency)
// npm install --save-dev eslint-plugin-import@0.13.x