Change Log
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.
Unreleased
2.26.0 - 2022-04-05
Added
- [
no-named-default
,no-default-export
,prefer-default-export
,no-named-export
,export
,named
,namespace
,no-unused-modules
]: support arbitrary module namespace names (#2358, thanks @sosukesuzuki) - <code>no-dynamic-require</code>: support dynamic import with espree (#2371, thanks @sosukesuzuki)
- <code>no-relative-packages</code>: add fixer (#2381, thanks @forivall)
Fixed
- <code>default</code>:
typescript-eslint-parser
: avoid a crash on exporting as namespace (thanks @ljharb) - <code>export</code>/TypeScript: false positive for typescript namespace merging ([#1964], thanks @magarcia)
- <code>no-duplicates</code>: ignore duplicate modules in different TypeScript module declarations (#2378, thanks @remcohaszing)
- <code>no-unused-modules</code>: avoid a crash when processing re-exports (#2388, thanks @ljharb)
Changed
- [Tests]
no-nodejs-modules
: add tests for node protocol URL (#2367, thanks @sosukesuzuki) - [Tests]
default
,no-anonymous-default-export
,no-mutable-exports
,no-named-as-default-member
,no-named-as-default
: add tests for arbitrary module namespace names (#2358, thanks @sosukesuzuki) - Docs: Fix RegExp escaping in readme (#2332, thanks @stephtr)
- [Refactor]
namespace
: try to improve performance (#2340, thanks @ljharb) - [Docs] make rule doc titles consistent (#2393, thanks @TheJaredWilcurt)
- [Docs]
order
: TS code examples should use TS code blocks (#2411, thanks [@MM25Zamanian]) - [Docs]
no-unresolved
: fix link (#2417, thanks @kylemh)
2.25.4 - 2022-01-02
Fixed
importType
: avoid crashing on a non-string' (#2305, thanks @ljharb)- <code>first</code>: prevent crash when parsing angular templates (#2210, thanks @ljharb)
importType
: properly resolve@/*
-aliased imports as internal (#2334, thanks @ombene)- <code>named</code>/
ExportMap
: handle named imports from CJS modules that use dynamic import (#2341, thanks @ludofischer)
Changed
- [
no-default-import
]: report on the token "default" instead of the entire node (#2299, thanks @pmcelhaney) - Docs: Remove duplicate mention of default (#2280, thanks @johnthagen)
- [Deps] update
eslint-module-utils
2.25.3 - 2021-11-09
Fixed
- <code>extensions</code>: ignore unresolveable type-only imports (#2270, #2271, thanks @jablko)
importType
: fixisExternalModule
calculation (#2282, thanks @mx-bernhard)- <code>no-import-module-exports</code>: avoid false positives with a shadowed
module
orexports
(#2297, thanks @ljharb)
Changed
- Docs: add type to the default groups (#2272, thanks @charpeni)
- [readme] Add note to TypeScript docs to install appropriate resolver (#2279, thanks @johnthagen)
- [Refactor]
importType
: combine redundantisScoped
andisScopedModule
(thanks @ljharb) - [Docs] HTTP => HTTPS (#2287, thanks @Schweinepriester)
2.25.2 - 2021-10-12
Fixed
2.25.1 - 2021-10-11
Fixed
- [Deps] update
eslint-module-utils
2.25.0 - 2021-10-11
Added
- Support
eslint
v8 (#2191, thanks @ota-meshi) - <code>no-unresolved</code>: add
caseSensitiveStrict
option (#1262, thanks @sergei-startsev) - <code>no-unused-modules</code>: add eslint v8 support (#2194, thanks [@coderaiser])
- <code>no-restricted-paths</code>: add/restore glob pattern support (#2219, thanks @stropho)
- <code>no-unused-modules</code>: support dynamic imports (#1660, #2212, thanks @maxkomarychev, @aladdin-add, @Hypnosphi)
Fixed
- <code>no-unresolved</code>: ignore type-only imports (#2220, thanks @jablko)
- <code>order</code>: fix sorting imports inside TypeScript module declarations (#2226, thanks @remcohaszing)
- <code>default</code>,
ExportMap
: Resolve extended TypeScript configuration files (#2240, thanks @mrmckeb)
Changed
- [Refactor] switch to an internal replacement for
pkg-up
andread-pkg-up
(#2047, thanks @mgwalker) - [patch] TypeScript config: remove
.d.ts
from <code>import/parsers</code> setting and <code>import/extensions</code> setting - Refactor, <code>no-extraneous-dependencies</code>: moduleVisitor usage (#2233, thanks @jablko)
2.24.2 - 2021-08-24
Fixed
- <code>named</code>, <code>namespace</code>: properly handle ExportAllDeclarations (#2199, thanks @ljharb)
2.24.1 - 2021-08-19
Fixed
ExportMap
: Add default export when esModuleInterop is true and anything is exported (#2184, thanks @Maxim-Mazurok)- <code>named</code>, <code>namespace</code>: properly set reexports on
export * as โฆ from
(#1998, #2161, thanks @ljharb) - <code>no-duplicates</code>: correctly handle case of mixed default/named type imports (#2149, thanks @GoodForOneFare, @nwalters512)
- <code>no-duplicates</code>: avoid crash with empty
import type {}
(#2201, thanks @ljharb)
Changed
- [Docs]
max-dependencies
: ๐ DocumentignoreTypeImports
option (#2196, thanks @himynameisdave)
2.24.0 - 2021-08-08
Added
- <code>no-dynamic-require</code>: add option
esmodule
(#1223, thanks @vikr01) - <code>named</code>: add
commonjs
option (#1222, thanks @vikr01) - <code>no-namespace</code>: Add
ignore
option (#2112, thanks @aberezkin) - <code>max-dependencies</code>: add option
ignoreTypeImports
(#1847, thanks @rfermann)
Fixed
- <code>no-duplicates</code>: ensure autofix avoids excessive newlines (#2028, thanks @ertrzyiks)
- <code>extensions</code>: avoid crashing on partially typed import/export statements (#2118, thanks @ljharb)
- <code>no-extraneous-dependencies</code>: add ESM intermediate package.json support (#2121, thanks @paztis)
- Use
context.getPhysicalFilename()
when available (ESLint 7.28+) (#2160, thanks @pmcelhaney) - <code>extensions</code>/
importType
: fix isScoped treating @/abc as scoped module (#2146, thanks @rperello)
Changed
- Docs: improved cases for using
@/...
(#2140, thanks @wenfangdu) - Docs: removed incorrect cases (#2138, thanks @wenfangdu)
- Tests: add tests for
pathGroupsExcludedImportTypes: ['type']
(#2158, thanks @atav32) - Docs: improve the documentation for the
pathGroupsExcludedImportTypes
option (#2156, thanks @liby) - Tests: Restructure test files (#1517, thanks @soryy708)
- [Docs] add description how to use plugin with yarn berry (#2179, thanks @KostyaZgara)
2.23.4 - 2021-05-29
Fixed
- <code>no-import-module-exports</code>: Don't crash if packages have no entrypoint (#2099, thanks @eps1lon)
- <code>no-extraneous-dependencies</code>: fix package name algorithm (#2097, thanks @paztis)
2.23.3 - 2021-05-21
Fixed
- <code>no-restricted-paths</code>: fix false positive matches (#2090, thanks @malykhinvi)
- <code>no-cycle</code>: ignore imports where imported file only imports types of importing file (#2083, thanks @cherryblossom000)
- <code>no-cycle</code>: fix false negative when file imports a type after importing a value in Flow (#2083, thanks @cherryblossom000)
- <code>order</code>: restore default behavior unless
type
is in groups (#2087, thanks @grit96)
Changed
2.23.2 - 2021-05-15
Changed
- [meta] add
safe-publish-latest
; useprepublishOnly
script for npm 7+
2.23.1 - 2021-05-14
Fixed
- <code>newline-after-import</code>: fix crash with
export {}
syntax (#2063, #2056, thanks @ljharb) ExportMap
: do not crash when tsconfig lacks.compilerOptions
(#2067, thanks @ljharb)- <code>order</code>: fix alphabetical sorting (#2071, thanks @grit96)
2.23.0 - 2021-05-13
Added
- <code>no-commonjs</code>: Also detect require calls with expressionless template literals:
require(`x`)
(#1958, thanks @FloEdelmann) - <code>no-internal-modules</code>: Add
forbid
option (#1846, thanks @guillaumewuip) - add <code>no-relative-packages</code>
- add <code>no-import-module-exports</code> rule: report import declarations with CommonJS exports (#804, thanks @kentcdodds and @ttmarek)
- <code>no-unused-modules</code>: Support destructuring assignment for
export
. (#1997, thanks @s-h-a-d-o-w) - <code>order</code>: support type imports (#2021, thanks @grit96)
- <code>order</code>: Add
warnOnUnassignedImports
option to enable warnings for out of order unassigned imports (#1990, thanks @hayes)
Fixed
- <code>export</code>/TypeScript: properly detect export specifiers as children of a TS module block (#1889, thanks @andreubotella)
- <code>order</code>: ignore non-module-level requires (#1940, thanks @golopot)
- <code>no-webpack-loader-syntax</code>/TypeScript: avoid crash on missing name (#1947, thanks @leonardodino)
- <code>no-extraneous-dependencies</code>: Add package.json cache (#1948, thanks @fa93hws)
- <code>prefer-default-export</code>: handle empty array destructuring (#1965, thanks @ljharb)
- <code>no-unused-modules</code>: make type imports mark a module as used (fixes #1924) (#1974, thanks @cherryblossom000)
- <code>no-cycle</code>: fix perf regression (#1944, thanks @Blasz)
- <code>first</code>: fix handling of
import = require
([#1963], thanks @MatthiasKunnen) - <code>no-cycle</code>/<code>extensions</code>: fix isExternalModule usage (#1696, thanks @paztis)
- <code>extensions</code>/<code>no-cycle</code>/<code>no-extraneous-dependencies</code>: Correct module real path resolution (#1696, thanks @paztis)
- <code>no-named-default</code>: ignore Flow import type and typeof (#1983, thanks @christianvuerings)
- <code>no-extraneous-dependencies</code>: Exclude flow
typeof
imports (#1534, thanks @devongovett) - <code>newline-after-import</code>: respect decorator annotations (#1985, thanks @lilling)
- <code>no-restricted-paths</code>: enhance performance for zones with
except
paths (#2022, thanks @malykhinvi) - <code>no-unresolved</code>: check import() (#2026, thanks @aladdin-add)
Changed
- [Generic Import Callback] Make callback for all imports once in rules (#1237, thanks @ljqx)
- Docs: add semicolon (#1897, thanks @bicstone)
- [Docs]
no-extraneous-dependencies
: correct peerDependencies option default totrue
(#1993, thanks @dwardu) - [Docs]
order
: Document options required to match ordering example ([#1992], thanks @silviogutierrez) - [Tests]
no-unresolved
: add tests forimport()
(#2012, thanks @davidbonnet) - [Docs] Add import/recommended ruleset to README (#2034, thanks @edemaine)
2.22.1 - 2020-09-27
Fixed
- <code>default</code>/TypeScript: avoid crash on
export =
with a MemberExpression (#1841, thanks @ljharb) - <code>extensions</code>/importType: Fix @/abc being treated as scoped module (#1854, thanks @3nuc)
- allow using rest operator in named export (#1878, thanks @foray1010)
- <code>dynamic-import-chunkname</code>: allow single quotes to match Webpack support (#1848, thanks @straub)
Changed
- <code>export</code>: add tests for a name collision with
export * from
(#1704, thanks @tomprats)
2.22.0 - 2020-06-26
Added
- <code>no-unused-modules</code>: consider exported TypeScript interfaces, types and enums (#1819, thanks @nicolashenry)
- <code>no-cycle</code>: allow
maxDepth
option to be"โ"
(thanks @ljharb)
Fixed
- <code>order</code>/TypeScript: properly support
import = object
expressions (#1823, thanks @manuth) - <code>no-extraneous-dependencies</code>/TypeScript: do not error when importing type from dev dependencies (#1820, thanks @fernandopasik)
- <code>default</code>: avoid crash with
export =
(#1822, thanks @AndrewLeedham) - <code>order</code>/<code>newline-after-import</code>: ignore TypeScript's "export import object" (#1830, thanks @be5invis)
- <code>dynamic-import-chunkname</code>/TypeScript: supports
@typescript-eslint/parser
(#1833, thanks @noelebrun) - <code>order</code>/TypeScript: ignore ordering of object imports (#1831, thanks @manuth)
- <code>namespace</code>: do not report on shadowed import names (#518, thanks @ljharb)
- <code>export</code>: avoid warning on
export * as
non-conflicts (#1834, thanks @ljharb)
Changed
- <code>no-extraneous-dependencies</code>: add tests for importing types (#1824, thanks @taye)
- docs: Fix docs url (#1836, thanks @beatrizrezener)
- docs: deprecation info and link to
first
docs (#1835, thanks @beatrizrezener)
2.21.2 - 2020-06-09
Fixed
- <code>order</code>: avoid a crash on TypeScriptโs
export import
syntax (#1808, thanks @ljharb) - <code>newline-after-import</code>: consider TypeScript
import =
syntax' (#1811, thanks @ljharb) - <code>no-internal-modules</code>: avoid a crash on a named export declaration (#1814, thanks @ljharb)
2.21.1 - 2020-06-07
Fixed
2.21.0 - 2020-06-07
Added
- [
import/default
]: support default export in TSExportAssignment (#1528, thanks @joaovieira) - <code>no-cycle</code>: add
ignoreExternal
option (#1681, thanks @sveyret) - <code>order</code>: Add support for TypeScript's "import equals"-expressions (#1785, thanks @manuth)
- [
import/default
]: support default export in TSExportAssignment (#1689, thanks @Maxim-Mazurok) - <code>no-restricted-paths</code>: add custom message support (#1802, thanks @malykhinvi)
Fixed
- <code>group-exports</code>: Flow type export awareness (#1702, thanks @ernestostifano)
- <code>order</code>: Recognize pathGroup config for first group (#1719, #1724, thanks @forivall, @xpl)
- <code>no-unused-modules</code>: Fix re-export not counting as usage when used in combination with import (#1722, thanks @Ephem)
- <code>no-duplicates</code>: Handle TS import type (#1676, thanks @kmui2)
- <code>newline-after-import</code>: recognize decorators (#1139, thanks @atos1990)
- <code>no-unused-modules</code>: Revert "flow: add flow type support" (#1770, thanks @Hypnosphi)
- TypeScript: Add nested namespace handling (#1763, thanks @julien1619)
- <code>namespace</code>/
ExportMap
: Fix interface declarations for TypeScript (#1764, thanks @julien1619) - <code>no-unused-modules</code>: avoid order-dependence (#1744, thanks @darkartur)
- <code>no-internal-modules</code>: also check
export from
syntax (#1691, thanks @adjerbetian) - TypeScript: <code>export</code>: avoid a crash with
export =
(#1801, thanks @ljharb)
Changed
- [Refactor]
no-extraneous-dependencies
: use moduleVisitor (#1735, thanks @adamborowski) - TypeScript config: Disable <code>named</code> (#1726, thanks @astorije)
- [readme] Remove duplicate <code>no-unused-modules</code> from docs (#1690, thanks @arvigeus)
- [Docs]
order
: fix bad inline config (#1788, thanks @nickofthyme) - [Tests] Add fix for Windows Subsystem for Linux (#1786, thanks @manuth)
- [Docs]
no-unused-rules
: Fix docs for unused exports (#1776, thanks @barbogast) - [eslint] bump minimum v7 version to v7.2.0
[2.20.2] - 2020-03-28
Fixed
- <code>order</code>: fix
isExternalModule
detect on windows (#1651, thanks @fisker) - <code>order</code>: recognize ".." as a "parent" path (#1658, thanks @golopot)
- <code>no-duplicates</code>: fix fixer on cases with default import (#1666, thanks @golopot)
- <code>no-unused-modules</code>: Handle
export { default } from
syntax (#1631, thanks @richardxia) - <code>first</code>: Add a way to disable
absolute-first
explicitly (#1664, thanks @TheCrueltySage) - [Docs]
no-webpack-loader-syntax
: Updates webpack URLs (#1751, thanks @MikeyBeLike)
2.20.1 - 2020-02-01
Fixed
- <code>export</code>: Handle function overloading in
*.d.ts
(#1619, thanks @IvanGoncharov) - <code>no-absolute-path</code>: fix a crash with invalid import syntax (#1616, thanks @ljharb)
- <code>import/external-module-folders</code> setting now correctly works with directories containing modules symlinked from
node_modules
(#1605, thanks @skozin) - <code>extensions</code>: for invalid code where
name
does not exist, do not crash (#1613, thanks @ljharb) - <code>extensions</code>: Fix scope regex (#1611, thanks @yordis)
- <code>no-duplicates</code>: allow duplicate imports if one is a namespace and the other not (#1612, thanks @sveyret)
- Add some missing rule meta schemas and types (#1620, thanks @bmish)
- <code>named</code>: for importing from a module which re-exports named exports from a
node_modules
module (#1569, #1447, thanks @redbugz, @kentcdodds) - <code>order</code>: Fix alphabetize for mixed requires and imports (#1626, thanks @wschurman)
Changed
- <code>import/external-module-folders</code> setting behavior is more strict now: it will only match complete path segments (#1605, thanks @skozin)
- [meta] fix "files" field to include/exclude the proper files (#1635, thanks @ljharb)
- [Tests]
order
: Add TS import type tests (#1736, thanks @kmui2)
2.20.0 - 2020-01-10
Added
- <code>order</code>: added
caseInsensitive
as an additional option toalphabetize
(#1586, thanks @dbrewer5) - <code>no-restricted-paths</code>: New
except
option perzone
, allowing exceptions to be defined for a restricted zone (#1238, thanks @rsolomon) - <code>order</code>: add option pathGroupsExcludedImportTypes to allow ordering of external import types (#1565, thanks @Mairu)
Fixed
- <code>no-unused-modules</code>: fix usage of <code>import/extensions</code> setting
- <code>extensions</code>: ignore non-main modules (#1563, thanks @saschanaz)
- TypeScript config: lookup for external modules in @types folder (#1526, thanks @joaovieira)
- <code>no-extraneous-dependencies</code>: ensure
node.source
is truthy (#1589, thanks @ljharb) - <code>extensions</code>: Ignore query strings when checking for extensions (#1572, thanks @pcorpet)
Docs
- <code>extensions</code>: improve
ignorePackages
docs (#1248, thanks @ivo-stefchev)
2.19.1 - 2019-12-08
Fixed
- <code>no-extraneous-dependencies</code>: ensure
node.source
exists
2.19.0 - 2019-12-08
Added
- <code>internal-regex</code> setting: regex pattern for marking packages "internal" (#1491, thanks @Librazy)
- <code>group-exports</code>: make aggregate module exports valid (#1472, thanks @atikenny)
- <code>no-namespace</code>: Make rule fixable (#1401, thanks @TrevorBurnham)
- support
parseForESLint
from custom parser (#1435, thanks @JounQin) - <code>no-extraneous-dependencies</code>: Implement support for bundledDependencies (#1436, thanks @schmidsi))
- <code>no-unused-modules</code>: add flow type support (#1542, thanks @rfermann)
- <code>order</code>: Adds support for pathGroups to allow ordering by defined patterns (#795, #1386, thanks @Mairu)
- <code>no-duplicates</code>: Add
considerQueryString
option : allow duplicate imports with different query strings (#1107, thanks @pcorpet). - <code>order</code>: Add support for alphabetical sorting of import paths within import groups (#1360, #1105, #629, thanks @duncanbeevers, @stropho, @luczsoma, @randallreedjr)
- <code>no-commonjs</code>: add
allowConditionalRequire
option (#1439, thanks @Pessimistress)
Fixed
- <code>default</code>: make error message less confusing (#1470, thanks @golopot)
- Improve performance of
ExportMap.for
by only loading paths when necessary. (#1519, thanks @brendo) - Support export of a merged TypeScript namespace declaration (#1495, thanks @benmunro)
- <code>order</code>: fix autofix to not move imports across fn calls (#1253, thanks @tihonove)
- <code>prefer-default-export</code>: fix false positive with type export (#1506, thanks @golopot)
- <code>extensions</code>: Fix
ignorePackages
to produce errors (#1521, thanks @saschanaz) - <code>no-unused-modules</code>: fix crash due to
export *
(#1496, thanks @Taranys) - <code>no-cycle</code>: should not warn for Flow imports (#1494, thanks @maxmalov)
- <code>order</code>: fix
@someModule
considered asunknown
instead ofinternal
(#1493, thanks @aamulumi) - <code>no-extraneous-dependencies</code>: Check
export from
(#1049, thanks @marcusdarmstrong)
Docs
- <code>no-useless-path-segments</code>: add docs for option
commonjs
(#1507, thanks @golopot)
Changed
- <code>no-unused-modules</code>/
eslint-module-utils
: Avoid superfluous calls and code (#1551, thanks @brettz9)
2.18.2 - 2019-07-19
Fixed
2.18.1 - 2019-07-18
Fixed
- Improve parse perf when using
@typescript-eslint/parser
(#1409, thanks @bradzacher) - <code>prefer-default-export</code>: don't warn on TypeAlias & TSTypeAliasDeclaration (#1377, thanks @sharmilajesupaul)
- <code>no-unused-modules</code>: Exclude package "main"/"bin"/"browser" entry points (#1404, thanks @rfermann)
- <code>export</code>: false positive for TypeScript overloads (#1412, thanks @golopot)
Refactors
- <code>no-extraneous-dependencies</code>,
importType
: remove lodash (#1419, thanks @ljharb)
2.18.0 - 2019-06-24
Added
- Support eslint v6 (#1393, thanks @sheepsteak)
- <code>order</code>: Adds support for correctly sorting unknown types into a single group (#1375, thanks @swernerx)
- <code>order</code>: add fixer for destructuring commonjs import (#1372, thanks @golopot)
- TypeScript config: add TS def extensions + defer to TS over JS (#1366, thanks @benmosher)
Fixed
- <code>no-unused-modules</code>: handle ClassDeclaration (#1371, thanks @golopot)
Docs
- <code>no-cycle</code>: split code examples so file separation is obvious (#1370, thanks @alex-page)
- <code>no-named-as-default-member</code>: update broken link (#1389, thanks @fooloomanzoo)
2.17.3 - 2019-05-23
Fixed
- [
no-common-js
]: Also throw an error when assigning (#1354, thanks @charlessuh) - <code>no-unused-modules</code>: don't crash when lint file outside src-folder (#1347, thanks @rfermann)
- <code>no-unused-modules</code>: make
import { name as otherName }
work (#1340, #1342, thanks @rfermann) - <code>no-unused-modules</code>: make appveyor tests passing (#1333, thanks @rfermann)
- <code>named</code>: ignore Flow
typeof
imports andtype
exports (#1345, thanks @loganfsmyth) - [refactor] fix eslint 6 compat by fixing imports (thank @ljharb)
- Improve support for TypeScript declare structures (#1356, thanks @christophercurrie)
Docs
- add missing
no-unused-modules
in README (#1358, thanks @golopot) - <code>no-unused-modules</code>: Indicates usage, plugin defaults to no-op, and add description to main README.md (#1352, thanks @johndevedu)
- Document
env
option foreslint-import-resolver-webpack
(#1363, thanks @kgregory)
2.17.2 - 2019-04-16
Fixed
- <code>no-unused-modules</code>: avoid crash when using
ignoreExports
-option (#1331, #1323, thanks @rfermann) - <code>no-unused-modules</code>: make sure that rule with no options will not fail (#1330, #1334, thanks @kiwka)
2.17.1 - 2019-04-13
Fixed
- require v2.4 of
eslint-module-utils
(#1322)
2.17.0 - 2019-04-13
Added
- <code>no-useless-path-segments</code>: Add
noUselessIndex
option (#1290, thanks @timkraut) - <code>no-duplicates</code>: Add autofix (#1312, thanks @lydell)
- Add <code>no-unused-modules</code> rule (#1142, thanks @rfermann)
- support export type named exports from TypeScript (#1304, thanks @bradennapier and @schmod)
Fixed
- <code>order</code>: Fix interpreting some external modules being interpreted as internal modules (#793, #794 thanks @ephys)
- allow aliases that start with @ to be "internal" (#1293, #1294, thanks @jeffshaver)
- aliased internal modules that look like core modules (#1297, thanks @echenley)
- <code>namespace</code>: add check for null ExportMap (#1235, #1144, thanks @ljqx)
- [ExportMap] fix condition for checking if block comment (#1234, #1233, thanks @ljqx)
- Fix overwriting of dynamic import() CallExpression (<code>no-cycle</code>, <code>no-relative-parent-imports</code>, <code>no-unresolved</code>, <code>no-useless-path-segments</code>) (#1218, #1166, #1035, thanks @vikr01)
- <code>export</code>: false positives for TypeScript type + value export (#1319, thanks @bradzacher)
- <code>export</code>: Support TypeScript namespaces (#1320, #1300, thanks @bradzacher)
Docs
- Update readme for TypeScript (#1256, #1277, thanks @kirill-konshin)
- make rule names consistent (#1112, thanks @feychenie)
Tests
- fix broken tests on master (#1295, thanks @jeffshaver and @ljharb)
- <code>no-commonjs</code>: add tests that show corner cases (#1308, thanks @TakeScoop)
2.16.0 - 2019-01-29
Added
typescript
config (#1257, thanks @kirill-konshin)
Fixed
- Memory leak of
SourceCode
objects for all parsed dependencies, resolved. (issue #1266, thanks @asapach and @sergei-startsev for digging in)
2.15.0 - 2019-01-22
Added
- new rule: <code>no-named-export</code>
Fixed
- <code>no-extraneous-dependencies</code>:
packageDir
option with array value was clobbering package deps instead of merging them (#1175/#1176, thanks @aravindet & @pzhine) - <code>dynamic-import-chunkname</code>: Add proper webpack comment parsing (#1163, thanks @st-sloth)
- <code>named</code>: fix destructuring assignment (#1232, thanks @ljqx)
2.14.0 - 2018-08-13
Added
- <code>no-useless-path-segments</code>: add commonJS (CJS) support (#1128, thanks @1pete)
- <code>namespace</code>: add JSX check (#1151, thanks @jf248)
Fixed
- <code>no-cycle</code>: ignore Flow imports (#1126, thanks @gajus)
- fix Flow type imports (#1106, thanks @syymza)
- <code>no-relative-parent-imports</code>: resolve paths (#1135, thanks @chrislloyd)
- <code>order</code>: fix autofixer when using typescript-eslint-parser (#1137, thanks @justinanastos)
- repeat fix from #797 for #717, in another place (thanks @ljharb)
Refactors
- add explicit support for RestElement alongside ExperimentalRestProperty (thanks @ljharb)
2.13.0 - 2018-06-24
Added
- Add ESLint 5 support (#1122, thanks @ai and @ljharb)
- Add <code>no-relative-parent-imports</code> rule: disallow relative imports from parent directories (#1093, thanks @chrislloyd)
Fixed
namespace
rule: ensure it works in eslint 5/ecmaVersion 2018 (thanks @ljharb)
2.12.0 - 2018-05-17
Added
- Ignore type imports for <code>named</code> rule (#931, thanks @mattijsbliek)
- Add documentation for <code>no-useless-path-segments</code> rule (#1068, thanks @manovotny)
packageDir
option for <code>no-extraneous-dependencies</code> can be array-valued (#1085, thanks @hulkish)
2.11.0 - 2018-04-09
Added
- Fixer for <code>first</code>
allow-require
option for <code>no-commonjs</code> rule (#880, thanks @futpib)
Fixed
- memory/CPU regression where ASTs were held in memory (#1058, thanks @klimashkin/@lukeapage)
2.10.0 - 2018-03-29
Added
- Autofixer for <code>order</code> rule (#908, thanks @tihonove)
- Add <code>no-cycle</code> rule: reports import cycles.
2.9.0 - 2018-02-21
Added
- Add <code>group-exports</code> rule: style-guide rule to report use of multiple named exports (#721, thanks @robertrossmann)
- Add <code>no-self-import</code> rule: forbids a module from importing itself. (#727, #449, #447, thanks @giodamelio).
- Add <code>no-default-export</code> rule (#889, thanks @isiahmeadows)
- Add <code>no-useless-path-segments</code> rule (#912, thanks @graingert and @danny-andrews)
- ... and more! check the commits for v2.9.0
2.8.0 - 2017-10-18
Added
- <code>exports-last</code> rule (#620 + #632, thanks @k15a)
Changed
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.7.0 - 2017-07-06
Changed
- <code>no-absolute-path</code> picks up speed boost, optional AMD support (#843, thanks @jseminck)
2.6.1 - 2017-06-29
Fixed
- update bundled node resolver dependency to latest version
2.6.0 - 2017-06-23
Changed
- update tests / peerDeps for ESLint 4.0 compatibility (#871, thanks @mastilver)
- <code>memo-parser</code> 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)
2.5.0 - 2017-06-22
Re-releasing v2.4.0 after discovering that the memory leak is isolated to the <code>memo-parser</code>, which is more or less experimental anyway.
Added
2.4.0 - 2017-06-02 [YANKED]
Yanked due to critical issue in eslint-module-utils with cache key resulting from #839.
Added
- Add
filePath
intoparserOptions
passed toparser
(#839, thanks @sompylasar) - Add
allow
option to <code>no-unassigned-import</code> to allow for files that match the globs (#671, #737, thanks @kevin940726).
2.3.0 - 2017-05-18
Added
- <code>no-anonymous-default-export</code> rule: report anonymous default exports (#712, thanks @duncanbeevers).
- Add new value to <code>order</code>'s
newlines-between
option to allow newlines inside import groups (#627, #628, thanks @giodamelio) - Add
count
option to the <code>newline-after-import</code> rule to allow configuration of number of newlines expected (#742, thanks @ntdb)
Changed
- <code>no-extraneous-dependencies</code>: use
read-pkg-up
to simplify finding + loadingpackage.json
(#680, thanks @wtgtybhertgeghgtwtg) - Add support to specify the package.json <code>no-extraneous-dependencies</code>
Fixed
- attempt to fix crash in <code>no-mutable-exports</code>. (#660)
- "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.2.0 - 2016-11-07
Fixed
- Corrected a few gaffs in the auto-ignore logic to fix major performance issues
with projects that did not explicitly ignore
node_modules
. (#654) - <code>import/ignore</code> setting was only being respected if the ignored module didn't start with
an
import
orexport
JS statement - <code>prefer-default-export</code>: fixed crash on export extensions (#653)
2.1.0 - 2016-11-02
Added
- Add <code>no-named-default</code> rule: style-guide rule to report use of unnecessarily named default imports (#596, thanks @ntdb)
- <code>no-extraneous-dependencies</code>: check globs against CWD + absolute path (#602 + #630, thanks @ljharb)
Fixed
- <code>prefer-default-export</code> handles flow
export type
(#484 + #639, thanks @jakubsta) - <code>prefer-default-export</code> handles re-exported default exports (#609)
- Fix crash when using <code>newline-after-import</code> with decorators (#592)
- Properly report <code>newline-after-import</code> when next line is a decorator
- Fixed documentation for the default values for the <code>order</code> rule (#601)
2.0.1 - 2016-10-06
Fixed
- Fixed code that relied on removed dependencies. (#604)
2.0.0! - 2016-09-30
Added
- <code>unambiguous</code> rule: report modules that are not unambiguously ES modules.
recommended
shared config. Roughlyerrors
andwarnings
mixed together, with someparserOptions
in the mix. (#402)react
shared config: addedjsx: true
toparserOptions.ecmaFeatures
.- Added <code>no-webpack-loader-syntax</code> rule: forbid custom Webpack loader syntax in imports. (#586, thanks @fson!)
- Add option
newlines-between: "ignore"
to <code>order</code> - Added <code>no-unassigned-import</code> rule (#529)
Breaking
- <code>import/extensions</code> setting defaults to
['.js']
. (#306) - <code>import/ignore</code> setting defaults to nothing, and ambiguous modules are ignored natively. This means importing from CommonJS modules will no longer be reported by <code>default</code>, <code>named</code>, or <code>namespace</code>, regardless of
import/ignore
. (#270) - <code>newline-after-import</code>: Removed need for an empty line after an inline
require
call (#570) - <code>order</code>: Default value for
newlines-between
option is nowignore
(#519)
Changed
imports-first
is renamed to <code>first</code>.imports-first
alias will continue to exist, but may be removed in a future major release.- Case-sensitivity: now specifically (and optionally) reported by <code>no-unresolved</code>. Other rules will ignore case-mismatches on paths on case-insensitive filesystems. (#311)
Fixed
- <code>no-internal-modules</code>: support
@
-scoped packages (#577+#578, thanks @spalger)
1.16.0 - 2016-09-22
Added
- Added <code>no-dynamic-require</code> rule: forbid
require()
calls with expressions. (#567, #568) - Added <code>no-internal-modules</code> rule: restrict deep package imports to specific folders. (#485, thanks @spalger!)
- <code>extensions</code>: allow override of a chosen default with options object (#555, thanks @ljharb!)
Fixed
- <code>no-named-as-default</code> no longer false-positives on
export default from '...'
(#566, thanks @preco21) - <code>default</code>: allow re-export of values from ignored files as default (#545, thanks @skyrpex)
1.15.0 - 2016-09-12
Added
- Added an
allow
option to <code>no-nodejs-modules</code> to allow exceptions (#452, #509). - Added <code>no-absolute-path</code> rule (#530, #538)
- <code>max-dependencies</code> for specifying the maximum number of dependencies (both
import
andrequire
) a module can have. (see #489, thanks @tizmagik) - Added glob option to config for <code>no-extraneous-dependencies</code>, after much bikeshedding. Thanks, @knpwrs! (#527)
Fixed
- <code>no-named-as-default-member</code> Allow default import to have a property named "default" (#507, #508, thanks @jquense for both!)
1.14.0 - 2016-08-22
Added
- <code>import/parsers</code> setting: parse some dependencies (i.e. TypeScript!) with a different parser than the ESLint-configured parser. (#503)
Fixed
- <code>namespace</code> exception for get property from
namespace
import, which are re-export from commonjs module (#499 fixes #416, thanks @wKich)
1.13.0 - 2016-08-11
Added
allowComputed
option for <code>namespace</code> rule. If set totrue
, won't report computed member references to namespaces. (see #456)
Changed
- Modified <code>no-nodejs-modules</code> error message to include the module's name (#453, #461)
Fixed
- <code>import/extensions</code> setting is respected in spite of the appearance of imports in an imported file. (fixes #478, thanks @rhys-vdw)
1.12.0 - 2016-07-26
Added
- <code>import/external-module-folders</code> setting: a possibility to configure folders for "external" modules (#444, thanks @zloirock)
1.11.1 - 2016-07-20
Fixed
- <code>newline-after-import</code> exception for
switch
branches withrequire
s iff parsed assourceType:'module'
. (still #441, thanks again @ljharb)
1.11.0 - 2016-07-17
Added
- Added an
peerDependencies
option to <code>no-extraneous-dependencies</code> to allow/forbid peer dependencies (#423, #428, thanks @jfmengels!).
Fixed
- <code>newline-after-import</code> exception for multiple
require
s in an arrow function expression (e.g.() => require('a') || require('b')
). (#441, thanks @ljharb)
1.10.3 - 2016-07-08
Fixed
- removing
Symbol
dependencies (i.e.for-of
loops) due to Node 0.10 polyfill issue (see #415). Should not make any discernible semantic difference.
1.10.2 - 2016-07-04
Fixed
- Something horrible happened during
npm prepublish
of 1.10.1. Severalrm -rf node_modules && npm i
andgulp clean && npm prepublish
s later, it is rebuilt and republished as 1.10.2. Thanks @rhettlivingston for noticing and reporting!
1.10.1 - 2016-07-02 [YANKED]
Added
- Officially support ESLint 3.x. (peerDependencies updated to
2.x - 3.x
)
1.10.0 - 2016-06-30
Added
- Added new rule <code>no-restricted-paths</code>. (#155/#371, thanks @lo1tuma)
- <code>import/core-modules</code> 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) - React Native shared config (based on comment from #283)
Fixed
- Fixed crash with
newline-after-import
related to the use of switch cases. (fixes #386, thanks @ljharb for reporting) (#395)
1.9.2 - 2016-06-21
Fixed
- Issues with ignored/CJS files in <code>export</code> and <code>no-deprecated</code> rules. (#348, #370)
1.9.1 - 2016-06-16
Fixed
- Reordered precedence for loading resolvers. (#373)
1.9.0 - 2016-06-10
Added
- Added support TomDoc comments to <code>no-deprecated</code>. (#321, thanks @josh)
- Added support for loading custom resolvers (#314, thanks @le0nik)
Fixed
- <code>prefer-default-export</code> handles
export function
andexport const
in same file (#359, thanks @scottnonnenberg)
1.8.1 - 2016-05-23
Fixed
export * from 'foo'
now properly ignores adefault
export fromfoo
, if any. (#328/#332, thanks @jkimbo) This impacts all static analysis of imported names. (<code>default</code>, <code>named</code>, <code>namespace</code>, <code>export</code>)- Make <code>order</code>'s
newline-between
option handle multiline import statements (#313, thanks @singles) - Make <code>order</code>'s
newline-between
option handle not assigned import statements (#313, thanks @singles) - Make <code>order</code>'s
newline-between
option ignorerequire
statements inside object literals (#313, thanks @singles) - <code>prefer-default-export</code> properly handles deep destructuring,
export * from ...
, and files with no exports. (#342+#343, thanks @scottnonnenberg)
1.8.0 - 2016-05-11
Added
- <code>prefer-default-export</code>, new rule. (#308, thanks @gavriguy)
Fixed
- Ignore namespace / ES7 re-exports in <code>no-mutable-exports</code>. (#317, fixed by #322. thanks @borisyankov + @jfmengels)
- Make <code>no-extraneous-dependencies</code> handle scoped packages (#316, thanks @jfmengels)
1.7.0 - 2016-05-06
Added
- <code>newline-after-import</code>, new rule. (#245, thanks @singles)
- Added an
optionalDependencies
option to <code>no-extraneous-dependencies</code> to allow/forbid optional dependencies (#266, thanks @jfmengels). - Added
newlines-between
option to <code>order</code> rule (#298, thanks @singles) - add <code>no-mutable-exports</code> rule (#290, thanks @josh)
- <code>import/extensions</code> 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)
Fixed
- <code>extensions</code>: fallback to source path for extension enforcement if imported
module is not resolved. Also, never report for builtins (i.e.
path
). (#296)
1.6.1 - 2016-04-28
Fixed
- <code>no-named-as-default-member</code>: don't crash on rest props. (#281, thanks @SimenB)
- support for Node 6: don't pass
null
topath
functions. Thanks to @strawbrary for bringing this up (#272) and adding OSX support to the Travis config (#288).
1.6.0 - 2016-04-25
Added
- add <code>no-named-as-default-member</code> to
warnings
canned config - add <code>no-extraneous-dependencies</code> rule (#241, thanks @jfmengels)
- add <code>extensions</code> rule (#250, thanks @lo1tuma)
- add <code>no-nodejs-modules</code> rule (#261, thanks @jfmengels)
- add <code>order</code> rule (#247, thanks @jfmengels)
- consider
resolve.fallback
config option in the webpack resolver (#254)
Changed
- <code>imports-first</code> now allows directives (i.e.
'use strict'
) strictly before any imports (#256, thanks @lemonmade)
Fixed
- <code>named</code> 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) - <code>no-named-as-default-member</code> had a crash on destructuring in loops (thanks for heads up from @lemonmade)
1.5.0 - 2016-04-18
Added
- report resolver errors at the top of the linted file
- add <code>no-namespace</code> rule (#239, thanks @singles)
- add <code>no-named-as-default-member</code> rule (#243, thanks @dmnd)
Changed
- Rearranged rule groups in README in preparation for more style guide rules
Removed
- support for Node 0.10, via
es6-*
ponyfills. Using native Map/Set/Symbol.
1.4.0 - 2016-03-25
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.
- Resolver documentation
Changed
- using
package.json/files
instead of.npmignore
for package file inclusion (#228, thanks @mathieudutour) - using
es6-*
ponyfills instead ofbabel-runtime
1.3.0 - 2016-03-20
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 <code>import/ignore</code> setting if
something that looks like an
export
is detected in the module content.
1.2.0 - 2016-03-19
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 <code>no-unresolved</code> in isolation, and ~35% total reduction in lint time.
Changed
- added caching to core/resolve via #214, configured via <code>import/cache</code> setting
1.1.0 - 2016-03-15
Added
- Added an <code>ignore</code> option to <code>no-unresolved</code> 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.
1.0.4 - 2016-03-11
Changed
- respect hoisting for deep namespaces (<code>namespace</code>/<code>no-deprecated</code>) (#211)
Fixed
1.0.3 - 2016-02-26
Changed
- no-deprecated follows deep namespaces (#191)
Fixed
- <code>namespace</code> no longer flags modules with only a default export as having no names. (ns.default is valid ES6)
1.0.2 - 2016-02-26
Fixed
- don't parse imports with no specifiers (#192)
1.0.1 - 2016-02-25
Fixed
- export
stage-0
shared config - documented <code>no-deprecated</code>
- deep namespaces are traversed regardless of how they get imported (#189)
1.0.0 - 2016-02-24
Added
- <code>no-deprecated</code>: WIP rule to let you know at lint time if you're using deprecated functions, constants, classes, or modules.
Changed
- <code>namespace</code>: support deep namespaces (#119 via #157)
1.0.0-beta.0 - 2016-02-13
Changed
- support for (only) ESLint 2.x
- no longer needs/refers to
import/parser
orimport/parse-options
. Instead, ESLint provides the configured parser + options to the rules, and they use that to parse dependencies.
Removed
babylon
as default import parser (see Breaking)
0.13.0 - 2016-02-08
Added
- <code>no-commonjs</code> rule
- <code>no-amd</code> rule
Removed
- Removed vestigial
no-require
rule. <code>no-commonjs</code> is more complete.
0.12.2 - 2016-02-06 [YANKED]
Unpublished from npm and re-released as 0.13.0. See #170.
0.12.1 - 2015-12-17
Changed
- Broke docs for rules out into individual files.
0.12.0 - 2015-12-14
Changed
- Ignore <code>import/ignore</code> setting if exports are actually found in the parsed module. Does this to support use of
jsnext:main
innode_modules
without the pain of managing an allow list or a nuanced deny list.
0.11.0 - 2015-11-27
Added
- Resolver plugins. Now the linter can read Webpack config, properly follow aliases and ignore externals, dismisses inline loaders, etc. etc.!
Earlier releases (0.10.1 and younger)
See GitHub release notes for info on changes for earlier releases.