eslint-plugin-import
2.32.0 · 20 Jun 2025MIT84.5M / weekRepositorynpmAtom feed
133 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 2.x · latest line
2.9.0
22 Feb 2018Add [
group-exports] rule: style-guide rule to report use of multiple named exports ([#721], thanks [@robertrossmann])Add [
no-self-import] rule: forbids a module from importing itself. ([#727], [#449], [#447], thanks [@giodamelio]).Add [
no-default-export] rule ([#889], thanks [@isiahmeadows])
Added
Add [
group-exports] rule: style-guide rule to report use of multiple named exports ([#721], thanks [@robertrossmann])Add [
no-self-import] rule: forbids a module from importing itself. ([#727], [#449], [#447], thanks [@giodamelio]).Add [
no-default-export] rule ([#889], thanks [@isiahmeadows])Add [
no-useless-path-segments] rule ([#912], thanks [@graingert] and [@danny-andrews])... and more! check the commits for v[2.9.0]
2.8.0
19 Oct 2017Support scoped modules containing hyphens ([#744], thanks [@rosswarren])
Added
Changed
Case-sensitivity checking ignores working directory and ancestors. ([#720] + [#858], thanks [@laysent])
Fixed
Support scoped modules containing hyphens ([#744], thanks [@rosswarren])
core-modules now resolves files inside declared modules ([#886] / [#891], thanks [@mplewis])
TypeError for missing AST fields from TypeScript ([#842] / [#944], thanks [@alexgorbatchev])
2.6.1
29 Jun 2017Update bundled node resolver dependency to latest version
2.6.0
23 Jun 2017Update tests / peerDeps for ESLint 4.0 compatibility ([#871], thanks [@mastilver])
[
memo-parser] updated to requirefilePathon parser options as it melts down if it's not there, now that this plugin always provides it. (see [#863])
2.5.0
22 Jun 20172.4.0
2 Jun 2017Add
filePathintoparserOptionspassed toparser([#839], thanks [@sompylasar])Add
allowoption to [no-unassigned-import] to allow for files that match the globs ([#671], [#737], thanks [@kevin940726]).
[2.4.0] - 2017-06-02 [Yanked]
Yanked due to critical issue in eslint-module-utils with cache key resulting from [#839].
Added
Add
filePathintoparserOptionspassed toparser([#839], thanks [@sompylasar])Add
allowoption to [no-unassigned-import] to allow for files that match the globs ([#671], [#737], thanks [@kevin940726]).
2.3.0
24 May 2017[
no-anonymous-default-export] rule: report anonymous default exports ([#712], thanks [@duncanbeevers]).Add new value to [
order]'snewlines-betweenoption to allow newlines inside import groups ([#627], [#628], thanks [@giodamelio])
Added
[
no-anonymous-default-export] rule: report anonymous default exports ([#712], thanks [@duncanbeevers]).Add new value to [
order]'snewlines-betweenoption to allow newlines inside import groups ([#627], [#628], thanks [@giodamelio])Add
countoption to the [newline-after-import] rule to allow configuration of number of newlines expected ([#742], thanks [@ntdb])
Changed
[
no-extraneous-dependencies]: useread-pkg-upto simplify finding + loadingpackage.json([#680], thanks [@wtgtybhertgeghgtwtg])Add support to specify the package.json [
no-extraneous-dependencies] ([#685], thanks [@ramasilveyra])
Fixed
Attempt to fix crash in [
no-mutable-exports]. ([#660], thanks [@NullDivision])"default is a reserved keyword" in no-maned-default tests by locking down babylon to 6.15.0 (#756, thanks @gmathieu)
Support scoped modules containing non word characters
2.1.0
3 Nov 2016Added
Add [
no-named-default] rule: style-guide rule to report use of unnecessarily named default imports ([#596], thanks [@ntdb])[
no-extraneous-dependencies]: check globs against CWD + absolute path ([#602] + [#630], thanks [@ljharb])
Fixed
[
prefer-default-export] handles flowexport type([#484] + [#639], thanks [@jakubsta])[
prefer-default-export] handles re-exported default exports ([#609], thanks [@danielkcz])Fix crash when using [
newline-after-import] with decorators ([#592], thanks [@lukekarrys])Properly report [
newline-after-import] when next line is a decoratorFixed documentation for the default values for the [
order] rule ([#601], thanks [@mpalmer685])
2.0.0
29 Sep 2016- Breaking
[
import/extensionssetting] defaults to['.js']. ([#306], thanks [@benmosher]) - Breaking
[
import/ignoresetting] defaults to nothing, and ambiguous modules are ignored natively. This means importing from CommonJS modules will no longer be reported by [default], [named], or [namespace], regardless ofimport/ignore. ([#270], thanks [@benmosher]) - Breaking
[
newline-after-import]: Removed need for an empty line after an inlinerequirecall ([#570], thanks [@sindresorhus])
[2.0.0]! - 2016-09-30
Added
[
unambiguous] rule: report modules that are not unambiguously ES modules.recommendedshared config. Roughlyerrorsandwarningsmixed together, with someparserOptionsin the mix. ([#402])reactshared config: addedjsx: truetoparserOptions.ecmaFeatures.Added [
no-webpack-loader-syntax] rule: forbid custom Webpack loader syntax in imports. ([#586], thanks [@fson]!)Add option
newlines-between: "ignore"to [order] ([#519], thanks [@sompylasar])Added [
no-unassigned-import] rule ([#529], thanks [@jfmengels])
Breaking
- Breaking
[
import/extensionssetting] defaults to['.js']. ([#306], thanks [@benmosher]) - Breaking
[
import/ignoresetting] defaults to nothing, and ambiguous modules are ignored natively. This means importing from CommonJS modules will no longer be reported by [default], [named], or [namespace], regardless ofimport/ignore. ([#270], thanks [@benmosher]) - Breaking
[
newline-after-import]: Removed need for an empty line after an inlinerequirecall ([#570], thanks [@sindresorhus]) - Breaking
[
order]: Default value fornewlines-betweenoption is nowignore([#519], thanks [@sompylasar])
Changed
imports-firstis renamed to [first].imports-firstalias will continue to exist, but may be removed in a future major release.Case-sensitivity: Now specifically (and optionally) reported by [
no-unresolved]. Other rules will ignore case-mismatches on paths on case-insensitive filesystems. ([#311])
Fixed
- 1.x
1.16.0
23 Sep 2016Added [
no-dynamic-require] rule: forbidrequire()calls with expressions. ([#567], [#568], thanks [@jfmengels])
Added
Added [
no-dynamic-require] rule: forbidrequire()calls with expressions. ([#567], [#568], thanks [@jfmengels])Added [
no-internal-modules] rule: restrict deep package imports to specific folders. ([#485], thanks [@spalger]!)[
extensions]: allow override of a chosen default with options object ([#555], thanks [@ljharb]!)
Fixed
1.15.0
13 Sep 2016Added an
allowoption to [no-nodejs-modules] to allow exceptions ([#452], [#509], thanks [@jfmengels] and [@ljharb]).Added [
no-absolute-path] rule ([#530], [#538], thanks [@jfmengels])
Added
Added an
allowoption to [no-nodejs-modules] to allow exceptions ([#452], [#509], thanks [@jfmengels] and [@ljharb]).Added [
no-absolute-path] rule ([#530], [#538], thanks [@jfmengels])[
max-dependencies] for specifying the maximum number of dependencies (bothimportandrequire) a module can have. (see [#489], thanks [@tizmagik])Added glob option to config for [
no-extraneous-dependencies], after much bikeshedding. Thanks, [@knpwrs]!
Fixed
1.14.0
22 Aug 2016[
import/parserssetting]: parse some dependencies (i.e. TypeScript!) with a different parser than the ESLint-configured parser. ([#503], thanks [@benmosher])
1.11.0
17 Jul 2016Added an
peerDependenciesoption to [no-extraneous-dependencies] to allow/forbid peer dependencies ([#423], [#428], thanks [@jfmengels]!).
1.10.2
5 Jul 2016Something horrible happened during
npm prepublishof 1.10.1. Severalrm -rf node_modules && npm iandgulp clean && npm prepublishs later, it is rebuilt and republished as 1.10.2. Thanks [@rhettlivingston] for noticing and reporting!
1.10.1
3 Jul 2016Officially support ESLint 3.x. (peerDependencies updated to
2.x - 3.x)
1.10.0
30 Jun 2016[
import/core-modulessetting]: allow configuration of additional module names, to be treated as builtin modules (a lapath, etc. in Node). ([#275] + [#365], thanks [@sindresorhus] for driving)React Native shared config (based on comment from [#283], thanks [@benmosher])
Added
Added new rule [
no-restricted-paths]. ([#155]/[#371], thanks [@lo1tuma])[
import/core-modulessetting]: allow configuration of additional module names, to be treated as builtin modules (a lapath, etc. in Node). ([#275] + [#365], thanks [@sindresorhus] for driving)React Native shared config (based on comment from [#283], thanks [@benmosher])
Fixed
1.9.1
16 Jun 2016Reordered precedence for loading resolvers. ([#373], thanks [@benmosher])
1.8.1
26 May 2016Fixed
export * from 'foo'now properly ignores adefaultexport fromfoo, if any. ([#328]/[#332], thanks [@jkimbo]) This impacts all static analysis of imported names. ([default], [named], [namespace], [export])Make [
order]'snewline-betweenoption handle multiline import statements ([#313], thanks [@singles])Make [
order]'snewline-betweenoption handle not assigned import statements ([#313], thanks [@singles])Make [
order]'snewline-betweenoption ignorerequirestatements inside object literals ([#313], thanks [@singles])[
prefer-default-export] properly handles deep destructuring,export * from ..., and files with no exports. ([#342]+[#343], thanks [@scottnonnenberg])
1.8.0
11 May 2016Ignore namespace / ES7 re-exports in [
no-mutable-exports]. ([#317], fixed by [#322]. thanks [@borisyankov] + [@jfmengels])Make [
no-extraneous-dependencies] handle scoped packages ([#316], thanks [@jfmengels])
1.7.0
6 May 2016Added an
optionalDependenciesoption to [no-extraneous-dependencies] to allow/forbid optional dependencies ([#266], thanks [@jfmengels]).
Added
[
newline-after-import], new rule. ([#245], thanks [@singles])Added an
optionalDependenciesoption to [no-extraneous-dependencies] to allow/forbid optional dependencies ([#266], thanks [@jfmengels]).Added
newlines-betweenoption to [order] rule ([#298], thanks [@singles])[
import/extensionssetting]: a list of file extensions to parse as modules and search forexports. If unspecified, all extensions are considered valid (for now). In v2, this will likely default to['.js', MODULE_EXT]. ([#297], to fix [#267])
Fixed
[
extensions]: fallback to source path for extension enforcement if imported module is not resolved. Also, never report for builtins (i.e.path). ([#296])
1.6.0
25 Apr 2016Add [
no-named-as-default-member] towarningscanned configAdd [
no-extraneous-dependencies] rule ([#241], thanks [@jfmengels])
Added
Add [
no-named-as-default-member] towarningscanned configAdd [
no-extraneous-dependencies] rule ([#241], thanks [@jfmengels])Add [
no-nodejs-modules] rule ([#261], thanks [@jfmengels])Add [
order] rule ([#247], thanks [@jfmengels])Consider
resolve.fallbackconfig option in the webpack resolver ([#254], thanks [@yp])
Changed
[
imports-first] now allows directives (i.e.'use strict') strictly before any imports ([#256], thanks [@lemonmade])
Fixed
[
named] now properly ignores the source module if a name is re-exported from an ignored file (i.e.node_modules). Also improved the reported error. (thanks to [@jimbolla] for reporting)[
no-named-as-default-member] had a crash on destructuring in loops (thanks for heads up from [@lemonmade])
1.5.0
18 Apr 2016- Breaking
Support for Node 0.10, via
es6-*ponyfills. Using native Map/Set/Symbol. Report resolver errors at the top of the linted file
1.4.0
25 Mar 2016Resolver plugin interface v2: more explicit response format that more clearly covers the found-but-core-module case, where there is no path. Still backwards-compatible with the original version of the resolver spec.
Using
package.json/filesinstead of.npmignorefor package file inclusion ([#228], thanks [@mathieudutour])
Added
Resolver plugin interface v2: more explicit response format that more clearly covers the found-but-core-module case, where there is no path. Still backwards-compatible with the original version of the resolver spec.
Changed
Using
package.json/filesinstead of.npmignorefor package file inclusion ([#228], thanks [@mathieudutour])Using
es6-*ponyfills instead ofbabel-runtime
1.3.0
20 Mar 2016Experimental memoizing parser
Huge reduction in execution time by only ignoring [
import/ignoresetting] if something that looks like anexportis detected in the module content.
Major perf improvements. Between parsing only once and ignoring gigantic, non-module
node_modules, there is very little added time.My test project takes 17s to lint completely, down from 55s, when using the memoizing parser, and takes only 27s with naked
babel-eslint(thus, reparsing local modules).Added
Fixed
Huge reduction in execution time by only ignoring [
import/ignoresetting] if something that looks like anexportis detected in the module content.
1.2.0
19 Mar 2016Thanks @lencioni for identifying a huge amount of rework in
resolveand kicking off a bunch of memorization.Thanks @lencioni for identifying a huge amount of rework in
resolveand kicking off a bunch of memorization.I'm seeing 62% improvement over my normal test codebase for just
no-unresolvedin isolation, and ~35% total reduction in lint time.1.1.0
15 Mar 2016Added an
ignoreoption tono-unresolvedfor those pesky files for which no resolver can find. (still prefer enhancing the Webpack and Node resolvers to using it, though)
1.0.4
11 Mar 2016fix #192
1.0.2:
fix #192
1.0.3:
no-deprecatedfollows deep namespaces (#191)1.0.4:
don't crash on self references (#210)
correct cache behavior ineslint_dfor deep namespaces (#200)
respect hoisting for deep namespaces (namespace/no-deprecated) (#211)namespaceno longer flags modules with only adefaultexport as having no names. (ns.defaultis valid ES6)1.0.3
26 Feb 2016no-deprecated follows deep namespaces ([#191], thanks [@benmosher])
[
namespace] no longer flags modules with only a default export as having no names. (ns.default is valid ES6)
1.0.1
25 Feb 2016Export
stage-0shared configDocumented
no-deprecatedDeep namespaces are traversed regardless of how they get imported
1.0.0
24 Feb 2016import/no-deprecated: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules.
import/no-deprecated: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules.
From the beta 1.0 release notes:
Update, verified to work with ESLint 2.0.
"Breaking" changes from 0.13.0:
no longer needs/refers to import/parser or import/parse-options. instead, ESLint provided the configured parser + options to the rules, and they use that to parse dependencies.
Shouldn't hurt to leave it there, and I suspect 99.999% of installs have import/parser === parser.
This also means the plugin uses espree instead of babylon if no parser is configured. Wouldn't expect this to hurt in general, but it is a potentially breaking difference.
eslint-config-import is no longer supported. Instead, use the shared configs directly exported by the plugin. See the README for details.
Nothing groundbreaking, but import/parser has been a thorny issue for the whole life of the plugin, and I'm glad to finally be rid of it. :sweat_smile:
- 0.13.x
- 0.12.x
0.12.1
17 Dec 2015Moved rule details into separate files, so the README is shorter and does not distract from config settings (resolvers,
import/parser, etc.).Moved rule details into separate files, so the README is shorter and does not distract from config settings (resolvers,
import/parser, etc.).No code changes, should be functionally identical to v0.12.0.
0.12.0
14 Dec 2015Ignore
import/ignoreif exports are actually found in the parsed module.
Does this to support use ofjsnext:maininnode_moduleswithout the pain of managing a whitelist or a nuanced blacklist. May be removed pending how surprising/helpful it ends up being.
- 0.11.x
0.11.0
28 Nov 2015Resolver plugins: now the linter can read Webpack config, properly follow aliases and ignore externals, dismisses inline loaders, etc. etc.!
- 0.10.x
0.10.1
25 Nov 2015Cache correctness: should properly re-load changed files even in a long lived process (like a webpack dev server)
Fixed issue where inferring JSX parsing from
ecmaFeatures.jsxwas broken when ESLint froze thecontextandsettings. My own fault... not very hygienic to mutate shared state in the first place.
0.10.0
15 Nov 2015Breaking: removed
no-errorsrule. Instead, each individual rule will report parse errors in the target imported file, if encountered.Breaking: removed
no-errorsrule. Instead, each individual rule will report parse errors in the target imported file, if encountered.#90: Added
{commonjs: [bool], amd: [bool]}option object tono-unresolved. If settrue, will attempt to resolve module paths for CommonJSrequireand AMDdefine+requirein a limited set of cases. Not nearly so smart as Webpack, but smart enough to be useful. (hopefully.) Thanks @mctep for changing my mind on this. 😁#94: Dependency parser will infer 'jsx' plugin if using default Babylon and
jsxis asserted in theecmaFeatures. Thanks @jameslnewell for bringing this up.#88: un-smarted
no-require. It will now report on allrequirestatements, everywhere, regardless of target.- 0.9.x
0.9.1
5 Nov 2015Internal parser is now Babylon (6) by default (so generally, you can remove
babel-eslintasimport/parser)Published eslint-config-import with 3 different stock configs
All rules are off by default; use config package +
import/warningsto get previous defaults:
Internal parser is now Babylon (6) by default (so generally, you can remove
babel-eslintasimport/parser)Published eslint-config-import with 3 different stock configs
All rules are off by default; use config package +
import/warningsto get previous defaults:
--- extends: - 'eslint:recommended' # or your favorite base config - import/warnings # or just `import` if you want only the basics - import/es7-jsx # will configure the parser for stage 1 ES7 syntax + JSX
Both
import/warningsandimport/es7-jsxextend the baseimportconfig, so you only need to mention it explicitly if you want only the basic config. All 3 will setplugins: - importfor you, too.import/parse-optionssetting allows custom configuration options for Babylon, or whatever parser package you specified withimport/parser
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.