{"name":"eslint-import-resolver-next","version":"0.1.0","license":"MIT","_id":"eslint-import-resolver-next@0.1.0","maintainers":[{"name":"kuoruan","email":"kuoruan@gmail.com"}],"contributors":[{"url":"https://github.com/cyco130","name":"Fatih Aygün","email":"cyco130@gmail.com"},{"url":"https://github.com/kuoruan","name":"Xingwang Liao","email":"kuoruan@gmail.com"}],"homepage":"https://github.com/kuoruan/eslint-import-resolver-next#readme","bugs":{"url":"https://github.com/kuoruan/eslint-import-resolver-next/issues"},"dist":{"shasum":"be1fcd1dda8404f23b1e2431ddb9e3c81260c3f1","tarball":"http://registry-npm.ywwl.com/eslint-import-resolver-next/download/eslint-import-resolver-next-0.1.0.tgz","fileCount":5,"integrity":"sha512-s2dGdXvU9xMw92vdyQGnHoFsazqWBB5cbyRIZ2AmAZpM8V4fbJHDGkEH1eZ6LhOqzjUFrcsJjMR7hgU5CZXnEQ==","signatures":[{"sig":"MEUCIQC3Y+goIo2iVRWLXkdoekYVomp20DOXUOau45eMMl7kEQIgSPkRhww8lHIRn+HXjOlv+nDOcaI+Zh9lE1h1E8wmDwM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/eslint-import-resolver-next@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":8324,"size":3289,"noattachment":false,"key":"/eslint-import-resolver-next/-/eslint-import-resolver-next-0.1.0.tgz"},"main":"./index.js","engines":{"node":">=10"},"gitHead":"4d265484b236be0cae478db5a806da261b071fe7","scripts":{"lint":"eslint --ext .js .","test":"mocha","lint:fix":"eslint --ext .js --fix .","prepublishOnly":"npm run test"},"_npmUser":{"name":"kuoruan","email":"kuoruan@gmail.com"},"repository":{"url":"git+https://github.com/kuoruan/eslint-import-resolver-next.git","type":"git"},"_npmVersion":"10.7.0","description":"`package.json` `exports` field resolver for `eslint-plugin-import`","directories":{},"_nodeVersion":"18.20.3","dependencies":{"resolve.exports":"^2.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.4.1","mocha":"^8.4.0","eslint":"^8.57.0","prettier":"^3.3.1","@types/node":"^20.14.2","@babel/eslint-parser":"^7.24.7","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3"},"_npmOperationalInternal":{"tmp":"tmp/eslint-import-resolver-next_0.1.0_1717845159166_0.7859987450764194","host":"s3://npm-registry-packages"},"readme":"# eslint-import-resolver-next\n\n[![npm](https://img.shields.io/npm/v/eslint-import-resolver-next.svg)](https://www.npmjs.com/package/eslint-import-resolver-next)\n[![npm](https://img.shields.io/npm/dw/eslint-import-resolver-next.svg)](https://www.npmjs.com/package/eslint-import-resolver-next)\n[![npm](https://img.shields.io/npm/l/eslint-import-resolver-next.svg)](https://www.npmjs.com/package/eslint-import-resolver-next)\n\nThe next resolver plugin for [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import) or [`eslint-plugin-import-x`](https://www.npmjs.com/package/eslint-plugin-import-x) that resolves modules with [`unrs-resolver`](https://github.com/unrs/unrs-resolver).\n\n## Features\n\n- Resolves modules using the [`unrs-resolver`](https://github.com/unrs/unrs-resolver) package.\n- Support mono-repos and `pnpm-workspaces.yaml`.\n- Support paths alias defined in `tsconfig.compilerOptions.paths` or `jsconfig.compilerOptions.paths`.\n\n## Usage\n\n1. Install the package:\n\n```sh\nnpm install -D eslint-import-resolver-next\n```\n\n2. Add it as a resolver to your ESLint configuration.\n\nExample config:\n\n```js\nmodule.exports = {\n  // ... other configuration options\n  settings: {\n    \"import/resolver\": {\n      next: {\n        // Options for the resolver\n      },\n    },\n  },\n};\n```\n\nwith Mono-repo:\n\n```js\nmodule.exports = {\n  // ... other configuration options\n  settings: {\n    \"import/resolver\": {\n      next: {\n        packages: [\"packages/*\"],\n      },\n    },\n  },\n};\n```\n\npnpm-workspaces:\n\n```js\nmodule.exports = {\n  // ... other configuration options\n  settings: {\n    \"import/resolver\": {\n      next: {\n        packages: {\n          pnpmWorkspace: true,\n          includeRoot: true,\n        },\n      },\n    },\n  },\n};\n```\n\n3. For [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x/) `resolver-next`\n\n```js\nconst { createNextImportResolver } = require(\"eslint-import-resolver-next\");\n\nmodule.exports = {\n  // ... other configuration options\n  settings: {\n    \"import-x/resolver-next\": [createNextImportResolver({\n      // Options for the resolver\n    })],\n  },\n};\n```\n\n## Options\n\n- `roots` (Array<string>): The directories to search for modules. Default: `[process.cwd()]`.\n\n- `alias` (Record<string, string | string[]>): The paths alias. Default: `undefined`.\n  * The alias can be set as relative paths. relative paths are resolved from the package directory.\n\n- `tsconfig` (boolean | string | object): Weather to use the `tsconfig.json` file. Default: `true`.\n  * If `true`, the resolver will try to find the `tsconfig.json` file close to the source file.\n  * If a string, it's the name of the file to search for or the absolute path to the file.\n  * If an object, see `ConfigFileOptions`.\n\n- `jsconfig` (boolean | string | object): Weather to use the `jsconfig.json` file. Default: `true`.\n  * If `true`, the resolver will try to find the `jsconfig.json` file close to the source file.\n  * If a string, it's the name of the file to search for or the absolute path to the file.\n  * If an object, see `ConfigFileOptions`.\n\n- `packages` (string[] | PackageOptions): The patterns or options to search for packages. Default: `undefined`.\n  * If an array, the resolver will search for packages in the specified patterns.\n  * If an object, see `PackageOptions`.\n\n- `bun` (boolean): Weather to enable the `bun` support. Default: `true` if bun environment is detected.\n  * If `true`, the resolver will try to resolve bun built-in modules.\n\nAll other options are passed to the `unrs-resolver` package. See the [unrs-resolver documentation](https://github.com/unrs/unrs-resolver#options)\n\n### ConfigFileOptions\n\nThe `tsconfig` and `jsconfig` options can have the following properties:\n\n- `configFile` (string): The name of the file to search for or the absolute path to the file. Default: `tsconfig.json`.\n- `ignore` (string[]): The directories to ignore. Default: `[\"**/node_modules/**\"]`.\n- `references` ('auto' | string[]): Support for Typescript Project References. Default: `'auto'`.\n  * If `'auto'`, the resolver will try to find the `references` field in the `tsconfig.json` file.\n  * If an array, the resolver will use the specified references.\n\n### PackageOptions\n\nA folder with a `package.json` file is considered a package. The `PackageOptions` object can have the following properties:\n\n- `patterns` (string[]): The patterns to search for packages. Default: `[\".\"]`.\n- `ignore` (string[]): The directories to ignore. Default: `[\"**/node_modules/**\", \"**/bower_components/**\", \"**/test/**\", \"**/tests/**\"]`.\n- `includeRoot` (boolean): Weather to include the root directory. Default: `false`.\n- `pnpmWorkspace` (boolean | string): Weather to use the `pnpm-workspace.yaml` file to find packages. Default: `false`.\n  * If `true`, the resolver will try to find the `pnpm-workspace.yaml` file in the package directory.\n  * If a string, define the path to the `pnpm-workspace.yaml` file.\n","publish_time":1717845159381,"_cnpm_publish_time":1717845159381,"dist-tags":{"latest":"0.6.0"}}