Commit Graph

35 Commits

Author SHA1 Message Date
Jake Bailey 96acaa5290 Remove no-default-lib (#62435) 2025-09-24 16:16:14 -07:00
Jake Bailey 16beff101a Use explicit extensions for imports within src (#58421) 2024-05-06 17:07:54 -07:00
Jake Bailey 5e8c261b6a dprint the codebase (#54820) 2023-08-16 14:26:38 -07:00
Jake Bailey ac55b297b7 Upgrade "boolean-trivia" lint to new "argument-trivia" lint that uses type info, has quick fixes, etc. (#53002) 2023-03-23 16:26:39 -07:00
Nathan Shively-Sanders ff1e08f859 Rename scanner token methods (#53078) 2023-03-07 13:54:44 -08:00
Jake Bailey 00dc0b6674 Flip imports to case insensitive sorting (#51579) 2022-11-17 15:35:28 -08:00
Jake Bailey 2d2a4343b8 Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Jake Bailey 07758c08ab Generated module conversion step - inlineImports
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
2022-11-07 13:33:07 -08:00
Jake Bailey b6c0538826 Generated module conversion step - stripNamespaces
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
2022-11-07 13:32:03 -08:00
Jake Bailey 9a0b85ce2a Generated module conversion step - explicitify
This step makes all implicit namespace accesses explicit, e.g. "Node" turns into "ts.Node".
2022-11-07 13:29:05 -08:00
Jake Bailey 94724a8c2e Generated module conversion step - unindent
This step makes further commits look clearer by unindenting all of the top level namespaces preemptively.
2022-11-07 13:28:13 -08:00
Oleksandr T d0bfd8caed fix(51072): ts.preProcessFile finds import in template string after conditional expression with template strings (#51082) 2022-10-07 10:33:20 -07:00
Oleksandr T c981c9ba5a fix(47597): ignore commented imports following template expression (#47657) 2022-03-15 15:28:49 -07:00
Sheetal Nandi 221a2aeb1b Handle import type and export type in preprocess (#37508)
Fixes #37338
2020-03-23 10:11:01 -07:00
Andrii Dieiev c6cfd66fa8 Support template literals in preProcess (fixes #33680) (#33688) 2020-03-12 15:50:23 -07:00
Ron Buckton ec0af20f5a Merge branch 'master' into libReference 2018-05-29 14:13:00 -07:00
Andy e53e56cf82 Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Ron Buckton 698f229bb4 Merge branch 'master' into libReference 2018-05-09 11:41:13 -07:00
Andy 7fb7eecf2c Add telemetry for open JS files (#23833)
* Add telemetry for open JS files

* Send event every time

* Keep stats even for closed files

* Remove tsCheckCountForOpenFilesTelemetry

* Use 'info.path'

* Update API
2018-05-09 07:51:46 -07:00
Ron Buckton a089297ca3 Add 'lib' reference support 2018-05-04 15:51:13 -07:00
Mohamed Hegazy f0057f9a33 Remove condition 2018-04-16 11:48:04 -07:00
Joscha Feth a3311edb4a revert change 2018-04-15 11:30:37 +10:00
Joscha Feth 4dc9db1e70 detect nested non-imports 2018-04-15 11:27:51 +10:00
Joscha Feth c64c1c9395 fix up 2018-04-15 03:30:47 +10:00
Joscha Feth f4fa2eb28e undefined instead of null 2018-04-15 01:51:01 +10:00
Joscha Feth 02b8160b41 store lastToken 2018-04-15 01:23:27 +10:00
Joscha Feth ee429ef2ea use state 2018-04-13 11:39:29 +10:00
Joscha Feth 4da2e5eda3 fix: do not match MySymbol.import("mod") 2018-04-12 19:31:07 +10:00
Wesley Wigham 32c63a2628 Add support for transpiling per-file jsx pragmas (#21218)
* Add support for per-file jsx pragmas

* Add error for using jsx factory pragma with fragments

* More tests, use different regex class for pragma capture

* Unify all pragma parsing machinery
2018-02-26 16:10:00 -08:00
Andy 6f2ba15446 Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
Andy 2a70bf5158 Don't count a write-only reference as a use (#17752)
* Don't count a write-only reference as a use

* Split isWriteAccess to isWriteOnlyAccess and isReadOnlyAccess

* Update "unusedParameterUsedInTypeOf" to use "b"

* Update diagnostic messages: "is never used" -> "its value is never read"

* Use a WriteKind enum

* Rename enum and move documentation to enum members
2017-09-13 09:02:33 -07:00
Andy e7dc2a67ca Enable "object-literal-shorthand" lint rule (#16987) 2017-07-07 07:26:58 -07:00
Kanchalai Tanglertsampan 7d2d35d0bf Include dynamic import during pre-processing needed by VS 2017-06-08 14:31:44 -07:00
Ron Buckton feedb6ccff Make preProcessFile public again 2016-09-08 15:23:50 -07:00
Andy Hanson 4d6bd9df72 Break many functions out of services.ts and into their own modules. 2016-09-07 09:22:11 -07:00