Skip to content

Commit

Permalink
Merge pull request #4 from ExodusMovement/sparten11740/feat/sync-upst…
Browse files Browse the repository at this point in the history
…ream-changes

feat: sync upstream changes
  • Loading branch information
sparten11740 authored Nov 21, 2024
2 parents e46e262 + 4127681 commit 4ddc447
Show file tree
Hide file tree
Showing 125 changed files with 2,392 additions and 1,066 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/node-4+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- macos-latest
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 9
- 8
- 7
- 6
Expand Down Expand Up @@ -63,34 +64,58 @@ jobs:
env:
TS_PARSER: 2
exclude:
- node-version: 16
eslint: 9
- node-version: 15
eslint: 9
- node-version: 15
eslint: 8
- node-version: 14
eslint: 9
- node-version: 13
eslint: 9
- node-version: 13
eslint: 8
- node-version: 12
eslint: 9
- node-version: 11
eslint: 9
- node-version: 11
eslint: 8
- node-version: 10
eslint: 9
- node-version: 10
eslint: 8
- node-version: 9
eslint: 9
- node-version: 9
eslint: 8
- node-version: 9
eslint: 7
- node-version: 8
eslint: 9
- node-version: 8
eslint: 8
- node-version: 8
eslint: 7
- node-version: 7
eslint: 9
- node-version: 7
eslint: 8
- node-version: 7
eslint: 7
- node-version: 7
eslint: 6
- node-version: 6
eslint: 9
- node-version: 6
eslint: 8
- node-version: 6
eslint: 7
- node-version: 6
eslint: 6
- node-version: 5
eslint: 9
- node-version: 5
eslint: 8
- node-version: 5
Expand All @@ -99,6 +124,8 @@ jobs:
eslint: 6
- node-version: 5
eslint: 5
- node-version: 4
eslint: 9
- node-version: 4
eslint: 8
- node-version: 4
Expand Down
3 changes: 2 additions & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"resolvers/*/test",
"scripts",
"memo-parser",
"lib"
"lib",
"examples"
]
}
71 changes: 55 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange

## [Unreleased]

## [2.31.0] - 2024-10-03

