I am getting some parsing errors after introducing ESLint into an existing Typescript codebase.
I have fixed most of the lint errors but babel-eslint
as a parser throws quite a few errors like this:
23:32 error Parsing error: Unexpected token, expected ","
21 | return state.set(
22 | 'callsInProgress',
> 23 | (state.callsInProgress as any).filter(i => i !== action.payload)
| ^
24 | );
25 | }
26 | case actions.API_RESET: {
I assume this is because babel
does not understand the typecasting as any
.
How do i get this through the parser?
My babel config is as follows:
module.exports = {
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-transform-runtime', '@babel/plugin-transform-typescript']
};