When initially written types were not in the symbol table. Now that
types are in the symbol table it makes sense given
```ts
type A = 1
type B = A
```
that you can get to the symbol id for for A from type B = A.
Please correct me if I'm wrong about how I implemented this. I also
verified that occurrence (I believe this is the correct word) behaves
how I would expect.
```ts
type RecursiveType = string | {[x: string]: RecursiveType}
```
Does populate a reference.
---------
Co-authored-by: Boshen <boshenc@gmail.com>
# 1. Support join('\n')
I'm trying to run `just new-rule no-unexpected-multiline`, It found
rulegen not support test code pieced together using `array.json("\n")`,
like
```js
{
code: [
"const x = aaaa<",
" test",
">/*",
"test",
"*/`foo`"
].join("\n")
}
```
I found this kind of code widely in the eslint codebase, so it will be
great if we can support this.

# 2. remove extra `,`
And I found when meet unsupported code, rulegen will generate an extra
`,`, so I added a filter at
45cf5fc3da/tasks/rulegen/src/main.rs (L363)
# 3. handle escape string
The escape `/` and trailing `/` in the javascript code will break
rulegen. example: `"\"abc\\\n(123)\""`
I made the following changes:
```diff
- test_code.replace('\n', "\n\t\t\t")
+ test_code.replace('\n', "\n\t\t\t").replace('\\', "\\\\").replace('\"', "\\\"")
```
For #634.
This PR prepares for the fix of #634, adding an option to formatter to
control whether to quote object properties. After this PR, the rulegen
script can use oxc-formatter to output JSON-like object literal.
The `Quote Props` option is from Prettier. For detail:
https://prettier.io/docs/en/options.html#quote-props
> Change when properties in objects are quoted.
> Valid options:
> "as-needed" - Only add quotes around object properties where required.
> "consistent" - If at least one property in an object requires quotes,
quote all properties.
> "preserve" - Respect the input use of quotes in object properties.
---------
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
Fixes 11 TS conformance tests and 18 babel tests.
Adds types to the symbol table functionally conformant to TS behavior
but symbol flags implemented slightly differently.
Symbol redeclaration check is also not entirely conformant but fixing
this seems like a separate PR.
For testing purposes - consistent-export-type was also implemented
(WIP).