atom-typescript | The only TypeScript package you will ever need | Chat library
kandi X-RAY | atom-typescript Summary
kandi X-RAY | atom-typescript Summary
JavaScript developers can now just open a .ts file and start hacking away like they are used to. No grunt, no Visual Studio. Just pure coding. NOTE: When updating to v12, make sure language-typescript core package is enabled. We're discontinuing our own grammar in favor of language-typescript. Both are very similar and are basically Microsoft's TextMate grammar repackaged, and there's little reason to bundle our own if there's one available by default. NOTE: This branch contains a major rewrite (v11) of the atom-typescript plugin that is lighter and faster, but lacks a few major features that you might miss. The previous version is still available in the legacy branch and will continue to receive minor bugfixes. However, I wouldn't count on any new developments for that version.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of atom-typescript
atom-typescript Key Features
atom-typescript Examples and Code Snippets
Community Discussions
Trending Discussions on atom-typescript
QUESTION
I have made an angular 1 project with typescript using this yeoman generator: https://github.com/FountainJS/generator-fountain-systemjs
It uses SystemJS and jspm to get dependencies but npm for type definitions (using DefinitelyTyped repository).
I have been struggling these last few days trying to import moment type definitions.
I have installed moment using jspm, and i have discovered that it comes with its own type definitions, so if you call the command npm install @types/moment --save-dev
you only get a stub and a deprecation warning
This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!
Now, i don't know if it's my editor, project or typescript settings or really a typescript issue, but i can't seem to be able to properly import moment's type definitions.
if i do either import moment from 'moment';
or import * as moment from 'moment';
i get this error on my editor (atom with atom-typescript, but i have the same error on Visual Studio Code) Cannot find module 'moment'.
Despite this error, when i build my application it works fine (calling moment functions works).
I have tried a lot of solutions i found on the internet (apparently, importing type definitions from moment is a common issue) but none worked.
Yesterday I managed to make it work by manually creating the directory moment
inside node_modules/@types
and put moment.d.ts
inside it (i had to rename it index.d.ts
though).
Since i didn't really like this solution, i wanted to at least create a types folder i could put stuff into without having to modify node_modules
structure. So i created a folder custom-types
and put the moment
folder with types definitions there, then added custom-types
into tsconfig.json
, i thought this would've worked fine but actually the error reappeared...
Now i'm out of ideas, and i don't really know what else to try.
This is my current tsconfig.json
(in the last attempt to make things work i have added the custom-types
folder with different paths, although it's on the same level as the node_modules
folder and tsconfig.json
file)
ANSWER
Answered 2017-Apr-15 at 22:58I've been using moment
in TypeScript (IntelliJ) with no extra work to install typings for it.
Here's the relevant configuration:
- Inside
tsconfig.json
:"moduleResolution": "Node"
- No
"types"
section at all
./package.json
has no@types/moment
- Inside
./node_modules/moment/
:./moment.d.ts
exists./package.json
has"typings": "./moment.d.ts"
./package.json
is"version": "2.14.1"
When I switch back to "moduleResolution": "Classic"
, TypeScript says cannot find module 'moment'
. So that is probably the culprit.
QUESTION
How can I exclude typescript files from being transpiled but still ensure that they work properly with the linter in the Atom editor?
I'm getting this error in my *.spec.ts
files:
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your
--lib
option.
The problem occurs because I'm explicitly excluding the directory with all of my test files (see the tsconfig file below), because I don't want these files to be transpiled to JavaScript when I build the project. However, I do want these files to be properly linted by the tslint plugin while I'm viewing them in the Atom editor.
My setup:
- Atom.io 1.30 with plugins:
- atom-typescript 12.6.3
- language-typescript 0.4.0
- linter-tslint 1.9.1
- tslint 5.9.1
- typescript 3.0.1
My tsconfig.json
file:
ANSWER
Answered 2018-Sep-15 at 02:47You'll need to use two tsconfig.json
files, one for the editor (which includes the *.spec.ts
files) and another for compilation (which excludes them). You can use extends
to share most of the options between the two files. See this discussion.
QUESTION
I have begun using the Atom editor with the atom-typescript package on an existing project, and I am encountering this warning.
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
I cannot seem to figure out how to do this. I tried adding "experimentalDecorators": true
to the compilerOptions
in ~/.atom/packages/atom-typescript/lib/tsconfig.json
but this did not help. What can I do to get rid of the warning?
ANSWER
Answered 2017-Jun-23 at 15:19In order to configure a particular project's TypeScript compiler settings, you need to create a tsconfig.json
in the root directory of that project, like so:
QUESTION
More specifically: how can I choose which order packages' autocomplete suggestions are displayed in?
Here is an example of autocomplete+'s suggestions when using the atom-typescript package:
and one when not:
I want the if
snippet shown in the latter image to also come first when using other packages such as the aforementioned typescript package.
I know that "suggestions are calculated using fuzzaldrin", but also that the scoring is customizable to an extent using atom's config.cson
file through the useAlternateScoring
property among others.
ANSWER
Answered 2017-Feb-11 at 08:58autocomplete-plus currently doesn't have the ability for the user to manually influence the order in which items are sorted. - leedohm, moderator at atom discuss. (source)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install atom-typescript
Install atom.
Install dependencies (see below).
apm install atom-typescript (apm needs git in your path).
Fire up atom. Open a TypeScript file.
linter
linter-ui-default
hyperclick
intentions
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page