Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @arethetypeswrong/cli run to dtslint #811

Merged
merged 40 commits into from
Jan 30, 2024
Merged

Add @arethetypeswrong/cli run to dtslint #811

merged 40 commits into from
Jan 30, 2024

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Nov 4, 2023

DefinitelyTyped PR: DefinitelyTyped/DefinitelyTyped#67306

Packages that need "nonNpm": "conflict" instead of "nonNpm": true:

atom
dropbox-chooser
duo_web_sdk
estree-jsx
fancybox
fhir
geojson
hl7
jsqrcode
kakao-js-sdk
liferay
mdx
pexrtc
sketchapp
telegram-web-app
titanium
vk-openapi
vscode-webview
webxr
yandex-maps
@ember/string
hast
node
xast

Packages that report a @types version that doesn’t match anything on npm:

3box
ali-oss
allure-js-commons
amcharts
amplify
amplify-deferred
amplifier
angular-agility
angular-aria
angular-bootstrap-calendar
angular-animate
angular-dialog-service
angular-material
angular-meteor
angular-notifications
angular-notify
angular-odata-resources
angular-resource
angular-q-spread
angular-route
angular-scenario
angular-ui-router
angular-ui-notification
angular-ui-tree
angularfire
ansicolors
aos
apigee-access
app-root-dir
arbiter
artillery
assertsharp
async-polling
async-retry
@atlaskit/layer
atmosphere.js
atpl
aws-lambda
azdata
azure-sb
babel-types
babylon-walk
backbone.localstorage
backgrid
better-curry
bignum
bigint
@bitcoin-computer/lib
blissfuljs
bluebird-global
boolify-string
bootstrap-colorpicker
bootstrap-datepicker
bootstrap-maxlength
bootstrap-switch
bootstrap-touchspin
bootstrap-treeview
box2d
breeze
bunyan-blackhole
calq
cannon
canvasjs
@carbon/layout
@carbon/motion
@carbon/themes
@carbon/type
chai-datetime
chartjs-plugin-doughnutlabel-rebourne
chessboardjs
chui
closure-compiler
cls-hooked
code
colab
com.wikitude.phonegap.wikitudeplugin
compose-function
connect-flash
consolidate
content-type
contextjs
cordova-plugin-background-mode
cordova-plugin-email-composer
cordova-plugin-ibeacon
cordova-plugin-ms-adal
core-js
countdown
cradle
crossfilter
crossroads
cryptiles
cryptojs
css
css-modules
csurf
d3-box
d3-tip
data-driven
db-migrate-base
db-migrate-pg
debug
decorum
deep-freeze
deku
desmos
documentdb-session
documentdb
domurl
double-ended-queue
dts-bundle
dynatable
easy-api-request
easy-jsend
easy-xapi-utils
easy-xapi
ebongarde-root
egg.js
ejs-locals
elasticsearch
email-templates
emissary
emscripten
engine-check
epub
eq.js
es6-weak-map
esbuild-plugin-import-map
espruino
eth-sig-util
event-to-promise
express-pino-logger
express-serve-static-core
express-simple-locale
express-wechat-access
extjs
facebook-js-sdk
fast-levenshtein
favico.js
featherlight
ffi
ffmpeg
ffmpeg-static
@ffmpeg/libav-core
fibjs
figma
filesystem
finch
flipsnap
flight
flot
flowjs
fm-websync
foundation
friendly-errors-webpack-plugin
ftdomdelegate
generic-functions
gently
gensync
git
glidejs
go
google-closure-compiler
google-libphonenumber
google-one-tap
@google/maps
graphql-resolve-batch
guid
gulp-angular-templatecache
gulp-changed
gulp-cheerio
gulp-coffeeify
gulp-espower
gulp-help-doc
gulp-jasmine-browser
gulp-load-plugins
gulp-mocha
gulp-minify-css
gulp-ng-annotate
gulp-remember
gulp-sourcemaps
gulp-task-listing
h2o2
@hapi/catbox-memory
@hapi/catbox
@hapi/shot
hard-source-webpack-plugin
hasher
hashset
hashtable
hasura
hellosign-sdk
heroku-logger
hexo-bunyan
highlightjs
hoek
@hmscore/react-native-hms-push
hookrouter
html-webpack-plugin
htmltojsx
hyperscript
ignore-by-default
iltorb
imagemagick
imagemapster
inherits
iniparser
isomorphic-fetch
istanbul-middleware
jade
jake
jasmine-jquery
javascript-astar
jdataview
jfp
jpm
jqgrid
jquery-backstretch
jquery-cropbox
jquery-deparam
jquery-fullscreen
jquery-jcrop
jquery.are-you-sure
jquery.fullscreen
jquery.finger
jquery.highlight-bartaz
jquery.joyride
jquery.fancytree
jquery.mmenu
jquery.placeholder
jquery.qrcode
jquery.tipsy
jquery.uniform
jqueryui
jquery.ui.layout
js-clipper
js-schema
js-url
js.spec
jsbn
jsdeferred
json-editor
json-merge-patch
json-patch
json-pointer
json-schema
json2csv
jsonstream
jstorage
jsum
justifiedgallery
jwplayer
jxon
k6
kahoot.js-updated
knockback
knockout-amd-helpers
knockout-secure-binding
knockout-postbox
knockout.mapping
knockstrap
knockout.validation
koa-proxy
koa-router
konami.js
kos-core
lab
lazypipe
leadfoot
leaflet-curve
leaflet-gpx
leaflet-label
leaflet.pm
@ledgerhq/hw-transport-u2f
@lerna/package-graph
@lerna/project
@lerna/package
@lerna/run-topologically
@lerna/query-graph
@lerna/collect-updates
level-sublevel
lightpick
line-reader
lls
logg
loopback-boot
lowlight
macaca-circular-json
magic-number
maildev
mapbox
@mapbox/s3urls
markdown-it-lazy-headers
markitup
maskedinput
material-ui
mathjax
mem-cache
merge-stream
messenger
method-override
microservice-utilities
milliseconds
mimos
mina
mixpanel
mixto
mojang-minecraft-server-admin
moment-business
mojang-net
mojang-minecraft-ui
moment-precise-range-plugin
mongoose-promise
mongoose-sequence
msgpack
mu2
multer
multiparty
natural-sort
nedb-logger
neo4j
nes
netlify-auth-providers
ng-grid
ng-flow
ng-facebook
ng-i18next
ngbootbox
ngprogress-lite
node-mysql-wrapper
node-sass-middleware
node-uuid
node-xmpp-client
nodegit
nodeunit
noisejs
nomnom
notify
notifyjs-browser
@npmcli/ci-detect
nunjucks-date
office-js
oidc-token-manager
@onflow/flow-js-testing
openssi-websdk
paralleljs
parse-torrent-file
passport
passport-github2
passport-saml
passport-strategy
passport-vkontakte
passport-weibo
pathfinding
phantom
phonegap
phonegap-facebook-plugin
phonegap-nfc
phonegap-plugin-barcodescanner
photoshop
pi-spi
pino-multi-stream
pinterest-sdk
piwik-tracker
places
plupload
podium
polymer
polyline
popcorn
pouchdb-http
preact-i18n
precise
preloadjs
prismic-dom
promise-pg
promise-pool
promise-sftp
pump
purl
q-retry
quill
radius
random-string
rangy
raty
raven
rbac-a
react-better-password
react-cache
react-document-meta
react-fa
react-facebook-login-component
react-geosuggest
react-infinite
react-instantsearch-dom
react-instantsearch-native
react-jsonschema-form
react-key-handler
react-linkify
react-native-bluetooth-serial
react-native-dotenv
react-native-google-signin
react-native-huawei-protected-apps
react-native-material-ui
react-native-modern-datepicker
react-native-orientation
react-native-toast-native
react-onsenui
react-pie-menu
react-pointable
react-router-navigation
react-router-navigation-core
react-s-alert
react-scrollspy
react-sortable-tree-theme-file-explorer
react-sortable-tree
react-svg-pan-zoom-loader
react-swf
react-tap-event-plugin
react-touch
react-user-tour
read-package-tree
readmore-js
recharts-scale
redux-localstorage
remotedev-serialize
request
request-promise
resolve-dir
restify-plugins
rickshaw
@riderize/passport-strava-oauth2
riot-api-nodejs
riotjs
rison
rn-fetch-blob
rollup-plugin-json
rollup-plugin-svelte-svg
rosie
route-parser
routie
run-sequence
rx-jquery
rx-node
s3-uploader
sammy
sane
sat
satnav
scriptjs
scroller
scrollreveal
scrolltofixed
sequencify
servicenow
sharepoint
shortid
signalfx-collect
simple-cw-node
simple-react-lightbox
simple-xml
simple-url-cache
sipml
six-runtime
ski
sleep
socket.io.users
soundjs
space-pen
spectrum
standard-version
steam
stream-meter
stream-series
styled-components-react-native
succinct
supertest-as-promised
svg-injector
swagger-express-middleware
swagger-schema-official
swig
swipe
switchery
swiz
sylvester
tableau
tea-merge
tether-shepherd
text-encoding
timelinejs
timezone-js
@tinajs/tina-redux
to-markdown
tooltipster
topojson
torrent-stream
trayballoon
trim
tz-format
uglify-es
underscore-ko
underscore.string
url-regex-safe
urlparser
urlrouter
usage
use-sync-external-store
user-agents
user-event
utils-merge
uws
venn
vertx3-eventbus-client
viewporter
vimeo
vinyl-paths
vis
vmap
vscode
vue-datetime
waitme
wampy
weapp-api
webcl
webcrypto
webpack-env
webrtc
websql
wepy-redux
why-did-you-update
winston-dynamodb
wonder.js
@wordpress/custom-templated-path-webpack-plugin
@wordpress/library-export-default-webpack-plugin
wrench
xmldom
xmltojson
@xmpp/jid
xsockets
xss-filters
yandex-money-sdk
youtube-dl
@zeit/next-typescript
zengin-code
zmq
akumina-core
boom
catbox
color
durandal
ember
ember-test-helpers
formidable
glue
greasemonkey
grecaptcha
hapi
inert
ion-rangeslider
iscroll
jasmine
jquery
leaflet-editable
leaflet.awesome-markers
mdast
nodemailer
openlayers
oracledb
qunit
react-color
react-date-range
react-input-mask
react-leaflet-markercluster
react-router-redux
redux-form
sequelize
shot
signalr
simple-oauth2
stream-to-array
string-similarity
url-join
uuid
vast-client
vision
winjs
wreck
xrm