### Added
- support eslint v9 ([#2996], thanks [@G-Rath] [@michaelfaith])
- [`order`]: allow validating named imports ([#3043], thanks [@manuth])
- [`extensions`]: add the `checkTypeImports` option ([#2817], thanks [@phryneas])

### Fixed
- `ExportMap` / flat config: include `languageOptions` in context ([#3052], thanks [@michaelfaith])
- [`no-named-as-default`]: Allow using an identifier if the export is both a named and a default export ([#3032], thanks [@akwodkiewicz])
- [`export`]: False positive for exported overloaded functions in TS ([#3065], thanks [@liuxingbaoyu])
- `exportMap`: export map cache is tainted by unreliable parse results ([#3062], thanks [@michaelfaith])
- `exportMap`: improve cacheKey when using flat config ([#3072], thanks [@michaelfaith])
- adjust "is source type module" checks for flat config ([#2996], thanks [@G-Rath])

### Changed
- [Docs] [`no-relative-packages`]: fix typo ([#3066], thanks [@joshuaobrien])
- [Performance] [`no-cycle`]: dont scc for each linted file ([#3068], thanks [@soryy708])
- [Docs] [`no-cycle`]: add `disableScc` to docs ([#3070], thanks [@soryy708])
- [Tests] use re-exported `RuleTester` ([#3071], thanks [@G-Rath])
- [Docs] [`no-restricted-paths`]: fix grammar ([#3073], thanks [@unbeauvoyage])
- [Tests] [`no-default-export`], [`no-named-export`]: add test case (thanks [@G-Rath])

## [2.30.0] - 2024-09-02

### Added
- [`dynamic-import-chunkname`]: add `allowEmpty` option to allow empty leading comments ([#2942], thanks [@JiangWeixian])
- [`dynamic-import-chunkname`]: Allow empty chunk name when webpackMode: 'eager' is set; add suggestions to remove name in eager mode ([#3004], thanks [@amsardesai])
Expand All @@ -20,11 +45,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [`order`]: do not compare first path segment for relative paths ([#2682]) ([#2885], thanks [@mihkeleidast])

### Changed
- [Docs] `no-extraneous-dependencies`: Make glob pattern description more explicit ([#2944], thanks [@mulztob])
- [Docs] [`no-extraneous-dependencies`]: Make glob pattern description more explicit ([#2944], thanks [@mulztob])
- [`no-unused-modules`]: add console message to help debug [#2866]
- [Refactor] `ExportMap`: make procedures static instead of monkeypatching exportmap ([#2982], thanks [@soryy708])
- [Refactor] `ExportMap`: separate ExportMap instance from its builder logic ([#2985], thanks [@soryy708])
- [Docs] `order`: Add a quick note on how unbound imports and --fix ([#2640], thanks [@minervabot])
- [Docs] [`order`]: Add a quick note on how unbound imports and --fix ([#2640], thanks [@minervabot])
- [Tests] appveyor -> GHA (run tests on Windows in both pwsh and WSL + Ubuntu) ([#2987], thanks [@joeyguerra])
- [actions] migrate OSX tests to GHA ([ljharb#37], thanks [@aks-])
- [Refactor] `exportMapBuilder`: avoid hoisting ([#2989], thanks [@soryy708])
Expand Down Expand Up @@ -60,7 +85,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [`no-duplicates`]: remove duplicate identifiers in duplicate imports ([#2577], thanks [@joe-matsec])
- [`consistent-type-specifier-style`]: fix accidental removal of comma in certain cases ([#2754], thanks [@bradzacher])
- [Perf] `ExportMap`: Improve `ExportMap.for` performance on larger codebases ([#2756], thanks [@leipert])
- [`no-extraneous-dependencies`]/TypeScript: do not error when importing inline type from dev dependencies ([#1820], thanks [@andyogo])
- [`no-extraneous-dependencies`]/TypeScript: do not error when importing inline type from dev dependencies ([#2735], thanks [@andyogo])
- [`newline-after-import`]/TypeScript: do not error when re-exporting a namespaced import ([#2832], thanks [@laurens-dg])
- [`order`]: partial fix for [#2687] (thanks [@ljharb])
- [`no-duplicates`]: Detect across type and regular imports ([#2835], thanks [@benkrejci])
Expand Down Expand Up @@ -316,7 +341,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [`no-webpack-loader-syntax`]/TypeScript: avoid crash on missing name ([#1947], thanks [@leonardodino])
- [`no-extraneous-dependencies`]: Add package.json cache ([#1948], thanks [@fa93hws])
- [`prefer-default-export`]: handle empty array destructuring ([#1965], thanks [@ljharb])
- [`no-unused-modules`]: make type imports mark a module as used (fixes #1924) ([#1974], thanks [@cherryblossom000])
- [`no-unused-modules`]: make type imports mark a module as used (fixes [#1924]) ([#1974], thanks [@cherryblossom000])
- [`no-cycle`]: fix perf regression ([#1944], thanks [@Blasz])
- [`first`]: fix handling of `import = require` ([#1963], thanks [@MatthiasKunnen])
- [`no-cycle`]/[`extensions`]: fix isExternalModule usage ([#1696], thanks [@paztis])
Expand Down Expand Up @@ -344,7 +369,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [`dynamic-import-chunkname`]: allow single quotes to match Webpack support ([#1848], thanks [@straub])

### Changed
- [`export`]: add tests for a name collision with `export * from` ([#1704], thanks @tomprats)
- [`export`]: add tests for a name collision with `export * from` ([#1704], thanks [@tomprats])

## [2.22.0] - 2020-06-26

Expand Down Expand Up @@ -1127,13 +1152,25 @@ for info on changes for earlier releases.

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

[#3073]: https://github.com/import-js/eslint-plugin-import/pull/3073
[#3072]: https://github.com/import-js/eslint-plugin-import/pull/3072
[#3071]: https://github.com/import-js/eslint-plugin-import/pull/3071
[#3070]: https://github.com/import-js/eslint-plugin-import/pull/3070
[#3068]: https://github.com/import-js/eslint-plugin-import/pull/3068
[#3066]: https://github.com/import-js/eslint-plugin-import/pull/3066
[#3065]: https://github.com/import-js/eslint-plugin-import/pull/3065
[#3062]: https://github.com/import-js/eslint-plugin-import/pull/3062
[#3052]: https://github.com/import-js/eslint-plugin-import/pull/3052
[#3043]: https://github.com/import-js/eslint-plugin-import/pull/3043
[#3036]: https://github.com/import-js/eslint-plugin-import/pull/3036
[#3033]: https://github.com/import-js/eslint-plugin-import/pull/3033
[#3032]: https://github.com/import-js/eslint-plugin-import/pull/3032
[#3018]: https://github.com/import-js/eslint-plugin-import/pull/3018
[#3012]: https://github.com/import-js/eslint-plugin-import/pull/3012
[#3011]: https://github.com/import-js/eslint-plugin-import/pull/3011
[#3004]: https://github.com/import-js/eslint-plugin-import/pull/3004
[#2998]: https://github.com/import-js/eslint-plugin-import/pull/2998
[#2996]: https://github.com/import-js/eslint-plugin-import/pull/2996
[#2993]: https://github.com/import-js/eslint-plugin-import/pull/2993
[#2991]: https://github.com/import-js/eslint-plugin-import/pull/2991
[#2989]: https://github.com/import-js/eslint-plugin-import/pull/2989
Expand All @@ -1153,6 +1190,7 @@ for info on changes for earlier releases.
[#2842]: https://github.com/import-js/eslint-plugin-import/pull/2842
[#2835]: https://github.com/import-js/eslint-plugin-import/pull/2835
[#2832]: https://github.com/import-js/eslint-plugin-import/pull/2832
[#2817]: https://github.com/import-js/eslint-plugin-import/pull/2817
[#2778]: https://github.com/import-js/eslint-plugin-import/pull/2778
[#2756]: https://github.com/import-js/eslint-plugin-import/pull/2756
[#2754]: https://github.com/import-js/eslint-plugin-import/pull/2754
Expand Down Expand Up @@ -1467,10 +1505,7 @@ for info on changes for earlier releases.
[#297]: https://github.com/import-js/eslint-plugin-import/pull/297
[#296]: https://github.com/import-js/eslint-plugin-import/pull/296
[#290]: https://github.com/import-js/eslint-plugin-import/pull/290
[#289]: https://github.com/import-js/eslint-plugin-import/pull/289
[#288]: https://github.com/import-js/eslint-plugin-import/pull/288
[#287]: https://github.com/import-js/eslint-plugin-import/pull/287
[#278]: https://github.com/import-js/eslint-plugin-import/pull/278
[#261]: https://github.com/import-js/eslint-plugin-import/pull/261
[#256]: https://github.com/import-js/eslint-plugin-import/pull/256
[#254]: https://github.com/import-js/eslint-plugin-import/pull/254
Expand All @@ -1482,7 +1517,6 @@ for info on changes for earlier releases.
[#239]: https://github.com/import-js/eslint-plugin-import/pull/239
[#228]: https://github.com/import-js/eslint-plugin-import/pull/228
[#211]: https://github.com/import-js/eslint-plugin-import/pull/211
[#164]: https://github.com/import-js/eslint-plugin-import/pull/164
[#157]: https://github.com/import-js/eslint-plugin-import/pull/157

[ljharb#37]: https://github.com/ljharb/eslint-plugin-import/pull/37
Expand Down Expand Up @@ -1595,7 +1629,6 @@ for info on changes for earlier releases.
[#313]: https://github.com/import-js/eslint-plugin-import/issues/313
[#311]: https://github.com/import-js/eslint-plugin-import/issues/311
[#306]: https://github.com/import-js/eslint-plugin-import/issues/306
[#286]: https://github.com/import-js/eslint-plugin-import/issues/286
[#283]: https://github.com/import-js/eslint-plugin-import/issues/283
[#281]: https://github.com/import-js/eslint-plugin-import/issues/281
[#275]: https://github.com/import-js/eslint-plugin-import/issues/275
Expand All @@ -1615,7 +1648,9 @@ for info on changes for earlier releases.
[#119]: https://github.com/import-js/eslint-plugin-import/issues/119
[#89]: https://github.com/import-js/eslint-plugin-import/issues/89

[Unreleased]: https://github.com/import-js/eslint-plugin-import/compare/v2.29.1...HEAD
[Unreleased]: https://github.com/import-js/eslint-plugin-import/compare/v2.31.0...HEAD
[2.31.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.30.0...v2.31.0
[2.30.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.29.1...v2.30.0
[2.29.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1
[2.29.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.28.1...v2.29.0
[2.28.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.28.0...v2.28.1
Expand Down Expand Up @@ -1644,10 +1679,9 @@ for info on changes for earlier releases.
[2.22.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.1...v2.22.0
[2.21.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.1...v2.21.2
[2.21.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.21.0...v2.21.1
[2.21.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.2...v2.21.0
[2.20.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.1...v2.20.2
[2.20.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.0...v2.20.1
[2.19.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.19.1...v2.20.0
[2.21.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.1...v2.21.0
[2.20.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.20.0...v2.20.1
[2.20.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.19.1...v2.20.0
[2.19.1]: https://github.com/import-js/eslint-plugin-import/compare/v2.19.0...v2.19.1
[2.19.0]: https://github.com/import-js/eslint-plugin-import/compare/v2.18.2...v2.19.0
[2.18.2]: https://github.com/import-js/eslint-plugin-import/compare/v2.18.1...v2.18.2
Expand Down Expand Up @@ -1721,6 +1755,7 @@ for info on changes for earlier releases.
[@AdriAt360]: https://github.com/AdriAt360
[@ai]: https://github.com/ai
[@aks-]: https://github.com/aks-
[@akwodkiewicz]: https://github.com/akwodkiewicz
[@aladdin-add]: https://github.com/aladdin-add
[@alex-page]: https://github.com/alex-page
[@alexgorbatchev]: https://github.com/alexgorbatchev
Expand Down Expand Up @@ -1796,6 +1831,7 @@ for info on changes for earlier releases.
[@fsmaia]: https://github.com/fsmaia
[@fson]: https://github.com/fson
[@futpib]: https://github.com/futpib
[@G-Rath]: https://github.com/G-Rath
[@gajus]: https://github.com/gajus
[@gausie]: https://github.com/gausie
[@gavriguy]: https://github.com/gavriguy
Expand Down Expand Up @@ -1832,6 +1868,7 @@ for info on changes for earlier releases.
[@johnthagen]: https://github.com/johnthagen
[@jonboiser]: https://github.com/jonboiser
[@josh]: https://github.com/josh
[@joshuaobrien]: https://github.com/joshuaobrien
[@JounQin]: https://github.com/JounQin
[@jquense]: https://github.com/jquense
[@jseminck]: https://github.com/jseminck
Expand Down Expand Up @@ -1862,6 +1899,7 @@ for info on changes for earlier releases.
[@lilling]: https://github.com/lilling
[@ljharb]: https://github.com/ljharb
[@ljqx]: https://github.com/ljqx
[@liuxingbaoyu]: https://github.com/liuxingbaoyu
[@lo1tuma]: https://github.com/lo1tuma
[@loganfsmyth]: https://github.com/loganfsmyth
[@luczsoma]: https://github.com/luczsoma
Expand Down Expand Up @@ -1910,6 +1948,7 @@ for info on changes for earlier releases.
[@pcorpet]: https://github.com/pcorpet
[@Pearce-Ropion]: https://github.com/Pearce-Ropion
[@Pessimistress]: https://github.com/Pessimistress
[@phryneas]: https://github.com/phryneas
[@pmcelhaney]: https://github.com/pmcelhaney
[@preco21]: https://github.com/preco21
[@pri1311]: https://github.com/pri1311
Expand Down Expand Up @@ -1959,7 +1998,6 @@ for info on changes for earlier releases.
[@sveyret]: https://github.com/sveyret
[@swernerx]: https://github.com/swernerx
[@syymza]: https://github.com/syymza
[@taion]: https://github.com/taion
[@TakeScoop]: https://github.com/TakeScoop
[@tapayne88]: https://github.com/tapayne88
[@Taranys]: https://github.com/Taranys
Expand All @@ -1972,6 +2010,7 @@ for info on changes for earlier releases.
[@tomprats]: https://github.com/tomprats
[@TrevorBurnham]: https://github.com/TrevorBurnham
[@ttmarek]: https://github.com/ttmarek
[@unbeauvoyage]: https://github.com/unbeauvoyage
[@vikr01]: https://github.com/vikr01
[@wenfangdu]: https://github.com/wenfangdu
[@wKich]: https://github.com/wKich
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dynamic-import-chunkname.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can also configure the regex format you'd like to accept for the webpackChun

```javascript
{
"dynamic-import-chunkname": [2, {
"import/dynamic-import-chunkname": [2, {
importFunctions: ["dynamicImport"],
webpackChunknameFormat: "[a-zA-Z0-57-9-/_]+",
allowEmpty: false
Expand Down
18 changes: 18 additions & 0 deletions docs/rules/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ For example, `["error", "never", { "svg": "always" }]` would require that all ex
In that case, if you still want to specify extensions, you can do so inside the **pattern** property.
Default value of `ignorePackages` is `false`.

By default, `import type` and `export type` style imports/exports are ignored. If you want to check them as well, you can set the `checkTypeImports` option to `true`.

### Exception

When disallowing the use of certain extensions this rule makes an exception and allows the use of extension when the file would not be resolvable without extension.
Expand Down Expand Up @@ -104,6 +106,14 @@ import express from 'express/index';
import * as path from 'path';
```

The following patterns are considered problems when the configuration is set to "never" and the option "checkTypeImports" is set to `true`:

```js
import type { Foo } from './foo.ts';

export type { Foo } from './foo.ts';
```

The following patterns are considered problems when configuration set to "always":

```js
Expand Down Expand Up @@ -167,6 +177,14 @@ import express from 'express';
import foo from '@/foo';
```

The following patterns are considered problems when the configuration is set to "always" and the option "checkTypeImports" is set to `true`:

```js
import type { Foo } from './foo';

export type { Foo } from './foo';
```

## When Not To Use It

If you are not concerned about a consistent usage of file extension.
Expand Down
8 changes: 8 additions & 0 deletions docs/rules/no-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export function getBar() { return import('./bar'); }

> Cyclic dependency are **always** a dangerous anti-pattern as discussed extensively in [#2265](https://github.com/import-js/eslint-plugin-import/issues/2265). Please be extra careful about using this option.
#### `disableScc`

This option disables a pre-processing step that calculates [Strongly Connected Components](https://en.wikipedia.org/wiki/Strongly_connected_component), which are used for avoiding unnecessary work checking files in different SCCs for cycles.

However, under some configurations, this pre-processing may be more expensive than the time it saves.

When this option is `true`, we don't calculate any SCC graph, and check all files for cycles (leading to higher time-complexity). Default is `false`.

## When Not To Use It

This rule is comparatively computationally expensive. If you are pressed for lint
Expand Down
3 changes: 1 addition & 2 deletions docs/rules/no-relative-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

Use this rule to prevent importing packages through relative paths.

It's useful in Yarn/Lerna workspaces, were it's possible to import a sibling
package using `../package` relative path, while direct `package` is the correct one.
It's useful in Yarn/Lerna workspaces, where it's possible to import a sibling package using `../package` relative path, while direct `package` is the correct one.

## Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-restricted-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Some projects contain files which are not always meant to be executed in the same environment.
For example consider a web application that contains specific code for the server and some specific code for the browser/client. In this case you don’t want to import server-only files in your client code.

In order to prevent such scenarios this rule allows you to define restricted zones where you can forbid files from imported if they match a specific path.
In order to prevent such scenarios this rule allows you to define restricted zones where you can forbid files from being imported if they match a specific path.

## Rule Details

Expand Down
Loading

0 comments on commit 4ddc447

Please sign in to comment.