JetBrains Rider 2017.2 Help

JavaScript

With JetBrains Rider, you can develop modern web, mobile, and desktop applications with JavaScript and Node.js. JetBrains Rider supports JavaScript and TypeScript programming languages, React and Angular frameworks and provides tight integration with various tools for web development.

On this page:

JavaScript support

JavaScript files are marked with viewAsJSON icon. JavaScript support in JetBrains Rider includes:

  • Switching between JavaScript language versions:
  • Full coding assistance:
    • Smart code completion for keywords, labels, variables, parameters, user-defined or built-in functions, and JavaScript namespaces.
    • Error and syntax highlighting.
    • Code formatting and folding.
    • Numerous code inspections and quick-fixes.
    • Support of the strict mode standard.
  • Code Generation
    • Generating code stubs based on file templates during file creation.
    • Inserting, expanding, and generating JavaScript code blocks using live templates.
    • Creating various applications elements via JavaScript and AJAX intention actions.
    • Ability to create line and block comments (Ctrl+Alt+//Ctrl+Shift+/).
    • Unwrapping and removing statements.
  • Refactoring, both JavaScript-specific and available for all the supported languages.
  • Numerous ways to navigate through the source code, among them Navigating with Structure Views, Show/Goto Implementation (Alt+End) from overridden method / subclassed class, etc.
  • Advanced facilities for searching through the source code.
  • Support of the JSDoc format and generating documentation comments.
  • Viewing reference information:
  • Running and debugging.

    • Debugging JavaScript applications running on the built-in server or on an external server.
    • A dedicated Firefox Remote debug configuration for debugging JavaScript in Firefox.
    • A JavaScript-aware debugger that lets you execute applications step by step, evaluate expressions, examine related information and find runtime bugs.
    • Support for JavaScript breakpoints.
  • Tight integration with related frameworks and technologies.
  • Support for the JSON (JavaScript Object Notation) format:
    • A JSON file type template mapped to json file extension.
    • JSON code formatting and folding.

Developing an application that contains JavaScript: general overview

Developing an application that contains JavaScript, generally, includes performing the following steps:

  1. Create a project to implement your application.
  2. On the JavaScript page of the Settings dialog box, choose the JavaScript language version that you are going to use in your project.
  3. Install the project dependencies via the Node Package Manager by doing one of the following:
      1. Open the Settings/Preferences by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or JetBrains Rider | Preferences for macOS, and click Node.js and NPM under Languages & Frameworks.
      2. On the Node.js and NPM page that opens, the Packages area shows all the Node.js-dependent packages that are currently installed on your computer, both at the global and at the project level. Click new.
      3. In the Available Packages dialog box that opens, select the required package.
      4. Optionally specify the product version and click Install Package to start installation.
    • Right-click the package.json file in the editor or in the Project tool window and choose Run 'npm install' on the context menu.
    • Open the built-in Terminal (View | Tool Windows | Terminal) and run the npm install <required_package> commands.
    • Install the required packages on the Node.js and NPM page of the Settings/Preferences.

    For details, see NPM.

  4. Populate the project. Use the following JetBrains Rider facilities, where applicable:
  5. Improve the quality and maintainability of your code using various types of refactorings, built-in code quality tools, and integration with other linters, see JavaScript Linters.
  6. Run your application by opening its starting HTML page in the JetBrains Rider default browser.
  7. Debug your application in the Google Chrome browser.

    The JavaScript debugging functionality is incorporated in JetBrains Rider, so just configure the debugger, whereupon you can start the debugging session and proceed as usual: set the breakpoints, step through them, stop and resume the program, and examine it when suspended.

Last modified: 27 December 2017