DEV Community

Discussion on: How to (temporarily!) ignore errors during a TypeScript migration

Collapse
 
pengeszikra profile image
Peter Vivo

Hi! Are you know some tsc-silence solution which don't modify the code, just hide selected ts error from IDE (VSCode) ?

I using pipeline operator for js (react, webpack, babel, eslint) 2 years long, and now I add typescript to project, and everything is fine, even I can use pipeline operator in typescript just, mark as error (but everything compiled fine so two pre give same result):

import {FC} from 'react';
const jlog = data => JSON.stringify(data, null, 2);
const FooDebug:FC = () => {
 const foo = { name: 'foo', content: 42 }
 return (
  <section>
    <pre>{jlog(foo)}</pre>
    <pre>{foo |> jlog}</pre> 
  </section>
 );
}
Enter fullscreen mode Exit fullscreen mode
foo |> jlog
// The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.ts(2363)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
caleb15 profile image
Caleb Collins-Parks

Not that I know of, sorry.