212 Commits

Author SHA1 Message Date
Andy
680bfbb705 Combine moduleHasNonRelativeName with isExternalModuleNameRelative (#16564) 2017-07-13 13:46:04 -07:00
Mine Starks
fd2dd2edc0 Merge pull request #17078 from minestarks/removeimportfix
Code fix to remove unused named import should preserve default import
2017-07-13 10:53:35 -07:00
Andy
69d3ca774a When adding completions for a module, don't get the type of the module if not necessary. (#16768)
* When adding completions for a module, don't get the type of the module if not necessary.

* Use SymbolFlags.Module alias
2017-07-13 09:20:40 -07:00
Mine Starks
3915d46913 Fix case where we can return [undefined] 2017-07-11 15:10:04 -07:00
Mine Starks
80b64de1e4 Fix comment behavior in remove unused named bindings 2017-07-11 14:53:08 -07:00
Mine Starks
bb063f1b5c Remove incorrect comment 2017-07-11 14:52:48 -07:00
Mine Starks
39e4b1f9e3 Code fix to remove unused import should preserve default import 2017-07-10 14:23:18 -07:00
Andy
e7dc2a67ca Enable "object-literal-shorthand" lint rule (#16987) 2017-07-07 07:26:58 -07:00
Wesley Wigham
4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
t_
51fb7e9a81 Add alwaysStrict option (#16562)
* Add alwaysStrict option

* Enable alwaysStrict

* Fix for strict mode

* keep whitespace
2017-06-28 19:44:15 -07:00
Arthur Ozga
b9885eed5a Only add underscore in
* for-in
* for-of
* parameters
2017-06-08 18:43:02 -07:00
Arthur Ozga
ce5f7072a1 prefix identifiers 2017-06-06 15:23:10 -07:00
Arthur Ozga
f17a612de8 rename codeFix 2017-06-06 13:13:46 -07:00
Arthur Ozga
c179d9a22d Merge pull request #16045 from aozgaa/codeFixAddMissingMethod
Code fix add missing method
2017-06-05 16:50:46 -07:00
Andy
8ace7b826f importFixes: Support missing "React" at a JSXOpeningElement (#16066)
* importFixes: Support missing "React" at a JSXOpeningElement

* Fix nextLineRule linting

* Rename to resolveJsxNamespaceAtLocation

* Expose getJsxNamespace and resolveNameAtLocation separately
2017-06-05 14:23:39 -07:00
Arthur Ozga
2fb9ab798c repond to feedback 2017-06-01 16:06:53 -07:00
Arthur Ozga
c1d466a716 suppress type annotations in js file 2017-06-01 14:12:25 -07:00
Arthur Ozga
f2163fecbd use length helper 2017-06-01 11:09:08 -07:00
Arthur Ozga
5030d0f468 Use factory for all fixes 2017-06-01 10:49:08 -07:00
Arthur Ozga
21fc30f69b Add support across files and static, js methods 2017-05-31 17:41:35 -07:00
Arthur Ozga
f56be99b11 cleanup 2017-05-23 13:51:00 -07:00
Arthur Ozga
15c029189c testing 2017-05-23 13:32:41 -07:00
Arthur Ozga
420279b99d add missing method 2017-05-23 13:06:15 -07:00
Arthur Ozga
567b10d71c Merge pull request #15545 from aozgaa/atTypesPrefixAndImportSuffix
At types prefix and import suffix
2017-05-22 16:53:04 -07:00
Andy Hanson
dc40f5d6b9 Merge branch 'master' into jsdoc 2017-05-17 07:17:32 -07:00
Andy Hanson
38784b761a Support for JSDoc in services 2017-05-15 14:45:30 -07:00
Arthur Ozga
62dbf12825 Merge branch 'master' into typeToStringViaTypeNode 2017-05-12 13:09:43 -07:00
Nathan Shively-Sanders
3768daeeca Merge pull request #15594 from Microsoft/get-name-of-declaration-wrapper
Get name of declaration uniformly, even for JS-style assignment declarations.
2017-05-10 08:08:07 -07:00
Nathan Shively-Sanders
370b5618a0 Merge branch 'master' into spelling-correction 2017-05-09 10:01:03 -07:00
Nathan Shively-Sanders
0080c5fd66 Merge branch 'master' into get-name-of-declaration-wrapper
This PR included a fix that I already checked in this morning.
2017-05-08 15:39:57 -07:00
Ron Buckton
47bd4d3a87 Merge pull request #15531 from Microsoft/moreFactoryFuncs
More factory functions
2017-05-08 12:05:05 -07:00
Nathan Shively-Sanders
d35f6c3581 getNameOfDeclaration uniformly, including JS decls
JS-style assignment declarations have a name, but it's not stored on the
name property of the BinaryExpression. This commit adds
`getNameOfDeclaration` to uniformly get the name of a declaration.

It also reworks the declaration of `Declaration` so that accessing
`name` is an error unless the type does *not* include
BinaryExpression.
2017-05-04 16:12:54 -07:00
Arthur Ozga
384d54603f Basic parens handling and stubbed TypeFormatFlags 2017-05-04 15:27:50 -07:00
Nathan Shively-Sanders
9eaf40bded Merge branch 'master' into spelling-correction 2017-05-03 15:34:32 -07:00
Arthur Ozga
0b68b934ef respond to comments 2017-05-03 13:30:53 -07:00
Arthur Ozga
5ce32ccbe3 factor out helpers + cleanup startsWith and friends 2017-05-03 13:13:28 -07:00
Arthur Ozga
f2e5fa5bd1 Merge branch 'master' into atTypesPrefixAndImportSuffix 2017-05-02 17:29:32 -07:00
Arthur Ozga
5444f3cbd4 handle @types and scoped @types 2017-05-02 17:19:14 -07:00
Arthur Ozga
4c0735218e move import getCodeActions into named method 2017-05-02 15:52:17 -07:00
Ron Buckton
d37426d865 Fill out remaining factory functions 2017-05-01 13:40:47 -07:00
Nathan Shively-Sanders
1bff5b749e Codefix:suggest spellings+update others w/new codes 2017-05-01 11:41:01 -07:00
Andy Hanson
3590048d9b unusedIdentifierFixes: Factor out nested switch statements and fix implicit fallthrough 2017-05-01 09:37:07 -07:00
Arthur Ozga
cddccf1f43 Merge branch 'master' into typeToStringViaTypeNode 2017-04-19 10:48:38 -07:00
Andy Hanson
455492d887 Merge branch 'master' into fallthrough 2017-04-18 09:48:21 -07:00
Arthur Ozga
cbbf6f8847 Merge branch 'master' into tripleEquals 2017-04-17 15:57:51 -07:00
Andy Hanson
a82ac45e36 Merge branch 'master' into fallthrough 2017-04-12 10:58:03 -07:00
Andy Hanson
ed5eca2b7b boolean-trivia lint rule: Enforce space between comment and argument 2017-04-11 09:44:58 -07:00
Ryan Cavanaugh
d8a24e3a5b Merge pull request #15021 from RyanCavanaugh/lintFixes
Update linting to avoid typechecking for booleanTriviaRule
2017-04-05 12:26:58 -07:00
Arthur Ozga
3bdec6943e Merge branch 'master' into tripleEquals 2017-04-05 11:51:21 -07:00
Ryan Cavanaugh
e3bb5d3f28 Update linting to avoid typechecking for booleanTriviaRule 2017-04-04 22:34:51 -07:00