I'm doing migrate of tslint on eslint and get many parsing errors. I used a mixed config for js and ts files. If it is a problem not in my config I create a new issue with another parsing errors
6:7 error Parsing error: Unexpected token, expected ":"
5 | export type SyncJsonFile = ({
> 6 | path,
| ^
7 | newContent,
8 | }: {
9 | path: string;
Config
export const typescriptConfig = {
extends: ['plugin:@typescript-eslint/eslint-recommended'],
overrides: [
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:import/typescript',
plugins: ['@typescript-eslint'],
files: ['*.ts', '*.tsx'],
rules: {},
Versions
package
version
Looking at the link you sent, that is because it's switching to babel parser, which doesn't understand typescript syntax by default.
If you manage to find a repro case, will gladly reopen this issue.
This is not an issue with our parser. I cannot reproduce this with our parser
This is the base babel-eslint parser not working correctly without any config.
ESLint is not applying different parsers to different files, hence babel-eslint is throwing an error.
Why are you mixing and matching parser? You should just be using our parser for everything.
Why are you mixing and matching parser? You should just be using our parser for everything.
Thanks for your answer. I will test with parsers @typescript-eslint/parser
for js files. But the main case used a babel-eslint
it custom syntactic. In my project use mixed files: Babel(js) and TS. Before that, I used tslint
for ts and eslint
for js.
I have spent more time to debug eslint combine config and resolved the problem of move js config with separate file
https://github.com/Tom910/eslint-extends-error
Thanks for spend time