Packages that need "nonNpm": true

acc-wizard
add2home
angular-httpi
angular-idle
angular.throttle
angularlocalstorage
appframework
applepayjs
appletvjs
auth0.widget
azure-mobile-services-client
bgiframe
bootstrap.paginator
bootstrap.timepicker
chocolatechipjs
chrome-apps
commangular
cordova-ionic
cordova-plugin-mapsforge
createjs-lib
css-font-loading-module
cybozulabs-md5
d3.slider
deoxxa-content-type
deployjava
df-visible
dhtmlxgantt
dhtmlxscheduler
doccookies
dock-spawn
documentdb-server
dropboxjs
dvtng-jss
dw-bxslider-4
dymo-label-framework
ember-testing-helpers
facebook-pixel
farbtastic
filewriter
fontoxml
gae.channel.api
gandi-livedns
gamequery
gapi.analytics
gapi.calendar
gapi.plus
gapi.people
gapi.pagespeedonline
gapi.translate
gapi.drive
gapi.youtube
gapi.youtubeanalytics
gapi.urlshortener
gaugejs
geometry-dom
gldatepicker
google-ads-scripts
google-drive-realtime-api
google-earth
google.analytics
google.feeds
google.geolocation
google.visualization
googlemaps.infobubble
gorilla-engine
gulp-dtsm
headroom
hubspot-pace
hypertext-application-language
ibm-mobilefirst
imgur-rest-api
intercomjs
ipaiva
ix.js
javascript-bignum
java-applet
jee-jsf
jquery-alertable
jquery-galleria
jquery-handsontable
jquery-truncate-html
jquery-timeentry
jquery-urlparam
jquery.address
jquery.base64
jquery.autosize
jquery.bbq
jquery.cleditor
jquery.blockui
jquery.bootstrap.wizard
jquery.color
jquery.contextmenu
jquery.clientsidelogging
jquery.colorpicker
jquery.cycle
jquery.customselect
jquery.dropotron
jquery.fileupload
jquery.colorbox
jquery.flagstrap
jquery.dynatree
jquery.filtertable
jquery.elang
jquery.form
jquery.gridster
jquery.jsignature
jquery.menuaim
jquery.livestampjs
jquery.leanmodal
jquery.notifybar
jquery.jnotify
jquery.pjax
jquery.pnotify
jquery.postmessage
jquery.prettyphoto
jquery.noty
jquery.simplemodal
jquery.simplepagination
jquery.superlink
jquery.simulate
jquery.tagsmanager
jquery.sortelements
jquery.timeago
jquery.timer
jquery.tinycarousel
jquery.timepicker
jquery.rowgrid
jquery.tinyscrollbar
jquery.total-storage
jquery.watermark
jquerymobile
jquery.window
jquery.tile
jquery.ui.datetimepicker
jsfl
jsoneditoronline
kap-plugin
kendo-ui
kik-browser
kineticjs
knockout.deferred.updates
knockout.editables
knockout.mapper
knockout.es5
knockout.kogrid
knockout.projections
knockout.rx
knockout.viewmodel
kolite
leapmotionts
lestate
mapsjs
mcustomscrollbar
meteor-accounts-phone
meteor-jboulhous-dev
meteor-persistent-session
meteor-prime8consulting-oauth2
meteor-publish-composite
meteor-roles
meteor-sjobs
microsoft-ajax
microsoft-live-connect
microsoft-sdk-soap
minapp-env
mojang-gametest
mojang-minecraft
musickit-js
naver-whale
ng-command
node-fibers
node_redis
noteflight-client
nw.gui
nw.js
oauth.js
office-js-preview
openjscad
openui5
parcel-env
paypal-cordova-plugin
payu-emea-sdk
pebblekitjs
playerframework
progressjs
riot-games-api
royalslider
safari-extension
safari-extension-content
screeps-arena
segment-analytics
sencha_touch
sigmajs
smart-fox-server
snowpack-env
stripe-v2
stripe-v3
suitescript
svg-maps__common
svgjs.resize
svgjs.draggable
swipeview
teechart
to-title-case-gouch
twitch-browser
twitter-for-web
umbraco
unity-webapi
valdr-message
vortex-web-client
wallabyjs
webassembly-web-api
webgl-ext
webgl2
webvr-api
wiiu
winrt
winrt-uwp
workerb-api
ydn-db
zip.js
bootstrap.v3.datetimepicker
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
devexpress-web
sphere-engine-browser
sphere-engine-browser

