Your helper for writing modern, clean and concise codeThe P42 JavaScript Assistant adds 84 automated refactorings and actions for JavaScript, TypeScript, React, and Vue to Visual Studio Code. You can find the actions in the quick fix and refactoring context menus. They depend on the cursor position, the selected text (if any), the source code, the language type, and any available type information. Underlining with three dots suggests beneficial refactorings that you can perform. The P42 sidebar shows you suggested refactorings for your whole file. DocumentationCode Assists by CategoryCode assists that belong to several categories appear more than once. Core RefactoringsVisual Study Code already contains basic refactorings such as Rename and Extract Function. The P42 JavaScript Assistant adds additional refactorings or extended functionality such as safety checking:
Code Assists for ReactIn React, components often contain JSX, a syntax extension for JavaScript. P42 provides code assists that make working with JSX and React easier:
Code Assists for Logical ExpressionsBoolean logic can be challenging to read, especially as expressions get more complex. P42 provides several refactorings that can help you simplify and tease apart logical expressions to make them easier to understand:
Code Assists for Branching StatementsBranching statements such as if-else and switch are central elements in many programs. Restructuring them can increase the readability of your programs, often in combination with refactoring their conditions:
Code Assists for Arrays and Loops
Code Assists for Functions and Methods
Code Assists for Strings and Template Literals
Code Assists for Variables
Code Assists for Syntax ConversionIt is often annoying to make small syntactical changes by editing text. Often more than one position needs to be edited, and the code is broken during the edit, leading to incorrect errors and auto-completions that get in the way. You can execute the following syntax conversions with code assists:
ECMAScript ModernizationsThe Javascript ecosystem is progressing rapidly. However, it is hard to keep codebases up-to-date with the newer JavaScript features, and codemods are not always an option due to their significant churn and potential for breakages. P42 supports both codemod-like mass code refactoring and more opportunistic code modernization for the following upgrades:
Lodash Modernizations
Code CleanupsCode cleanups remove unnecessary code. Such code can result from code churn, e.g., by applying other refactorings, adding new features, or fixing bugs. P42 shows hints and automates the cleanup for the following situations:
Other Code Assists
Report Bugs and Suggest FeaturesPlease report any bugs or feature suggestions in the P42 JavaScript Assistant issue tracker. License & Used Open Source LibrariesSee DISCLAIMER.txt. |