wintercg / proposal-common-minimum-api

https://common-min-api.proposal.wintercg.org/
Other
216 stars 15 forks source link

Provide TypeScript config for minimum common API #31

Open ytxmobile98 opened 1 year ago

ytxmobile98 commented 1 year ago

My company is looking for integrating WinterCG common minimum API into TypeScript config, in order to provide type checking, error highlighting, autocomplete, etc.

1. TypeScript base config

Developers may be able to write something like this in tsconfig.json:

{
  "extends": "@tsconfig/wintercg/tsconfig.json"
}

This tsconfig should at least support the common minimum APIs which are listed in https://blog.cloudflare.com/introducing-the-wintercg/ and https://common-min-api.proposal.wintercg.org/.

Install the wintercg tsconfig:

npm install --save-dev @tsconfig/wintercg
yarn add --dev @tsconfig/wintercg

2. lib

Provide WinterCG common minimum API access in the lib configuration. For example: lib can be set to WinterCG.

Screenshot from 2022-11-04 16-59-36