Skip to content

Commit

Permalink
fix: compatible with true type parserOptions.project (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: JounQin <admin@1stg.me>
  • Loading branch information
chengzhuo5 and JounQin committed Dec 18, 2023
1 parent e1b204b commit db3acc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A fork of [`eslint-plugin-import`] using [`get-tsconfig`] to replace [`tsconfig-

It will rebase and try to release in order to sync with the upstream every day, see [.github/workflows/rebase-upstream.yml](.github/workflows/rebase-upstream.yml) for details.

And also you can take https://github.com/import-js/eslint-plugin-import/pull/2447 and https://github.com/import-js/eslint-plugin-import/pull/2504 to understand why this forked project exists.
And also you can take <https://github.com/import-js/eslint-plugin-import/pull/2447> and <https://github.com/import-js/eslint-plugin-import/pull/2504> to understand why this forked project exists.

Issues related to `get-tsconfig` should be posted here or [`get-tsconfig`] instead, and other issues should be posted to [`eslint-plugin-import`] instead.

Expand All @@ -14,11 +14,12 @@ Issues related to `get-tsconfig` should be posted here or [`get-tsconfig`] inste
## Installation

```bash
$ npm install -D eslint-plugin-import@npm:eslint-plugin-i@latest
npm install -D eslint-plugin-import@npm:eslint-plugin-i@latest
```

---

<!-- markdownlint-disable-next-line MD025 -->
# eslint-plugin-import

[![github actions][actions-image]][actions-url]
Expand Down Expand Up @@ -120,6 +121,7 @@ Available as part of the Tidelift Subscription.

The maintainers of `eslint-plugin-import` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-eslint-plugin-import?utm_source=npm-eslint-plugin-import&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

<!-- markdownlint-disable-next-line MD024 -->
## Installation

```sh
Expand Down
9 changes: 8 additions & 1 deletion src/ExportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ ExportMap.parse = function (path, content, context) {
if (project) {
const projects = Array.isArray(project) ? project : [project];
for (const project of projects) {
tsconfigResult = getTsconfig(pathResolve(tsconfigRootDir, project));
tsconfigResult = getTsconfig(project === true ? context.filename : pathResolve(tsconfigRootDir, project));
if (tsconfigResult) {
break;
}
Expand Down Expand Up @@ -800,6 +800,13 @@ function childContext(path, context) {
parserOptions,
parserPath,
path,
filename: typeof context.getPhysicalFilename === 'function'
? context.getPhysicalFilename()
: context.physicalFilename != null
? context.physicalFilename
: typeof context.getFilename === 'function'
? context.getFilename()
: context.filename,
};
}

Expand Down

0 comments on commit db3acc8

Please sign in to comment.