Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.21.0 #1804

Merged
merged 47 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
381267a
[New] `import/default`: support default export in TSExportAssignment
joaovieira Oct 30, 2019
73211e8
[New] `no-cycle`: add `ignoreExternal` option
sveyret Mar 11, 2020
2b50d16
[Tests] Add eslint@7 prereleases to CI
golopot Apr 1, 2020
3adb3f9
[Tests] remove useless property "ruleId" in test cases
golopot Apr 1, 2020
a86ba06
[Tests] add missing outputs in test cases
golopot Apr 2, 2020
5c67f17
[Refactor] avoid using deprecated eslint api sourceCode.getComments
golopot Apr 1, 2020
fe6cea9
[Fix] `order`: Recognize pathGroup config for first group
forivall Apr 4, 2020
c629186
Merge pull request #1715 from golopot/eslint-7
ljharb Apr 4, 2020
6a110dd
[New] officially support eslint 7
ljharb Apr 4, 2020
baf1a8c
[Fix] `group-exports`: Flow type export awareness
ernestostifano Mar 29, 2020
4f1101e
[patch] TypeScript config: Disable `import/named`
astorije Apr 13, 2020
3b4487c
[Tests] unpin esquery
ljharb Apr 13, 2020
40d1e67
[Fix] `no-unused-modules`: Count re-export as usage when used in comb…
Ephem Apr 13, 2020
caf45a6
[Docs] `no-named-as-default-member`: fix a broken URL
ljharb Apr 19, 2020
9516152
[Fix] `no-duplicates`: Handle TS import type
kmui2 Mar 4, 2020
67a31b1
[Tests] `no-unused-modules`: add export + destructuring case
ljharb Apr 23, 2020
055389d
[readme] Remove duplicate no-unused-modules from docs
arvigeus Jan 11, 2020
cf8b3d9
[Docs] `no-named-as-default-member`: use non-archive.org link
ljharb Apr 23, 2020
95c12fc
[resolvers/webpack] [fix] provide config fallback
migueloller Mar 29, 2020
a8888b0
[meta] `appveyor`: only run tests, not linter
ljharb Apr 24, 2020
b307c7c
[Fix] `newline-after-import`: recognize decorators
Jul 17, 2018
92caa35
[Tests] on `node` `v14`
ljharb Apr 24, 2020
0e5bed9
[Docs] `no-webpack-loader-syntax`: Updates webpack URLs
May 6, 2020
40ee069
[Fix] `namespace`/`ExportMap`: Fix interface declarations for TypeScript
julien1619 May 13, 2020
a1c969f
[Fix] `no-unused-modules`: avoid order-dependence
darkartur May 2, 2020
3f46ccf
Revert "[flow] `no-unused-modules`: add flow type support"
Hypnosphi May 19, 2020
515957a
[Docs] `no-unused-rules`: Fix docs for unused exports
barbogast May 21, 2020
98292ed
[Refactor] `no-extraneous-dependencies`: use moduleVisitor
adamborowski Apr 26, 2020
2e72af5
[Docs] `order`: fix bad inline config
nickofthyme May 29, 2020
62b554b
[New] `order`: Add support for TypeScript's "import equals"-expressions
manuth May 29, 2020
1737429
[meta] Make `copy-metafiles` platform-independent
manuth May 29, 2020
8118170
[Tests] Add fix for Windows Subsystem for Linux
manuth May 29, 2020
5cc3147
[Fix] TypeScript: Add nested namespace handling
julien1619 May 13, 2020
6159ce9
[Tests] `no-extraneous-dependencies`: avoid hardcoded test cases for …
ljharb May 31, 2020
eb2b7ea
[Tests] `order`: Add TS import type tests
kmui2 Apr 27, 2020
1760b89
[Tests] Add `lodash.isarray` to deps as temporary fix
manuth May 31, 2020
6dd28ea
[Tests] fix coverage script for windows; tweak appveyor
manuth May 31, 2020
9dfef28
[Fix] `no-internal-modules`: also check `export from` syntax
Mar 22, 2020
e1ed323
[Tests] Improve AppVeyor Configuration
manuth May 31, 2020
0547c7e
[Tests] add test case for #1645
ljharb Jun 5, 2020
0b585a1
[New] `import/default`: support default export in TSExportAssignment
Maxim-Mazurok Mar 19, 2020
0b81052
[New] `no-restricted-paths`: Add custom message support
malykhinvi Jun 6, 2020
0d6d12e
[Tests] add test for `export *` from a d.ts file
ljharb Jun 7, 2020
4ff9b92
[Fix] TypeScript: `export`: avoid a crash with `export =`
ljharb Jun 7, 2020
199143c
[Deps] update `array-includes`, `array.prototype.flat`, `eslint-impor…
ljharb Jun 7, 2020
d84062e
[eslint] bump minimum v7 version to v7.2.0
ljharb Jun 7, 2020
2699251
Bump to v2.21.0
ljharb Jun 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ coverage
node_modules
tests/files/malformed.js
tests/files/with-syntax-error
tests/files/just-json-files/invalid.json
tests/files/typescript-d-ts/
resolvers/webpack/test/files
# we want to ignore "tests/files" here, but unfortunately doing so would
# interfere with unit test and fail it for some reason.
Expand Down
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '14'
- '13'
- '12'
- '10'
Expand All @@ -10,6 +11,7 @@ node_js:
os: linux

env:
- ESLINT_VERSION=^7.0.0-0
- ESLINT_VERSION=6
- ESLINT_VERSION=5
- ESLINT_VERSION=4
Expand All @@ -22,7 +24,7 @@ matrix:
- env: LINT=true
node_js: lts/*
- env: PACKAGE=resolvers/node
node_js: 13
node_js: 14
- env: PACKAGE=resolvers/node
node_js: 12
- env: PACKAGE=resolvers/node
Expand All @@ -33,6 +35,8 @@ matrix:
node_js: 6
- env: PACKAGE=resolvers/node
node_js: 4
- env: PACKAGE=resolvers/webpack
node_js: 14
- env: PACKAGE=resolvers/webpack
node_js: 12
- env: PACKAGE=resolvers/webpack
Expand All @@ -44,6 +48,9 @@ matrix:
- env: PACKAGE=resolvers/webpack
node_js: 4

- os: osx
env: ESLINT_VERSION=5
node_js: 14
- os: osx
env: ESLINT_VERSION=5
node_js: 12
Expand All @@ -65,8 +72,14 @@ matrix:
env: ESLINT_VERSION=5
- node_js: '4'
env: ESLINT_VERSION=6
- node_js: '4'
env: ESLINT_VERSION=^7.0.0-0
- node_js: '6'
env: ESLINT_VERSION=6
- node_js: '6'
env: ESLINT_VERSION=^7.0.0-0
- node_js: '8'
env: ESLINT_VERSION=^7.0.0-0

fast_finish: true
allow_failures:
Expand All @@ -76,6 +89,7 @@ matrix:

before_install:
- 'nvm install-latest-npm'
- 'npm install'
- 'npm run copy-metafiles'
- 'if [ -n "${PACKAGE-}" ]; then cd "${PACKAGE}"; fi'
install:
Expand Down
80 changes: 79 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,44 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel

## [Unreleased]

## [2.21.0] - 2020-06-07
### Added
- [`import/default`]: support default export in TSExportAssignment ([#1528], thanks [@joaovieira])
- [`no-cycle`]: add `ignoreExternal` option ([#1681], thanks [@sveyret])
- [`order`]: Add support for TypeScript's "import equals"-expressions ([#1785], thanks [@manuth])
- [`import/default`]: support default export in TSExportAssignment ([#1689], thanks [@Maxim-Mazurok])
- [`no-restricted-paths`]: add custom message support ([#1802], thanks [@malykhinvi])

### Fixed
- [`group-exports`]: Flow type export awareness ([#1702], thanks [@ernestostifano])
- [`order`]: Recognize pathGroup config for first group ([#1719], [#1724], thanks [@forivall], [@xpl])
- [`no-unused-modules`]: Fix re-export not counting as usage when used in combination with import ([#1722], thanks [@Ephem])
- [`no-duplicates`]: Handle TS import type ([#1676], thanks [@kmui2])
- [`newline-after-import`]: recognize decorators ([#1139], thanks [@atos1990])
- [`no-unused-modules`]: Revert "[flow] `no-unused-modules`: add flow type support" ([#1770], thanks [@Hypnosphi])
- TypeScript: Add nested namespace handling ([#1763], thanks [@julien1619])
- [`namespace`]/`ExportMap`: Fix interface declarations for TypeScript ([#1764], thanks [@julien1619])
- [`no-unused-modules`]: avoid order-dependence ([#1744], thanks [@darkartur])
- [`no-internal-modules`]: also check `export from` syntax ([#1691], thanks [@adjerbetian])
- TypeScript: [`export`]: avoid a crash with `export =` ([#1801], thanks [@ljharb])

### Changed
- [Refactor] `no-extraneous-dependencies`: use moduleVisitor ([#1735], thanks [@adamborowski])
- TypeScript config: Disable [`named`][] ([#1726], thanks [@astorije])
- [readme] Remove duplicate no-unused-modules 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
- [`order`]: fix `isExternalModule` detect on windows ([#1651], thanks [@fisker])
- [`order`]: recognize ".." as a "parent" path ([#1658], thanks [@golopot])
- [`no-duplicates`]: fix fixer on cases with default import ([#1666], thanks [@golopot])
- [`no-unused-modules`]: Handle `export { default } from` syntax ([#1631], thanks [@richardxia])
- [`first`]: 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
Expand All @@ -29,6 +60,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
### Changed
- [`import/external-module-folders` 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
Expand Down Expand Up @@ -660,6 +692,29 @@ for info on changes for earlier releases.

[`memo-parser`]: ./memo-parser/README.md

[#1802]: https://github.com/benmosher/eslint-plugin-import/pull/1802
[#1801]: https://github.com/benmosher/eslint-plugin-import/issues/1801
[#1788]: https://github.com/benmosher/eslint-plugin-import/pull/1788
[#1786]: https://github.com/benmosher/eslint-plugin-import/pull/1786
[#1785]: https://github.com/benmosher/eslint-plugin-import/pull/1785
[#1776]: https://github.com/benmosher/eslint-plugin-import/pull/1776
[#1770]: https://github.com/benmosher/eslint-plugin-import/pull/1770
[#1764]: https://github.com/benmosher/eslint-plugin-import/pull/1764
[#1763]: https://github.com/benmosher/eslint-plugin-import/pull/1763
[#1751]: https://github.com/benmosher/eslint-plugin-import/pull/1751
[#1744]: https://github.com/benmosher/eslint-plugin-import/pull/1744
[#1736]: https://github.com/benmosher/eslint-plugin-import/pull/1736
[#1735]: https://github.com/benmosher/eslint-plugin-import/pull/1735
[#1726]: https://github.com/benmosher/eslint-plugin-import/pull/1726
[#1724]: https://github.com/benmosher/eslint-plugin-import/pull/1724
[#1722]: https://github.com/benmosher/eslint-plugin-import/issues/1722
[#1719]: https://github.com/benmosher/eslint-plugin-import/pull/1719
[#1702]: https://github.com/benmosher/eslint-plugin-import/issues/1702
[#1691]: https://github.com/benmosher/eslint-plugin-import/pull/1691
[#1690]: https://github.com/benmosher/eslint-plugin-import/pull/1690
[#1689]: https://github.com/benmosher/eslint-plugin-import/pull/1689
[#1681]: https://github.com/benmosher/eslint-plugin-import/pull/1681
[#1676]: https://github.com/benmosher/eslint-plugin-import/pull/1676
[#1666]: https://github.com/benmosher/eslint-plugin-import/pull/1666
[#1664]: https://github.com/benmosher/eslint-plugin-import/pull/1664
[#1658]: https://github.com/benmosher/eslint-plugin-import/pull/1658
Expand All @@ -682,6 +737,7 @@ for info on changes for earlier releases.
[#1560]: https://github.com/benmosher/eslint-plugin-import/pull/1560
[#1551]: https://github.com/benmosher/eslint-plugin-import/pull/1551
[#1542]: https://github.com/benmosher/eslint-plugin-import/pull/1542
[#1528]: https://github.com/benmosher/eslint-plugin-import/pull/1528
[#1526]: https://github.com/benmosher/eslint-plugin-import/pull/1526
[#1521]: https://github.com/benmosher/eslint-plugin-import/pull/1521
[#1519]: https://github.com/benmosher/eslint-plugin-import/pull/1519
Expand Down Expand Up @@ -747,6 +803,7 @@ for info on changes for earlier releases.
[#1157]: https://github.com/benmosher/eslint-plugin-import/pull/1157
[#1151]: https://github.com/benmosher/eslint-plugin-import/pull/1151
[#1142]: https://github.com/benmosher/eslint-plugin-import/pull/1142
[#1139]: https://github.com/benmosher/eslint-plugin-import/pull/1139
[#1137]: https://github.com/benmosher/eslint-plugin-import/pull/1137
[#1135]: https://github.com/benmosher/eslint-plugin-import/pull/1135
[#1128]: https://github.com/benmosher/eslint-plugin-import/pull/1128
Expand Down Expand Up @@ -921,7 +978,8 @@ for info on changes for earlier releases.
[#119]: https://github.com/benmosher/eslint-plugin-import/issues/119
[#89]: https://github.com/benmosher/eslint-plugin-import/issues/89

[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.2...HEAD
[Unreleased]: https://github.com/benmosher/eslint-plugin-import/compare/v2.21.0...HEAD
[2.21.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.2...v2.21.0
[2.20.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.1...v2.20.2
[2.20.0]: https://github.com/benmosher/eslint-plugin-import/compare/v2.20.0...v2.20.1
[2.19.1]: https://github.com/benmosher/eslint-plugin-import/compare/v2.19.1...v2.20.0
Expand Down Expand Up @@ -988,6 +1046,7 @@ for info on changes for earlier releases.
[0.12.1]: https://github.com/benmosher/eslint-plugin-import/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.11.0...v0.12.0
[0.11.0]: https://github.com/benmosher/eslint-plugin-import/compare/v0.10.1...v0.11.0

[@mathieudutour]: https://github.com/mathieudutour
[@gausie]: https://github.com/gausie
[@singles]: https://github.com/singles
Expand Down Expand Up @@ -1122,3 +1181,22 @@ for info on changes for earlier releases.
[@fisker]: https://github.com/fisker
[@richardxia]: https://github.com/richardxia
[@TheCrueltySage]: https://github.com/TheCrueltySage
[@ernestostifano]: https://github.com/ernestostifano
[@forivall]: https://github.com/forivall
[@xpl]: https://github.com/xpl
[@astorije]: https://github.com/astorije
[@Ephem]: https://github.com/Ephem
[@kmui2]: https://github.com/kmui2
[@arvigeus]: https://github.com/arvigeus
[@atos1990]: https://github.com/atos1990
[@Hypnosphi]: https://github.com/Hypnosphi
[@nickofthyme]: https://github.com/nickofthyme
[@manuth]: https://github.com/manuth
[@julien1619]: https://github.com/julien1619
[@darkartur]: https://github.com/darkartur
[@MikeyBeLike]: https://github.com/MikeyBeLike
[@barbogast]: https://github.com/barbogast
[@adamborowski]: https://github.com/adamborowski
[@adjerbetian]: https://github.com/adjerbetian
[@Maxim-Mazurok]: https://github.com/Maxim-Mazurok
[@malykhinvi]: https://github.com/malykhinvi
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, a
* Forbid a module from importing a module with a dependency path back to itself ([`no-cycle`])
* Prevent unnecessary path segments in import and require statements ([`no-useless-path-segments`])
* Forbid importing modules from parent directories ([`no-relative-parent-imports`])
* Forbid modules without any export, and exports not imported by any modules. ([`no-unused-modules`])

[`no-unresolved`]: ./docs/rules/no-unresolved.md
[`named`]: ./docs/rules/named.md
Expand All @@ -42,7 +41,6 @@ This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, a
[`no-cycle`]: ./docs/rules/no-cycle.md
[`no-useless-path-segments`]: ./docs/rules/no-useless-path-segments.md
[`no-relative-parent-imports`]: ./docs/rules/no-relative-parent-imports.md
[`no-unused-modules`]: ./docs/rules/no-unused-modules.md

### Helpful warnings

Expand Down
135 changes: 106 additions & 29 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
configuration:
- Native
- WSL

# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "12"
- nodejs_version: "10"
- nodejs_version: "8"
- nodejs_version: "14"
- nodejs_version: "12"
- nodejs_version: "10"
- nodejs_version: "8"
# - nodejs_version: "6"
# - nodejs_version: "4"

image: Visual Studio 2019
matrix:
fast_finish: false
exclude:
- configuration: WSL
nodejs_version: "8"

# allow_failures:
# - nodejs_version: "4" # for eslint 5
Expand All @@ -17,45 +26,113 @@ matrix:
# - x86
# - x64

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version

# install modules
# Initialization scripts. (runs before repo cloning)
init:
# Declare version-numbers of packages to install
- ps: >-
if ($env:nodejs_version -eq "4") {
npm install -g npm@3;
$env:NPM_VERSION="3"
}
if ($env:nodejs_version -in @("8", "10", "12")) {
npm install -g npm@6.10.3;
$env:NPM_VERSION="6.14.5"
}
- ps: >-
if ([int]$env:nodejs_version -le 8) {
$env:ESLINT_VERSION="6"
}
- npm install
- ps: $env:WINDOWS_NYC_VERSION = "15.0.1"

# Add `ci`-command to `PATH` for running commands either using cmd or wsl depending on the configuration
- ps: $env:PATH += ";$(Join-Path $(pwd) "scripts")"

# Install scripts. (runs after repo cloning)
before_build:
# Install propert `npm`-version
- IF DEFINED NPM_VERSION ci sudo npm install -g npm@%NPM_VERSION%

# Install dependencies
- ci npm install

# fix symlinks
- cmd: git config core.symlinks true
- cmd: git reset --hard
- git config core.symlinks true
- git reset --hard
- ci git reset --hard

# Install dependencies of resolvers
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_))";
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm install & popd )

# todo: learn how to do this for all .\resolvers\* on Windows
- cd .\resolvers\webpack && npm install && cd ..\..
- cd .\resolvers\node && npm install && cd ..\..
# Install proper `eslint`-version
- IF DEFINED ESLINT_VERSION ci npm install --no-save eslint@%ESLINT_VERSION%

# Post-install test scripts.
test_script:
# Build scripts (project isn't actually built)
build_script:
- ps: "# This Project isn't actually built"

# Test scripts
test_script:
# Output useful info for debugging.
- node --version
- npm --version
- ci node --version
- ci npm --version

# core tests
- npm test
# Run core tests
- ci npm run pretest
- ci npm run tests-only

# resolver tests
- cd .\resolvers\webpack && npm test && cd ..\..
- cd .\resolvers\node && npm test && cd ..\..
# Run resolver tests
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
$resolvers += "$(Resolve-Path $(Join-Path $resolverDir $_))";
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm test & popd )

on_success:
- npm run coveralls
- ci npm run coveralls

# Configuration-specific steps
for:
- matrix:
except:
- configuration: WSL
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
before_test:
# Upgrade nyc
- ci npm i --no-save nyc@%WINDOWS_NYC_VERSION%
- ps: >-
$resolverDir = "./resolvers";
$resolvers = @();
Get-ChildItem -Directory $resolverDir |
ForEach {
Push-Location $(Resolve-Path $(Join-Path $resolverDir $_));
ci npm ls nyc > $null;
if ($?) {
$resolvers += "$(pwd)";
}
Pop-Location;
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- IF DEFINED RESOLVERS FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm install --no-save nyc@%WINDOWS_NYC_VERSION% & popd )
- matrix:
only:
- configuration: WSL
# Install scripts. (runs after repo cloning)
install:
# Get a specific version of Node.js
- ps: $env:WSLENV += ":nodejs_version"
- ps: wsl curl -sL 'https://deb.nodesource.com/setup_${nodejs_version}.x' `| sudo APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 -E bash -
- wsl sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs

# Don't actually build.
build: off
build: on