Unused '@ts-expect-error' directive

See original GitHub issue

We get the following tsc errors.

node_modules/react-native-element-dropdown/src/useDeviceOrientation.ts:27:7 - error TS2578: Unused '@ts-expect-error' directive.

27       // @ts-expect-error - React Native >= 0.65
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/react-native-element-dropdown/src/useDeviceOrientation.ts:29:9 - error TS2578: Unused '@ts-expect-error' directive.

29         // @ts-expect-error - need update @types/react-native@0.65.x
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

https://github.com/hoaphantn7604/react-native-element-dropdown/blob/7949771f92088fea60495bd0dac7af55950ea49c/src/useDeviceOrientation.ts#L27-L35

Any ideas what is causing that?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
devpascoecommented, May 31, 2022

Hey there, also facing this issue. RN 0.66.3 typesript 4.7.2 when i run tsc --project tsconfig.json “@types/react-native”: “^0.66.3”,

Also get a bunch of errors for items like ‘height’ is declared but its value is never read. ‘item’ is declared but its value is never read. …I can silence them with “noUnusedLocals”: false, “noUnusedParameters”: false, in my tsconfig but rather not.

0reactions
hoaphantn7604commented, Jun 14, 2022

Hi @jcerone-boom , Version 2.0.0 has been release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error TS2578: Unused '@ts-expect-error' directive
However, when I run yarn run tsc to type check my codebase I get 5k+ errors stating error TS2578: Unused '@ts-expect-error' directive.
Read more >
Unused @ts-expect-error directive in @open-wc/testing-helpers
A change introduced in @open-wc/testing-helpers 1.8.9 (88ffd99) is causing an error when running all our tests via jest.
Read more >
ts-expect-error will report if there is no error. Unused '@ts ...
Discussion on: Getting Started With TypeScript​​ ts-expect-error will report if there is no error. True Sorry my mistake. Object keys is always a ......
Read more >
prefer-ts-expect-error - TypeScript ESLint
The two directives work the same, except @ts-expect-error causes a type error if placed before a line that's not erroring in the first...
Read more >
Build error: error TS2578: Unused '@ts-expect-error' directive
Hi, team, I receive error building redash. Have tried many options but failed to successfully build. ... src/visualizations/table/Renderer.tsx:125 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found