Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typescript is a dependency but only included as a devDependency #770

Closed
Labels
package: typescript-estreeIssues related to @typescript-eslint/typescript-estreetriageWaiting for team members to take a look
@RebeccaStevens

Description

@RebeccaStevens

This issue is with regards to the package@typescript-eslint/typescript-estree.

The compiled version of parser.js contains this line:

constts=__importStar(require("typescript"));// leave this as * as ts so people using util package don't need syntheticDefaultImports

If TypeScript isn't present, the package cannot be used.

In my case, I have an eslint plugin that use this package under the hood. The plugin fails to load if TypeScript isn't present (i.e. the plugin is being used to lint a project that doesn't use TypeScript).

$ /path/to/project/node_modules/.bin/eslint.Error: Failed to load plugin'someplugin' declaredin'.eslintrc': Cannot find module'typescript'Require stack:- /path/to/project/node_modules/@typescript-eslint/typescript-estree/dist/parser.js- /path/to/project/node_modules/eslint-plugin-someplugin/lib/index.js- /path/to/project/node_modules/eslint/lib/cli-engine/config-array-factory.js- /path/to/project/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js- /path/to/project/node_modules/eslint/lib/cli-engine/cli-engine.js- /path/to/project/node_modules/eslint/lib/cli-engine/index.js- /path/to/project/node_modules/eslint/lib/cli.js- /path/to/project/node_modules/eslint/bin/eslint.jsReferenced from: /path/to/project/.eslintrc    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)    at Function.Module._load (internal/modules/cjs/loader.js:527:27)    at Module.require (internal/modules/cjs/loader.js:681:19)    at require (/path/to/project/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)    at Object.<anonymous> (/path/to/project/node_modules/@typescript-eslint/typescript-estree/dist/parser.js:17:25)    at Module._compile (/path/to/project/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)    at Module.load (internal/modules/cjs/loader.js:641:32)    at Function.Module._load (internal/modules/cjs/loader.js:556:12)    at Module.require (internal/modules/cjs/loader.js:681:19)error Command failed withexit code 2.info Visit https://yarnpkg.com/en/docs/cli/runfor documentation about this command.

I believe the solution to this issue would be to have @typescript-eslint/typescript-estree declare TypeScript as either a dependency or a peerDependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: typescript-estreeIssues related to @typescript-eslint/typescript-estreetriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp