Configure IntelliJ Ultimate to understand ES6 Syntax - intellij-idea

I'm using Intellij Idea Ultimate 2019.1 for an AngularJS Project. Whenever I use ES6 syntax within my project, like declaring a const variable, IntelliJ puts a red underline under const with the message:
JSHint: 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). (W104)
How do I follow the suggestion so the IDE understands ES6 syntax and no longer shows me those warnings?

You can disable it in Settings | Languages & Frameworks | JavaScript | Code Quality Tools | JSHint or you can attach .jshintrc to your project and add this
{
"esversion": 6
}
Hope it helps.

Updated setting:
Settings | Languages & Frameworks | JavaScript | Code Quality Tools | JSHint | Enforcing Options:
Warn about incompatibilities with the specified ECMAScriptversion: [add 6 here]

Related

App failed to compile for web if the library is only supported for iOS and Android but not for web

I'm using a library called react-native-modals which is supported only for iOS and
Android and is working fine on both platforms. But when I run the app on web, it fails
to compile:
/node_modules/react-native-animatable/createAnimatableComponent.js
SyntaxError: /home/rohits/RR/React-native/typtap-policyholder-web-
mobile/node_modules/react-native-animatable/createAnimatableComponent.js: Support for
the experimental syntax 'jsx' isn't currently enabled (599:9):
597 |
598 | return (
> 599 | <Animatable
| ^
600 | ref={this.handleRef}
601 | style={[
602 | style,
Add #babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel
config to enable transformation.
If you want to leave it as-is, add #babel/plugin-syntax-jsx (https://git.io/vb4yA) to
the 'plugins' section to enable parsing.
Compilation errors occur even if I use other libraries which are not supported on web.

Kotlin incompatible when creating Micronaut command line applications

Whenever I attempt to create a command line app with Micronaut and Kotlin using:
mn create-cli-app cli2 --features kotlin
I get the following warning:
| Warning The following features are incompatible with other feature selections and have been removed from the project
| kotlin
The generated project has fallen back to Java, which is very graceful.
Is this a "bug" or current expected behaviour?
For selecting the language (java, groovy or kotlin) it is better to use the --lang flag instead of --features.
Doing:
$ mn create-cli-app mycli --lang=kotlin
| Generating Kotlin project...
| Application created at /tmp/mycli
Works as expected.

Error running scratch file in IntelliJ 15

Code:
I get the following when running it:
Reference:
https://www.youtube.com/watch?v=AmeDNZ-86ig
Settings (did not change anything here):
Got a solution see record "Eugene Zhuravlev 18 Feb 2016, 16:29" here: https://youtrack.jetbrains.com/issue/IDEA-140228?replyTo=27-1304218
Seems like under mac IDEA's custom SDK home points to "IntelliJ IDEA 15.app/Contents" instead of "IntelliJ IDEA 15.app/Contents/Home".
As a workaround please define a project JDK in Project Structure | Project Settings | Project

Getting started with VS213 + dojo + Typescript

I have a dojo (1.10) widget in VS2013. I'd like to start using Typescript. What do I need to configure? I've installed dojo.d.ts from NuGet
Still get red squiggly and "Cannot find name define"
Cannot find name define
You shouldn't need to use define (from requirejs) with TypeScript. TypeScript includes support for AMD compilation as a flag (--module amd).
More: https://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1

typescript export = module

I see almost all definitions of libraries use the expression export = module. My IDE intellij idea of ​​an error in the syntax. For example, in express difinitions
declare module "express" {
function express(): Express;
module express {
...
...
...
}
export = express;
}
Webstorm / IntelliJ-Idea only support TypeScript 0.8.x syntax at the moment. The export = express; syntax was introduced in typescript 0.9.0 which is why you are getting the syntax errors.
If you want to use Webstorm design time features, You can grab the old definitions from the 0.8.x branch on DefinitelyTyped : https://github.com/borisyankov/DefinitelyTyped/tree/0.8
Alternatively you can use Visual studio 2012.
IntelliJ 12 only supports TypeScript 0.8.
You can download the EAP version for IntelliJ from http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP where they added support for TypeScript 0.9 features.