[Typings] Not compatible with `strict` compilerOptions
See original GitHub issueExpected 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:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m translating the project to typescript so, with some help, this should be resolved soon.
The migration is done. Please update to version
1.4.0-alpha.23
.