jquery / jquery/esprima

Enable noImplicitAny and type everything properly

Open
#2,066 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.1k
Forks
773
PR merge metrics
No merged PRs in 30d

Description

Using Typescript is great (when type declarations are shipped anyway), but it's kind of rubbish that so many of the types are just any. It would be a good idea to enable the noImplicitAny option and then fix all of the errors. For example here are the types for the main functions:

export declare function parse(code: string, options: any, delegate: any): any;
export declare function parseModule(code: string, options: any, delegate: any): any;
export declare function parseScript(code: string, options: any, delegate: any): any;
export declare function tokenize(code: string, options: any, delegate: any): any;

Not very useful!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TypeScript declarations for parse, parseModule, parseScript, and tokenize, then enable the noImplicitAny option to enumerate the remaining errors. Review the affected types and confirm that the declarations no longer use unhelpful any types and that the project type-checks successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.