Gathering detailed insights and metrics for eslint-import-resolver-typescript
Gathering detailed insights and metrics for eslint-import-resolver-typescript
Gathering detailed insights and metrics for eslint-import-resolver-typescript
Gathering detailed insights and metrics for eslint-import-resolver-typescript
eslint-import-resolver-typescript-bun
[![GitHub Actions](https://github.com/opsbr/eslint-import-resolver-typescript-bun/workflows/release/badge.svg)](https://github.com/import-js/eslint-import-resolver-typescript/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/eslint-import-res
@mkobayashime/eslint-config-typescript
```bash yarn add -D @mkobayashime/eslint-config-typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript ```
eslint-import-resolver-node
Node default behavior import resolution plugin for eslint-plugin-import.
eslint-import-resolver-alias
a simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias.
This plugin adds `TypeScript` support to `eslint-plugin-import`
npm install eslint-import-resolver-typescript
55.3
Supply Chain
89.6
Quality
78.5
Maintenance
100
Vulnerability
97.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
731 Stars
243 Commits
62 Forks
4 Watching
3 Branches
38 Contributors
Updated on 21 Nov 2024
Minified
Minified + Gzipped
TypeScript (70.88%)
JavaScript (29.12%)
Cumulative downloads
Total Downloads
Last day
-6.7%
1,871,255
Compared to previous day
Last week
2.9%
10,080,663
Compared to previous week
Last month
11.9%
42,364,256
Compared to previous month
Last year
42.8%
415,478,400
Compared to previous year
8
3
23
This plugin adds TypeScript
support to eslint-plugin-import
(Or maybe you want to try eslint-plugin-i
for faster speed)
This means you can:
import
/require
files with extension .cts
/.mts
/.ts
/.tsx
/.d.cts
/.d.mts
/.d.ts
paths
defined in tsconfig.json
@types/*
definitions over plain .js
/.jsx
imports/exports
fields support in package.json
enhanced-resolve
After version 2.0.0, .d.ts
will take higher priority then normal .js
/.jsx
files on resolving node_modules
packages in favor of @types/*
definitions or its own definition.
If you're facing some problems on rules import/default
or import/named
from eslint-plugin-import
, do not post any issue here, because they are just working exactly as expected on our sides, take import-js/eslint-plugin-import#1525 as reference or post a new issue to eslint-plugin-import
instead.
1# npm 2npm i -D eslint-plugin-import eslint-import-resolver-typescript 3 4# pnpm 5pnpm i -D eslint-plugin-import eslint-import-resolver-typescript 6 7# yarn 8yarn add -D eslint-plugin-import eslint-import-resolver-typescript
Important when using eslint-plugin-i
and npm
: Use npm i -D eslint-plugin-import@eslint-plugin-i@latest eslint-import-resolver-typescript
, or you will end up with both eslint-plugin-import
and eslint-plugin-i
in your node_modules.
Add the following to your .eslintrc
config:
1{ 2 "plugins": ["import"], 3 "rules": { 4 // turn on errors for missing imports 5 "import/no-unresolved": "error" 6 }, 7 "settings": { 8 "import/parsers": { 9 "@typescript-eslint/parser": [".ts", ".tsx"] 10 }, 11 "import/resolver": { 12 "typescript": { 13 "alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` 14 15 // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default 16 17 // use <root>/path/to/folder/tsconfig.json 18 "project": "path/to/folder", 19 20 // Multiple tsconfigs (Useful for monorepos) 21 22 // use a glob pattern 23 "project": "packages/*/tsconfig.json", 24 25 // use an array 26 "project": [ 27 "packages/module-a/tsconfig.json", 28 "packages/module-b/tsconfig.json" 29 ], 30 31 // use an array of glob patterns 32 "project": [ 33 "packages/*/tsconfig.json", 34 "other-packages/*/tsconfig.json" 35 ] 36 } 37 } 38 } 39}
enhanced-resolve
conditionNames
Default:
1[ 2 "types", 3 "import", 4 5 // APF: https://angular.io/guide/angular-package-format 6 "esm2020", 7 "es2020", 8 "es2015", 9 10 "require", 11 "node", 12 "node-addons", 13 "browser", 14 "default" 15]
extensions
Default:
1[ 2 // `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used explicitly 3 ".ts", 4 ".tsx", 5 ".d.ts", 6 ".js", 7 ".jsx", 8 ".json", 9 ".node" 10]
extensionAlias
Default:
1{ 2 ".js": [ 3 ".ts", 4 // `.tsx` can also be compiled as `.js` 5 ".tsx", 6 ".d.ts", 7 ".js" 8 ], 9 ".jsx": [".tsx", ".d.ts", ".jsx"], 10 ".cjs": [".cts", ".d.cts", ".cjs"], 11 ".mjs": [".mts", ".d.mts", ".mjs"] 12}
mainFields
Default:
1[ 2 "types", 3 "typings", 4 5 // APF: https://angular.io/guide/angular-package-format 6 "fesm2020", 7 "fesm2015", 8 "esm2020", 9 "es2020", 10 11 "module", 12 "jsnext:main", 13 14 "main" 15]
You can pass through other options of enhanced-resolve
directly
You can reuse defaultConditionNames
, defaultExtensions
, defaultExtensionAlias
and defaultMainFields
by require/import
them directly
yarn test
passes without a failure.yarn lint
passes without conflicts.yarn type-coverage
.We have GitHub Actions which will run the above commands on your PRs.
If either fails, we won't be able to merge your PR until it's fixed.
1stG | RxTS | UnTS |
---|---|---|
1stG | RxTS | UnTS |
---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.
No vulnerabilities found.
Reason
8 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 4/28 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More