Commit 5887c4d
feat: TypeScript support for Espree (#705)
* feat: typescript
Also:
- test: complete coverage
* Update packages/espree/package.json
Co-authored-by: Francesco Trotta <github@fasttime.org>
* rename ParserOptions -> Options
* rename ecmaVersion -> EcmaVersion; remove unused imports
* cast lastTemplateToken as (defined) acorn.Token
* add tsd tests and inspired fixes (making arguments optional)
* add further public exports
* tsd fixes
* Update packages/espree/package.json
Co-authored-by: Francesco Trotta <github@fasttime.org>
* assume loc and range are defined
* liberalize version string type
* remove unused import
* moving definitions to main export file; attempt to avoid lib folder
* Revert "moving definitions to main export file; attempt to avoid lib folder" but keep exported types within espree.js
This reverts commit d558469.
* inline BaseEsprimaToken
* delete dist/lib at end of build
* check dist file types; make eslint-visitor-keys explicit to avoid broken type dependency
* remove dist/lib with evaluated script
* revert to stable acorn-jsx
* inline acorn-jsx types
* Update packages/espree/lib/espree.js
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* switch from Integer to number
* liberalize version
* Update packages/espree/tsconfig.json
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* Update packages/espree/tsconfig-cjs.json
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* use bare import specifier
* set `getLatestEcmaVersion` to last `const` value in union
* narrow parse return type to acorn.Program
* reuse existing import for types
* double quotes
* Update packages/espree/lib/espree.js
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* Update packages/espree/espree.js
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* Update packages/espree/lib/options.js
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* use `@import`
* Update packages/espree/espree.js
Co-authored-by: 루밀LuMir <rpfos@naver.com>
* normalizedEcmaVersion -> NormalizedEcmaVersion
* infer _R -> unknown[]
Co-authored-by: Francesco Trotta <github@fasttime.org>
* move JSDoc types after imports
* use EcmaVersion internally to options.js function
* revert EcmaVersion values and add need for updating to CONTRIBUTING
---------
Co-authored-by: Francesco Trotta <github@fasttime.org>
Co-authored-by: 루밀LuMir <rpfos@naver.com>1 parent 010de9c commit 5887c4d
12 files changed
Lines changed: 917 additions & 308 deletions
File tree
- packages/espree
- lib
- test-d
- tests/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
65 | 134 | | |
66 | 135 | | |
67 | 136 | | |
| 137 | + | |
| 138 | + | |
68 | 139 | | |
| 140 | + | |
| 141 | + | |
69 | 142 | | |
70 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
71 | 148 | | |
72 | 149 | | |
73 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
74 | 164 | | |
75 | 165 | | |
76 | 166 | | |
77 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
78 | 172 | | |
79 | 173 | | |
80 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
81 | 188 | | |
82 | 189 | | |
83 | 190 | | |
84 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
85 | 197 | | |
86 | 198 | | |
87 | 199 | | |
| |||
100 | 212 | | |
101 | 213 | | |
102 | 214 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
106 | 218 | | |
107 | 219 | | |
108 | 220 | | |
| |||
113 | 225 | | |
114 | 226 | | |
115 | 227 | | |
116 | | - | |
| 228 | + | |
117 | 229 | | |
118 | 230 | | |
119 | 231 | | |
| |||
123 | 235 | | |
124 | 236 | | |
125 | 237 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
129 | 241 | | |
130 | 242 | | |
131 | 243 | | |
| |||
137 | 249 | | |
138 | 250 | | |
139 | 251 | | |
| 252 | + | |
140 | 253 | | |
141 | 254 | | |
142 | 255 | | |
143 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
144 | 260 | | |
145 | 261 | | |
146 | 262 | | |
| |||
149 | 265 | | |
150 | 266 | | |
151 | 267 | | |
| 268 | + | |
| 269 | + | |
152 | 270 | | |
153 | 271 | | |
154 | 272 | | |
| |||
0 commit comments