Commit graph

130 commits

Author SHA1 Message Date
Oleksandr T db01e84700
feat(eslint): consistent-type-assertions (#43556) 2021-05-18 06:20:57 -07:00
Ron Buckton d07e866a28
Fix for jsdoc modifiers on constructor params (#38403)
* Fix for jsdoc modifiers on constructor params

* Update Public API baseline and fix unique symbol grammar check for js
2020-05-11 15:07:43 -07:00
Ron Buckton 177713ef45
Switch Debug.assertX functions to use asserts conditions (#36995)
* Switch Debug.assertX functions to use asserts conditions

* Replace assert functions with ts.noop when assertion level too low
2020-02-24 18:20:58 -08:00
Alexander T 7d449ac13f no-fallthrough 2019-06-21 18:32:22 +03:00
Andy 13bc46d970
getTokenAtPosition: default includeJsDocComment to true (#25015)
* getTokenAtPosition: default includeJsDocComment to true

* Update API (#24966)

* Flip meaning of parameter

* Update API (#24966)

* Remove all `ignoreJsDocComment` uses (fixes #25162)
2018-06-26 16:20:44 -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
Andy 7271ec1240
Add 'move to new file' refactor (#23726)
* Add 'move to new file' refactor

* Code review, and support commonjs

* Compute movedSymbols completely before using, and support `export import`

* Fix assertion error: sort empty change before non-empty change

* Remove extra newline

* Add allowTextChangesInNewFiles preference

* Add the new file to 'files' in tsconfig

* Avoid parameter initializer

* Update API baselines

* Use path relative to tsconfig.json

* Code review

* Fix error where node in tsconfig file was missing a source file
2018-05-10 11:17:04 -07:00
Ryan Cavanaugh 9a5a5b10a3 Remove all reference comments from services 2018-04-11 15:39:12 -07:00
Andy 6c63dd25e6
breakpoints: Fix invalid cast (#22153) 2018-03-01 13:13:27 -08:00
Andy b3edc8f9f4
Apply 'no-unnecessary-type-assertion' lint rule (#22005)
* Apply 'no-unnecessary-type-assertion' lint rule

* Fix type error

* Fix tsconfig.json

* Add --format back
2018-02-16 18:38:00 -08:00
Andy fc18f08e63
Remove 'indexOf' helper, use 'arr.indexOf()' (#20194) 2018-01-08 10:39:52 -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 74a44e09a7
Support semantic classification of alias (#20012) 2017-11-17 08:04:51 -08:00
Andy cc2a2a79b5
Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors (#17831)
* Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors

* Set context flags on tokens

* Remove 'isDeclarationFile' parameter to 'initializeState' and move to 'parseSourceFileWorker'

* Changes based on code review

* Update API baselines
2017-11-03 08:08:48 -07:00
Andy f4236ec5c8
Rename "isPartOfExpression" (#18469) 2017-10-31 08:05:39 -07:00
Andy 2748b3b334 Add isForInOrOfStatement utility (#16455) 2017-06-12 11:08:41 -07:00
Andy Hanson 38784b761a Support for JSDoc in services 2017-05-15 14:45:30 -07:00
Andy Hanson 455492d887 Merge branch 'master' into fallthrough 2017-04-18 09:48:21 -07:00
Arthur Ozga 7e03429a8e enforce triple-equals 2017-04-04 15:51:13 -07:00
Andy Hanson 1cf765d664 Lint for fallthrough in switch 2017-03-27 15:09:00 -07:00
Klaus Meinhardt 6c9ba46e8b Fix compile errors 2017-02-19 22:03:32 +01:00
Kagami Sascha Rosylight 27a60e4580 fix linting errors 2016-12-18 15:44:54 +09:00
Nathan Shively-Sanders a84c7aeea4 Rename SpreadElementExpression -> SpreadAssignment
and SpreadExpression (formerly SpreadElementExpression) -> SpreadElement
2016-11-07 08:36:03 -08:00
Nathan Shively-Sanders a0db19749a Rename Spread[Element]Expression
1. SpreadElementExpression (existing, for arrays) -> SpreadExpression
2. SpreadElement (new for object literals) -> SpreadElementExpression
2016-09-26 11:50:02 -07:00
Yui f235bf7db8 [Transforms] Merge master 06/06/2016 (#8991)
* Remove check narrowing only certain types, add test showing issues with this

* string literal case test

* Reconcile fix with CFA work

* Defaultable -> NotNarrowable to align with use

* Missed a defaultable in comments

* Add test for narrowing to unions of string literals

* Rewrite isInStringLiteral to accomodate for unterminated strings

* Refactor signatureHelp to expose helper functions

* Add support for completion in string literals

* Remove unused check

* Use const instead of let

* Fix error

* Formatting changes

* Use shorthand properties

* Add failing test for #8738

* Sort baseline reference identifier by name

* Detects assignment to internal module export clause, fixes #8738

* add SharedArrayBuffer

fix

* Factor out assignment op check

* Add test for composite assignment

* Factor out the behaviour and handles x++ and ++x

* Handles ES3 default as identifier name

* Fix missing else statement

* isNameOfExportedDeclarationInNonES6Module

* Reorder options alphabetically

* Mark diagnostics, and skipDefaultLibCheck as internal

* Allow an import of "foo.js" to be matched by a file "foo.ts"

* Improve loadModuleFromFile code

* Respond to PR comments

* Respond to more PR comments

* Fix test

* Actually merge from master

* Revert to old tryLoad implementation

* Run fixupParentReferences when parsing isolated jsDocComment

* initial revision of unit test support for project system in tsserver

* Allow wildcard ("*") patterns in ambient module declarations

* Add non-widening forms of null and undefined

* Create separate control flows for property declarations with initializers

* Add regression test

* Allow trailing commas in function parameter and argument lists

* Add tests

* Remove unused variable

* Add null check and CR feedback

* Support shorthand ambient module declarations

* Revert "Merge pull request #7235 from weswigham/narrow-all-types"

This reverts commit ef0f6c8fe4, reversing
changes made to 9f087cb62a.

* reuse the fixupParentReferences function

* Improve typing of && operator with --strictNullChecks

* Add test

* Respond to PR comments

* Respond to PR comments

* Add merging tests

* Use a function `stringify` to simplify calls to `JSON.stringify(xyz, undefined, 2)`

* Update tests

* Fix mistake

* Include indent in navigation bar protocol

Previously navbar01 test had indents when run in the browser but not when run from node. Now they run the same.

* Remove unnecessary restrictions in property access narrowing

* Fix fourslash test

* Add regression test

* Consider property declarations to be control flow containers

* Adding regression test

* Remove restriction on --target es5 and --module es6

* change type definition for Object.create

* Fix signature help

* Add "implicit any" warning for shorthand ambient modules

* Remove trailing whitespace

* Support using string values in enums for CompilerOptions in transpile methods

* Remove trailing whitespace in jakefile

* Make `jake runtests-browser` support test regexes with spaces

For example: `jake runtests-browser t="transpile .js files"` now works.

* Add another test

* factor out isJsxOrTsxExtension

* Move to a conformance test

* Revert "Revert "Merge pull request #7235 from weswigham/narrow-all-types""

This reverts commit fc3e040c51.

* Use inclusive flag, as originally done, but include almost everything

* Add additional tests

* Respond to PR comments

* Fix typo

* add tests for tsserver project system

* Fix test

* Allow case comparison to undefined and null in strict null checking mode

* Remove incorrectly added tests

* check if moduleResolution when verifying that program can be reused

* more tests for module resolution change and exclude

* Fix linting issues

* Merge JSDoc of assignments from function expressions

* Allow nested assignments in type guards

* Add tests

* Improve order of parameter's merged jsdoc

* Force LF newlines for LKG builds/non debug builds
Fixes 6630

* Create intersection types in type guards for unrelated types

* Split commentsFunction test into expr/decl

And renumber.

* Remove TODO comments

* Accept new baselines

* Add tests

* Remove comments

* Fix test helper

* Recognize relative path using in outDir property (#9025)

* Recognize relative path using in outDir property

* Add projects tests

* Add project .json files

* Update baselines

* Add comments

* Add test case

The test passes in 1.8 and fails in master.

* Return trace when exception happens

* Remove Long-Done TODO

AFAIK, the harness sources have been concatenated into `run.js` for as long as I've known. This stops executing them twice (and in turn makes debugging tests much easier, since you no longer have to debug into eval'd code).

* Allow primitive type guards with typeof on right

Previously, only type guards of the form `typeof x === 'string'` were
allowed. Now you can write `'string' === typeof x`.

* Primitive type guards are now order independent

* Fix comments in tests

* Add handleing for classes

* Add more tests for target=es5 module=es6

* addExportToArgumentListKind

* Accept baseline

* Add more tests

* wip-fixing transforms

* Adds progress indicators to the runtests-parallel build task.

* Fixed typo

* Fix comment

* Add test for out-of-range error

* Use proper method of not resolving alias

* Fix module loading error

(commandLineOptions_stringToEnum would be undefined if optionDeclarations wasn't loaded yet)

* Port 8739

* Update tests

* Update baselines

* Contextually type return statement in async function

* Remove stale files

* Undo change

* Improve perf

* Improve tests

* Fix sourcemaps for debugging tests

* Allow --sourceRoot with --inlineSources option
Fixes #8445

* this in parameter initializers resolves to class

Accept baselines now that the test passes.

* Add tests for more kinds of import/export

* Fix7334 Disallow async in functionExpression and ArrowFunction (#9062)

* Error when using async modifier in function-expression and arrow-function when target es5

* Add tests and baselines

* Resolve function-this in parameter initialisers when explicitly provided

* Allow null/undefined guard with null/undefined on left

Also add a test with baselines.

* Code review comments

* Update more diagnostic messages ES6->2015

Fix #8996 CC @mhegazy.

* Fixes an issue with runtests-parallel when global mocha is not installed.

* Update LKG

* Add tests

* fix baselines

* Recommend runtests-parallel in CONTRIBUTING

* Only inlineSourceMap when debugging through jake-browser (#9080)

* Only inlineSourceMap when debugging through jake-browser

* Address PR: fix typo in opt's property

* Manually port tests from PR 8470

* minor fix: add missing return clause

* Support using string values in enums for CompilerOptions in transpile methods

* Support using string values in enums for CompilerOptions in transpile methods

# Conflicts:
#	tests/cases/unittests/transpile.ts

* Fix test helper

* Add test for out-of-range error

* Fix module loading error

(commandLineOptions_stringToEnum would be undefined if optionDeclarations wasn't loaded yet)

* Use camel-case instead of snake-case (#9134)

* Manually add tests for PR 8988

* Allow wildcard ("*") patterns in ambient module declarations

* Respond to PR comments

* Add another test

* Improve perf

* Improve tests

* Update baseline from merging with master

* Address PR comment

* Update baseline

* Refactor how we retrieve binding-name cache in module transformer

* Temporary accept so we get a clean run-tests result
2016-06-14 11:36:57 -07:00
Ron Buckton ee39c4e8d4 Merge branch 'master' into transforms-merge 2016-05-25 14:14:32 -07:00
Andy Hanson bd633c828f Lint all servicesSources 2016-05-25 06:45:52 -07:00
Ethan Rubio b8692a7fea Fix minor comment grammatical errors
This PR doesn't fix any particular issue. I cleaned up a variety of comment grammatical errors such as missing apostrophes and articles. Further, I made comment formatting more consistent with the rest of the project.
2016-05-18 07:56:45 -10:00
Ron Buckton 3c344987de Merge branch 'master' into transforms 2016-03-18 17:13:55 -07:00
Ron Buckton 5b8cf96028 Moved modifier related flags to separate enum 2016-03-10 11:12:24 -08:00
Josh Soref bb85817d7d spelling fixes for src
Fixes:
* actual
* algorithm
* analyze
* applies
* collapse
* contrast
* definition
* diagnostic
* different
* displayed
* display
* documentation
* finite
* function
* highlight
* initialize
* intentional
* interface
* invariants
* items
* keystroke
* language
* literal
* original
* output
* position
* receive
* recorder
* response
* sequence
* simplicity
* statement

Changing a \ to a /
2016-02-25 20:08:44 +00:00
Ron Buckton 8bf176ac3d Cleanup and reorganization of node tests 2016-02-04 16:41:58 -08:00
Ron Buckton f8e574f1d6 Added ArrayKind, moved createNode, changed JSDocParsing tests to use baselines. 2016-02-04 15:01:31 -08:00
Anders Hejlsberg f0abb86158 Removing MultiLine, Synthetic, DeclarationFile, and OctalLiteral flags 2016-01-31 08:08:19 -08:00
Sheetal Nandi ff00a0c779 Fix breakpoints in object literal pattern destructuring assignment 2015-12-22 16:14:24 -08:00
Sheetal Nandi bda112546f Fix the breakpoint for comma expression 2015-12-22 15:23:45 -08:00
Sheetal Nandi 35537b5f32 Implement breakpoint spans of array destructuring pattern of destructuring assignment 2015-12-22 14:54:21 -08:00
Sheetal Nandi 681e3543d6 Fix the breakpoint spans of call / new expressions 2015-12-21 15:45:28 -08:00
Sheetal Nandi 843bdbb4bd Fix the breakpoints in For Of destructuring 2015-12-21 13:01:21 -08:00
Sheetal Nandi 4e702e5771 Implement breakpoints in paramters with destructuring binding pattern 2015-12-21 11:39:05 -08:00
Sheetal Nandi adcc685456 Fix the array binding pattern breakpoint span of variable declaration statement 2015-12-17 16:41:34 -08:00
Sheetal Nandi c25bfe57c6 Support for breakpoint spans in object binding pattern 2015-12-17 16:31:18 -08:00
Sheetal Nandi 83e569e6c3 Breakpoints on the node with decorator should start at actual syntax and not from decorators 2015-11-19 16:48:41 -08:00
Sheetal Nandi 858a99b4f1 Setting breakpoint inside decorator expression results in setting breakpoint on all the decorators
On resolution, this would be call to __decorate
2015-11-19 16:48:37 -08:00
Vladimir Matveev b62ef0d452 initial revision of reachability checks in binder 2015-09-14 13:56:23 -07:00
Arthur Ozga 1d5dcf0d0c changes that are non-breaking 2015-06-16 15:39:34 -07:00
Mohamed Hegazy 224e7630ea use namespaces instead of modules in the codebase 2015-06-12 09:01:48 -07:00
Daniel Rosenwasser 9460fb580d Use 'lastOrUndefined' where appropriate in the services layer. 2015-05-01 18:34:37 -07:00
Jason Freeman 4487fa426b Rename iterator property of ForStatement to incrementor 2015-04-22 13:29:50 -07:00
Mohamed Hegazy 13ef271831 use @internal comment consistenlly 2015-04-10 16:32:02 -07:00