Skip to content

Conversation

@anthonyryan1
Copy link

It seems during one of the recent releases, this stopped working in npm projects that didn't include @typescript-eslint/eslint-plugin

Example stack from a JS (non TypeScript) eslint repo utilizing this plugin:

Oops! Something went wrong! :(

ESLint: 9.24.0

Error: Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- /home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/config/typescript.js
- /home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/lib/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (/home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/config/typescript.js:6:26)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32)

The easiest fix is to define this as a dependency, rather than a devDependency so that npm ensures it's availabe.

It seems during one of the recent releases, this stopped working in npm
projects that didn't include @typescript-eslint/eslint-plugin

Example stack from a JS (non TypeScript) eslint repo utilizing this plugin:

```
Oops! Something went wrong! :(

ESLint: 9.24.0

Error: Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- /home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/config/typescript.js
- /home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/lib/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (/home/ar/Projects/website/node_modules/@microsoft/eslint-plugin-sdl/config/typescript.js:6:26)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32)
```

The easiest fix is to define this as a dependency, rather than a devDependency so that npm ensures it's availabe.
@anthonyryan1 anthonyryan1 requested a review from a team as a code owner April 16, 2025 02:47
@anthonyryan1
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant