Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

431
Views
Using @typescript-eslint/parser in browser

Problem

I'm trying to use @typescript-eslint/parser + eslint for linting code in an online editor. Right now I've got the eslint import to work using the officially supported built product for browser. But there doesn't seem to be an official way to use @typescript-eslint/parser in the browser, while it's definitely possible and is used in their own demo site and astexplorer. Attempt to import it directly led to the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'dirname')
    at ../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js (index.js:4:46)
    at __require2 (chunk-IEEDF65T.js?v=2b1fa2fc:35:50)
    at ../node_modules/.pnpm/fast-glob@3.2.11/node_modules/fast-glob/out/utils/pattern.js (pattern.js:5:20)
    at __require2 (chunk-IEEDF65T.js?v=2b1fa2fc:35:50)
    at ../node_modules/.pnpm/fast-glob@3.2.11/node_modules/fast-glob/out/utils/index.js (index.js:12:17)
    at __require2 (chunk-IEEDF65T.js?v=2b1fa2fc:35:50)
    at ../node_modules/.pnpm/fast-glob@3.2.11/node_modules/fast-glob/out/managers/tasks.js (tasks.js:4:15)
    at __require2 (chunk-IEEDF65T.js?v=2b1fa2fc:35:50)
    at ../node_modules/.pnpm/fast-glob@3.2.11/node_modules/fast-glob/out/index.js (index.js:2:21)
    at __require2 (chunk-IEEDF65T.js?v=2b1fa2fc:35:50)

My Usage

// doesn't work
import * as parser from '@typescript-eslint/parser'

const linter = new eslint.Linter()
linter.defineParser('@typescript-eslint/parser', parser)

linter.verify('someTSCode', someConfig)

Relavent Dependencies

"vite": "^2.9.1",
"vue": "^3.2.33",
"eslint": "^8.13.0",
"@typescript-eslint/parser": "^5.22.0",
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!