import-js / import-js/eslint-plugin-import

`no-commonjs` does not appear to work for TypeScript

Open
#1,709 3 comments 0 reactions 0 assignees View on GitHub
help wanted typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I have the following rule enabled:
```js
// disallow require()
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
'import/no-commonjs': 'error',
```

However, in my TypeScript source file, the following line that I expected to error does not:
```ts
import Boom = require('boom')
```

Should it?

Contributor guide

Open the contributing guide

Research direction

Start with the no-commonjs rule documentation linked in the issue and reproduce the reported TypeScript example, `import Boom = require('boom')`. Trace how the rule handles TypeScript syntax and identify the relevant rule tests or parser behavior. Done means the expected handling is established and covered by an appropriate regression test or documentation update.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.