Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

430
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda