Say you want to run / debug a HackerRank solution locally on your WebStorm / IntelliJ Idea IDE for for macOS before submitting it. What are the needed steps, considering node.js is already installed in your machine? Sample Hello.js file as below: Answer On macOS Mojave the steps are: On Preferences > Keymap, add a keyboard shortcut Ctrl+D to run
Tag: webstorm
Why WebStorm show errors in gql query inside apollo object in Vue component or .grapgql files
I have a problem with WebStorm syntax highlighting. I created valid GraphQL query which works on localhost app but WebStorm says that unknown field “familyMembers” on object type “Query” and highlights the whole query in red. I am really confused but maybe I should change something inside apollo.config.js – if yes please tell me what. HelloWorld.vue apollo.config.js Some screenshots: Answer
How to configure eslint indent for WebStorm?
How to set “indent” in .eslintr.json to match the default used in WebStorm? Everything I’ve tried so far, as per the official documentation can’t match it: “indent”: [“error”, 2] – gives many Expected indentation of 2 spaces but found 4 “indent”: [“error”, 4] – gives many Expected indentation of 4 spaces but found 8 “indent”: [“error”, 8] – gives many
Import not working with JavaScript in PhpStorm/Webstorm
I’m trying to run a piece of JavaScript code written in a tutorial that looks like this: main.js However, PhpStorm is giving the following error: Import declarations are not supported by current JavaScript version How I can get a newer(?) JavaScript version in PhpStorm? Is that really the problem here? Answer In your preferences, change the version of javascript to
JSDoc: arrow function params
I’m trying to document my code with JSDoc (EcmaScript 2015, WebStorm 12 Build 144.3357.8). I have an arrow function which I want to document its parameters. This two examples work (I get auto-completion): But when I want to document an arrow function in forEach function, for example, the auto-completion isn’t working (all of the below): Has anyone managed to get
Using chrome extension apis in typescript
I’m building a chrome extension written in TypeScript. I’m using WebStorm and I added the chrome-DefiniteltyTyped library in my project. However, when I write this in my typescript code : chrome.extension.getURL I got an error : cannot find name ‘chrome’. Because of this, my javascript file is not generated and I cannot use it in my extension. Do you guys
How can I setup webstorm to automatically add semi-colons to javascript functions, methods, etc
When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn’t auto-add a semicolon. I know that isn’t required per the standards, etc., but that’s the way that I code – and I’m not alone, many people code this way. Example: Normally, webstorm/phpstorm will do this, and leave the cursor