Closed
Description
Environment
Node version: 20.10.0
npm version: 10.2.3
ESLint version: 8.55.0
eslint-plugin-n version: 16.3.1
Operating System: Linux, ubuntu 22.0
What rule do you want to report?
hashbang
Link to Minimal Reproducible Example
What did you expect to happen?
both shebang
and n/hashbang
suppose that the only valid bang syntax is #!/usr/bin/env node
, but we may need to use another valid one such as #!/usr/bin/env ts-node
.
bug:
reporting #!/usr/bin/env ts-node
as invalid shebang is a mistake
suggestions:
- add an option to this rule to specified additional valid shebang
['ts-node']
- auto detect shebang based on the current file extension, for example if it is a
.ts
, it ists-node
by default - add an option for extension mapping, to override the default values,
{ js: 'node', ts: 'ts-node' }
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response