Comments (5)
That’s what DefinitelyTyped is for.
from is-primitive.
I'm just proposing another option @ljharb.
from is-primitive.
Do DT types exist already?
It makes no sense to have a type definition if the project isn’t written in TS, since there’s no reliable way to enforce that the TS type matches the JS file.
from is-primitive.
It makes no sense to have a type definition if the project isn’t written in TS, since there’s no reliable way to enforce that the TS type matches the JS file.
Both approaches (having a definition file in the repo vs. having a file at @types/is-primitive
) require maintaining. The purpose of a types definition file is to provide types for a library written in JS. Typing a project written in TS which compiles to JS is easier, but most npm packages don't follow that route. In my view it's better to have the definition file as part of the repo as it makes for easier maintainability compared to it being in a different repo, as well as there being less clutter in package.json
.
from is-primitive.
I very much don't agree; if there's no way to enforce keeping them in sync in-repo, the main npm package might release v1.2.3 with a type bug, and be forced to release a v1.2.4 with no actual JS-related changes. Separating them frees the two conceptually different products to be released independently.
from is-primitive.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from is-primitive.