Open remisture opened 11 months ago
Not an XO issue:
Import attributes are not yet finalized so ESLint does not support them yet.
It turns out this is supported by TypeScript, and XO does ship with tsc
and TS ESlint plugins. So what you can do is just setting this in your package.json so that XO/ESLint will use TypeScript's parser even on JS files:
"xo": {
"parser": "@typescript-eslint/parser"
},
Should this be documented? Or maybe become XO's default? The problem might be performance though. cc @sindresorhus
Not sure we could do it by default (for both JS and TS files) as it could have slightly different semantics than JS. I think the best would be to simply pass the TS parser into the config when the TS config uses flat config.
Seems like xo struggle to parse this. What can I do?
"Parsing error: Unexpected token , "