"import" is highlighted as a keyword in Node.js "import.meta.dirname" expression

Open Beginner friendly
#1,071 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
tooling

Research direction

Reproduce the issue in a .js file with import.meta.dirname, then use Developer: Inspect Editor Tokens and Scopes on import. Trace the TypeScript TextMate grammar rule producing keyword.control.import.js; done means this expression no longer assigns that keyword scope to import while regular imports remain correctly highlighted.

Written by the indexing model from the issue text.

Description

JavaScript and TypeScript Nightly version: 6.0.20260416

Code

import path from "naode:path";

import.meta.dirname;
Issue

In "textmate scopes" section the "keyword.control.import.js" token is shown.
But this "import" word is not a "keyword".

Steps to reproduce
  1. Open .js file
  2. Write import.meta.dirname
  3. Click "import" word
  4. Press "Ctrl+Shift+P" type and select "Developer: Inspect Editor Tokens and Scopes"
🖼️ Screenshot

Image

Dominant language
TypeScript
Stars
471
Forks
149
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/TypeScript-TmLanguage

All issues in microsoft/TypeScript-TmLanguage

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.