question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Typings] Not compatible with `strict` compilerOptions

See original GitHub issue

Expected behavior

No error when using typescript with configuration complerOptions.strict and tslint:recommended enable.

Actual behavior

ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
164:5 'preventDefault', which lacks return-type annotation, implicitly has an 'any' return type.
    162 |     relatedTarget: DOMElement
    163 |     currentTarget: DOMElement
  > 164 |     preventDefault ()
        |     ^
    165 |     pageX: number
    166 |     pageY: number
    167 |     clientX: number
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
276:5 'test', which lacks return-type annotation, implicitly has an 'any' return type.
    274 |     styleCursor ( yesno: boolean ) : Interactable
    275 |     createSnapGrid ( opt: { x: number, y: number, range: number, offset: Position } ) : SnapFunction
  > 276 |     test ( x : SnapFunction )
        |     ^
    277 |   }
    278 |
    279 |   interface InteractOptions {
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
291:13 Parameter 'any' implicitly has an 'any' type.
    289 |     pointerMoveTolerance ( tol?: number ) : number | InteractStatic
    290 |     // TODO
  > 291 |     isSet ( any ) : any
        |             ^
    292 |     off ( any ) : any
    293 |     debug ( any ) : any
    294 |     addDocument ( any ) : any
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
292:11 Parameter 'any' implicitly has an 'any' type.
    290 |     // TODO
    291 |     isSet ( any ) : any
  > 292 |     off ( any ) : any
        |           ^
    293 |     debug ( any ) : any
    294 |     addDocument ( any ) : any
    295 |     removeDocument ( any ) : any
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
293:13 Parameter 'any' implicitly has an 'any' type.
    291 |     isSet ( any ) : any
    292 |     off ( any ) : any
  > 293 |     debug ( any ) : any
        |             ^
    294 |     addDocument ( any ) : any
    295 |     removeDocument ( any ) : any
    296 |   }
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
294:19 Parameter 'any' implicitly has an 'any' type.
    292 |     off ( any ) : any
    293 |     debug ( any ) : any
  > 294 |     addDocument ( any ) : any
        |                   ^
    295 |     removeDocument ( any ) : any
    296 |   }
    297 | }
ERROR in /home/wildan/Projects/Sensorfied/EDI/edi-ui/node_modules/interactjs/index.d.ts
295:22 Parameter 'any' implicitly has an 'any' type.
    293 |     debug ( any ) : any
    294 |     addDocument ( any ) : any
  > 295 |     removeDocument ( any ) : any
        |                      ^
    296 |   }
    297 | }
    298 |

Suggestion

For just temporary, I suggest any PR involving typescript should be accepted by default until there is a smoke test for supporting typescript.

System configuration

interact.js version: 1.3.3 Browser name and version: Google Chrome Version 64.0.3282.186 (Official Build) (64-bit) Operating System: Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
tayecommented, Jan 28, 2019

I’m translating the project to typescript so, with some help, this should be resolved soon.

2reactions
tayecommented, Feb 1, 2019

The migration is done. Please update to version 1.4.0-alpha.23.

npm install interactjs@next
npm install --save-dev @interactjs/types@next
Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent "use strict" in typescript? - Stack Overflow
I noticed that if we declare our class inside a namespace then "use strict" does not appear.
Read more >
TSConfig Reference - Docs on every TSConfig option
With exactOptionalPropertyTypes enabled, TypeScript applies stricter rules around how it handles properties on type or interfaces which have a ? prefix.
Read more >
The --strict Compiler Option in TypeScript - Marius Schulz
TypeScript 2.3 introduced a new --strict compiler option that enables a number of other compiler options related to stricter type checking.
Read more >
TypeScript strictly typed: strict mode is not enough - Medium
While not the default, the officially recommended way to work with TypeScript is in strict mode. Strict mode activates 2 main compiler options:....
Read more >
How to turn on TypeScript strict mode in specific files
Imagine you have to migrate your JavaScript project to TypeScript. ... For most projects that are not strict yet, it would take quite...
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