All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. This change log adheres to standards from Keep a CHANGELOG.
export
]: Handle function overloading in *.d.ts
(#1619, thanks @IvanGoncharov)no-absolute-path
]: fix a crash with invalid import syntax (#1616, thanks @ljharb)import/external-module-folders
setting] now correctly works with directories containing modules symlinked from node_modules
(#1605, thanks @skozin)extensions
]: for invalid code where name
does not exist, do not crash (#1613, thanks @ljharb)extentions
]: Fix scope regex (#1611, thanks @yordis)no-duplicates
]: allow duplicate imports if one is a namespace and the other not (#1612, thanks @sveyret)named
]: for importing from a module which re-exports named exports from a node_modules
module (#1569, #1447, thanks @redbugz, @kentcdodds)order
]: Fix alphabetize for mixed requires and imports ([#5625], thanks @wschurman)import/external-module-folders
setting] behavior is more strict now: it will only match complete path segments (#1605, thanks @skozin)order
]: added caseInsensitive
as an additional option to alphabetize
(#1586, thanks @dbrewer5)no-restricted-paths
]: New except
option per zone
, allowing exceptions to be defined for a restricted zone (#1238, thanks @rsolomon)order
]: add option pathGroupsExcludedImportTypes to allow ordering of external import types (#1565, thanks @Mairu)no-unused-modules
]: fix usage of import/extensions
settings (#1560, thanks @stekycz)extensions
]: ignore non-main modules (#1563, thanks @saschanaz)no-extraneous-dependencies
]: ensure node.source
is truthy (#1589, thanks @ljharb)extensions
]: Ignore query strings when checking for extensions (#1572, thanks @pcorpet)extensions
]: improve ignorePackages
docs (#1248, thanks @ivo-stefchev)no-extraneous-dependencies
]: ensure node.source
existsinternal-regex
setting]: regex pattern for marking packages "internal" ([#1491], thanks [@Librazy])group-exports
]: make aggregate module exports valid (#1472, thanks @atikenny)no-namespace
]: Make rule fixable (#1401, thanks @TrevorBurnham)parseForESLint
from custom parser (#1435, thanks @JounQin)no-extraneous-dependencies
]: Implement support for bundledDependencies (#1436, thanks @schmidsi))no-unused-modules
]: add flow type support (#1542, thanks @rfermann)order
]: Adds support for pathGroups to allow ordering by defined patterns (#795, #1386, thanks @Mairu)no-duplicates
]: Add considerQueryString
option : allow duplicate imports with different query strings (#1107, thanks @pcorpet).order
]: Add support for alphabetical sorting of import paths within import groups (#1360, #1105, #629, thanks @duncanbeevers, @stropho, @luczsoma, @randallreedjr)no-commonjs
]: add allowConditionalRequire
option (#1439, thanks @Pessimistress)default
]: make error message less confusing (#1470, thanks [@golopot])ExportMap.for
by only loading paths when necessary. (#1519, thanks @brendo)order
]: fix autofix to not move imports across fn calls (#1253, thanks @tihonove)prefer-default-export
]: fix false positive with type export (#1506, thanks [@golopot])extensions
]: Fix ignorePackages
to produce errors (#1521, thanks @saschanaz)no-unused-modules
]: fix crash due to export *
(#1496, thanks @Taranys)no-cycle
]: should not warn for Flow imports (#1494, thanks @maxmalov)order
]: fix @someModule
considered as unknown
instead of internal
(#1493, thanks @aamulumi)no-extraneous-dependencies
]: Check export from
(#1049, thanks @marcusdarmstrong)no-useless-path-segments
]: add docs for option commonjs
(#1507, thanks [@golopot])@typescript-eslint/parser
(#1409, thanks @bradzacher)prefer-default-export
]: don't warn on TypeAlias & TSTypeAliasDeclaration (#1377, thanks @sharmilajesupaul)no-unused-modules
]: Exclude package "main"/"bin"/"browser" entry points (#1404, thanks @rfermann)export
]: false positive for TypeScript overloads (#1412, thanks [@golopot])order
]: Adds support for correctly sorting unknown types into a single group (#1375, thanks [@swernerx])order
]: add fixer for destructuring commonjs import (#1372, thanks [@golopot])no-unused-modules
]: handle ClassDeclaration (#1371, thanks [@golopot])no-cycle
]: split code examples so file separation is obvious (#1370, thanks @alex-page)no-named-as-default-member
]: update broken link (#1389, thanks @fooloomanzoo)no-common-js
]: Also throw an error when assigning (#1354, thanks @charlessuh)no-unused-modules
]: don't crash when lint file outside src-folder (#1347, thanks @rfermann)no-unused-modules
]: make import { name as otherName }
work (#1340, #1342, thanks @rfermann)no-unused-modules
]: make appveyor tests passing (#1333, thanks @rfermann)named
]: ignore Flow typeof
imports and type
exports (#1345, thanks @loganfsmyth)no-unused-modules
in README (#1358, thanks [@golopot])no-unused-modules
]: Indicates usage, plugin defaults to no-op, and add description to main README.md (#1352, thanks @johndevedu)env
option for eslint-import-resolver-webpack
(#1363, thanks @kgregory)no-unused-modules
]: avoid crash when using ignoreExports
-option (#1331, #1323, thanks @rfermann)no-unused-modules
]: make sure that rule with no options will not fail (#1330, #1334, thanks @kiwka)eslint-module-utils
(#1322)no-useless-path-segments
]: Add noUselessIndex
option (#1290, thanks @timkraut)no-duplicates
]: Add autofix (#1312, thanks @lydell)no-unused-modules
] rule (#1142, thanks @rfermann)order
]: Fix interpreting some external modules being interpreted as internal modules (#793, #794 thanks @ephys)namespace
]: add check for null ExportMap (#1235, #1144, thanks @ljqx)no-cycle
], [no-relative-parent-import
], [no-unresolved
], [no-useless-path-segments
]) (#1218, #1166, #1035, thanks @vikr01)export
]: false positives for TypeScript type + value export (#1319, thanks @bradzacher)export
]: Support TypeScript namespaces (#1320, #1300, thanks @bradzacher)no-commonjs
]: add tests that show corner cases (#1308, thanks @TakeScoop)typescript
config (#1257, thanks @kirill-konshin)SourceCode
objects for all parsed dependencies, resolved. (issue #1266, thanks @asapach and @sergei-startsev for digging in)no-named-export
] (#1157, thanks [@fsmaia])no-extraneous-dependencies
]: packageDir
option with array value was clobbering package deps instead of merging them (#1175/#1176, thanks @aravindet & @pzhine)dynamic-import-chunkname
]: Add proper webpack comment parsing (#1163, thanks @st-sloth)named
]: fix destructuring assignment (#1232, thanks @ljqx)no-useless-path-segments
]: add commonJS (CJS) support (#1128, thanks @1pete)namespace
]: add JSX check (#1151, thanks @jf248)no-cycle
]: ignore Flow imports (#1126, thanks @gajus)no-relative-parent-imports
]: resolve paths (#1135, thanks @chrislloyd)order
]: fix autofixer when using typescript-eslint-parser (#1137, thanks @justinanastos)no-relative-parent-imports
] rule: disallow relative imports from parent directories (#1093, thanks @chrislloyd)namespace
rule: ensure it works in eslint 5/ecmaVersion 2018 (thanks @ljharb)named
] rule (#931, thanks @mattijsbliek)no-useless-path-segments
] rule (#1068, thanks @manovotny)packageDir
option for [no-extraneous-dependencies
] can be array-valued (#1085, thanks @hulkish)first
] (#1046, thanks @fengkfengk)allow-require
option for [no-commonjs
] rule (#880, thanks @futpib)group-exports
] rule: style-guide rule to report use of multiple named exports (#721, thanks @robertrossmann)no-self-import
] rule: forbids a module from importing itself. (#727, #449, #447, thanks @giodamelio).no-default-export
] rule (#889, thanks @isiahmeadows)no-useless-path-segments
] rule (#912, thanks @graingert and @danny-andrews)memo-parser
] updated to require filePath
on parser options as it melts
down if it's not there, now that this plugin always provides it. (see #863)Re-releasing v2.4.0 after discovering that the memory leak is isolated to the [memo-parser
],
which is more or less experimental anyway.
Yanked due to critical issue in eslint-module-utils with cache key resulting from #839.
filePath
into parserOptions
passed to parser
(#839, thanks @sompylasar)allow
option to [no-unassigned-import
] to allow for files that match the globs (#671, #737, thanks @kevin940726).no-anonymous-default-export
] rule: report anonymous default exports (#712, thanks @duncanbeevers).order
]'s newlines-between
option to allow newlines inside import groups (#627, #628, thanks @giodamelio)count
option to the [newline-after-import
] rule to allow configuration of number of newlines expected (#742, thanks @ntdb)no-extraneous-dependencies
]: use read-pkg-up
to simplify finding + loading package.json
(#680, thanks @wtgtybhertgeghgtwtg)no-extraneous-dependencies
] (#685, thanks @ramasilveyra)no-mutable-exports
]. (#660)node_modules
. (#654)import/ignore
setting] was only being respected if the ignored module didn't start with
an import
or export
JS statementprefer-default-export
]: fixed crash on export extensions (#653)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)prefer-default-export
] handles flow export type
(#484 + #639, thanks @jakubsta)prefer-default-export
] handles re-exported default exports (#609)newline-after-import
] with decorators (#592)newline-after-import
] when next line is a decoratororder
] rule (#601)unambiguous
] rule: report modules that are not unambiguously ES modules.recommended
shared config. Roughly errors
and warnings
mixed together,
with some parserOptions
in the mix. (#402)react
shared config: added jsx: true
to parserOptions.ecmaFeatures
.no-webpack-loader-syntax
] rule: forbid custom Webpack loader syntax in imports. (#586, thanks @fson!)newlines-between: "ignore"
to [order
] (#519)no-unassigned-import
] rule (#529)import/extensions
setting] defaults to ['.js']
. (#306)import/ignore
setting] 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 of import/ignore
. (#270)newline-after-import
]: Removed need for an empty line after an inline require
call (#570)order
]: Default value for newlines-between
option is now ignore
(#519)imports-first
is renamed to [first
]. imports-first
alias will continue to
exist, but may be removed in a future major release.no-unresolved
].
Other rules will ignore case-mismatches on paths on case-insensitive filesystems. (#311)no-dynamic-require
] rule: forbid require()
calls with expressions. (#567, #568)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!)no-named-as-default
] no longer false-positives on export default from '...'
(#566, thanks @preco21)default
]: allow re-export of values from ignored files as default (#545, thanks @skyrpex)allow
option to [no-nodejs-modules
] to allow exceptions (#452, #509).no-absolute-path
] rule (#530, #538)max-dependencies
] for specifying the maximum number of dependencies (both import
and require
) a module can have. (see #489, thanks @tizmagik)no-extraneous-dependencies
], after much bikeshedding. Thanks, @knpwrs! (#527)no-named-as-default-member
] Allow default import to have a property named "default" (#507, #508, thanks @jquense for both!)import/parsers
setting]: parse some dependencies (i.e. TypeScript!) with a different parser than the ESLint-configured parser. (#503)namespace
] exception for get property from namespace
import, which are re-export from commonjs module (#499 fixes #416, thanks @wKich)allowComputed
option for [namespace
] rule. If set to true
, won't report
computed member references to namespaces. (see #456)import/extensions
setting] is respected in spite of the appearance of imports
in an imported file. (fixes #478, thanks @rhys-vdw)import/external-module-folders
setting]: a possibility to configure folders for "external" modules (#444, thanks @zloirock)newline-after-import
] exception for switch
branches with require
s iff parsed as sourceType:'module'
.
(still #441, thanks again @ljharb)peerDependencies
option to [no-extraneous-dependencies
] to allow/forbid peer dependencies (#423, #428, thanks @jfmengels!).newline-after-import
] exception for multiple require
s in an arrow
function expression (e.g. () => require('a') || require('b')
). (#441, thanks @ljharb)Symbol
dependencies (i.e. for-of
loops) due to Node 0.10 polyfill
issue (see #415). Should not make any discernible semantic difference.npm prepublish
of 1.10.1.
Several rm -rf node_modules && npm i
and gulp clean && npm prepublish
s later, it is rebuilt and republished as 1.10.2. Thanks @rhettlivingston for noticing and reporting!2.x - 3.x
)no-restricted-paths
]. (#155/#371, thanks @lo1tuma)import/core-modules
setting]: allow configuration of additional module names,
to be treated as builtin modules (a la path
, etc. in Node). (#275 + #365, thanks @sindresorhus for driving)newline-after-import
related to the use of switch cases. (fixes #386, thanks @ljharb for reporting) (#395)no-deprecated
]. (#321, thanks @josh)prefer-default-export
] handles export function
and export const
in same file (#359, thanks @scottnonnenberg)export * from 'foo'
now properly ignores a default
export from foo
, if any. (#328/#332, thanks @jkimbo)
This impacts all static analysis of imported names. ([default
], [named
], [namespace
], [export
])order
]'s newline-between
option handle multiline import statements (#313, thanks @singles)order
]'s newline-between
option handle not assigned import statements (#313, thanks @singles)order
]'s newline-between
option ignore require
statements inside object literals (#313, thanks @singles)prefer-default-export
] properly handles deep destructuring, export * from ...
, and files with no exports. (#342+#343, thanks @scottnonnenberg)no-mutable-exports
]. (#317, fixed by #322. thanks @borisyankov + @jfmengels)no-extraneous-dependencies
] handle scoped packages (#316, thanks @jfmengels)newline-after-import
], new rule. (#245, thanks @singles)optionalDependencies
option to [no-extraneous-dependencies
] to allow/forbid optional dependencies (#266, thanks @jfmengels).newlines-between
option to [order
] rule (#298, thanks @singles)no-mutable-exports
] rule (#290, thanks @josh)import/extensions
setting]: a list of file extensions to parse as modules
and search for export
s. If unspecified, all extensions are considered valid (for now).
In v2, this will likely default to ['.js', MODULE_EXT]
. (#297, to fix #267)extensions
]: fallback to source path for extension enforcement if imported
module is not resolved. Also, never report for builtins (i.e. path
). (#296)no-named-as-default-member
]: don't crash on rest props. (#281, thanks @SimenB)null
to path
functions.
Thanks to @strawbrary for bringing this up (#272) and adding OSX support to the Travis
config (#288).no-named-as-default-member
] to warnings
canned configno-extraneous-dependencies
] rule (#241, thanks @jfmengels)extensions
] rule (#250, thanks @lo1tuma)no-nodejs-modules
] rule (#261, thanks @jfmengels)order
] rule (#247, thanks @jfmengels)resolve.fallback
config option in the webpack resolver (#254)imports-first
] now allows directives (i.e. 'use strict'
) strictly before
any imports (#256, thanks @lemonmade)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)no-namespace
] rule (#239, thanks @singles)no-named-as-default-member
] rule (#243, thanks @dmnd)es6-*
ponyfills. Using native Map/Set/Symbol.package.json/files
instead of .npmignore
for package file inclusion (#228, thanks @mathieudutour)es6-*
ponyfills instead of babel-runtime
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).
import/ignore
setting] if
something that looks like an export
is detected in the module content.Thanks @lencioni for identifying a huge amount of rework in resolve and kicking off a bunch of memoization.
I'm seeing 62% improvement over my normal test codebase when executing only
[no-unresolved
] in isolation, and ~35% total reduction in lint time.
import/cache
setting]ignore
option to [no-unresolved
] for those pesky files that no resolver can find. (still prefer enhancing the Webpack and Node resolvers to using it, though). See #89 for details.namespace
]/[no-deprecated
]) (#211)namespace
] no longer flags modules with only a default export as having no names. (ns.default is valid ES6)stage-0
shared configno-deprecated
]no-deprecated
]: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules.import/parser
or import/parse-options
. Instead, ESLint provides the configured parser + options to the rules, and they use that to parse dependencies.babylon
as default import parser (see Breaking)no-commonjs
] ruleno-amd
] ruleno-require
rule. [no-commonjs
] is more complete.Unpublished from npm and re-released as 0.13.0. See #170.
import/ignore
setting] if exports are actually found in the parsed module. Does this to support use of jsnext:main
in node_modules
without the pain of managing an allow list or a nuanced deny list.See GitHub release notes for info on changes for earlier releases.