Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_js_analyze): add new TypeSCript globals #4644

Merged
merged 1 commit into from
Jul 1, 2023
Merged

refactor(rome_js_analyze): add new TypeSCript globals #4644

merged 1 commit into from
Jul 1, 2023

Conversation

Conaclos
Copy link
Contributor

@Conaclos Conaclos commented Jun 30, 2023

Summary

Fixes #4643

This PR updates my first contribution to Rome! :)

Actually the description of my first PR was really useful. I take the opportunity to improve the process:

I retrieved the types using the following command:

grep -E '^type|interface' decorators* es* header.d.ts | \
    cut -d' ' -f2 | cut -d '<' -f1 | \
    sort | uniq >| all_types

I extracted the current list of type with the following commands:

/home/conaclos/project/rome_tools/crates/rome_js_analyze/src/globals/typescript.rs | uniq >| current_types

I also stored the concrete JavaScript values in a file named js_types.

cat js_types
*
AggregateError
Array
ArrayBuffer
BigInt
BigInt64Array
BigUint64Array
Boolean
DataView
Date
Error
EvalError
FinalizationRegistry
Float32Array
Float64Array
Function
Int16Array
Int32Array
Int8Array
JSON
Map
Math
Number
Object
Promise
RangeError
ReferenceError
RegExp
Set
SharedArrayBuffer
String
SuppressedError
Symbol
SyntaxError
TypeError
URIError
Uint16Array
Uint32Array
Uint8Array
Uint8ClampedArray
WeakMap
WeakRef
WeakSet

I removed from all_types, the values of js_types:

comm all_types js_types | cut -f1 | grep -v '^\s*$' >| ts_types

And I extracted the new ts types:

comm ts_types current_types | cut -f1 | grep -v '^\s*$' >| new_types

I updated the Rome list by adding the new types.

Test Plan

@netlify
Copy link

netlify bot commented Jun 30, 2023

Deploy Preview for docs-rometools canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit d15fd32
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/649f593cc26735000927dafa

@github-actions github-actions bot added the A-Linter Area: linter label Jun 30, 2023
@Conaclos Conaclos merged commit 67ac1d3 into rome:main Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Some TypeScript utility types detected as undeclared with noUndeclaredVariables enabled
2 participants