packages/dtslint/src/checks.ts Fixed Show resolved Hide resolved
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, although I think the config filename should be different, and you might want to rename 'failingPackages' to 'skippedPackages' or 'expectedFailures' or something.

packages/dtslint/src/index.ts Show resolved Hide resolved
packages/dtslint/src/index.ts Outdated Show resolved Hide resolved
packages/dtslint/src/index.ts Outdated Show resolved Hide resolved
packages/dtslint/expectedNpmVersionFailures.txt Outdated Show resolved Hide resolved
packages/dtslint/src/checks.ts Outdated Show resolved Hide resolved
packages/dtslint/src/index.ts Outdated Show resolved Hide resolved
packages/dtslint/src/lint.ts Outdated Show resolved Hide resolved
@@ -7,6 +7,12 @@ export function packageNameFromPath(path: string): string {
const base = basename(path);
return /^v\d+(\.\d+)?$/.exec(base) || /^ts\d\.\d/.exec(base) ? basename(dirname(path)) : base;
}
export function packageDirectoryNameWithVersionFromPath(path: string): string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actual change necessary, but I do hope that one day we can eliminate all of the path-dependent behavior and just use package.json as the source of truth; that's all package linking cares about.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think that’s possible for this—exemptions for mismatched npm versions need to be specified at the react/v16 level, but there’s nothing in react/v16/package.json that would tell us, in isolation, whether we should refer to it as react or react/v16

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is; the name + the version. Post-pnpm, if it weren't for DT tooling, the packages could be placed in any directory at all. The name + version combo in package.json is all that is used to link them together.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there’s no way to know if 16 is latest or not without looking at the directory structure (or every other package). We could list exemptions by name and version in all cases I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have a minor feeling that the idea of a "latest" package is generally no longer needed in a post-monorepo world, but, I'm just musing and I still don't want you to do anything here 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I actually find annoying is that we don’t use the AllPackages class here, so all this stuff is duplicated. I don’t care as much that it’s path-based, but I wish there were a single source of truth for that processing. In the past, AllPackages couldn’t be used without parsing, well, all packages, but now that it’s lazy I think we could bring it in with pretty much zero perf cost.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent, just a comment on style and comment on wording both of which could be improved. But I don't have concrete ideas, so I guess it's OK to either merge today or wait till next week.

packages/dtslint/src/index.ts Show resolved Hide resolved
container.push(
(isError
? ""
: `Ignoring npm version error because ${packageDirectoryNameWithVersion} was failing when the check was added. ` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wording "${package} was failing when the check was added" is a little confusing. Which check? What's the scope of "was added" -- to CI? injected into this run?

Unfortunately I don't have any ideas on how to improve this yet.

packages/dtslint/src/index.ts Outdated Show resolved Hide resolved
@andrewbranch andrewbranch merged commit 4216821 into main Jan 30, 2024
7 checks passed
@andrewbranch andrewbranch deleted the attw branch January 30, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants