Phpstorm React

Posted : admin On 1/3/2022
Phpstorm react native
  1. React Native Open Source Project
  2. Phpstorm Reactions
  3. Phpstorm Active Server
  4. Phpstorm React Support
  5. Phpstorm Reactor
Skip to end of metadataGo to start of metadataActive

What is better PhpStorm or WebStorm? Comparing products to get the best IDE Software does not always have to be hard. On our review platform, you can easily match PhpStorm and WebStorm and immediately evaluate their differences. We allow you to examine their capabilities, supported devices, customer support, prices, terms, plus more. Since PhpStorm is a flavor of Intellij IDEA, many of our recommended plugins are compatible with other flavors of the IDE as well. That said, our chart of top plugins and extensions for PhpStorm includes the plugins essential to effective and productive use of PhpStorm specifically. Top Essential Intellij PhpStorm Plugins. PHP Annotations.

PHP InspectionsBugWI-58588False positive 'Condition is never matched' in match expression when one of inferred types of match argument is empty or mixed
Plugin: Deployment _ FTP..BugWI-57672Change help tooltip in deployment options
Code Analysis. DuplicatesBugIDEA-255779Code duplicates in headless mode does not work in IntelliJ IDEA 2020.2.3
Core. IDE SettingsFeatureIDEA-247100Sync IDEA platform SDKs with those installed by asdf-java
BugIDEA-255402'Default project directory' setting is ignored
Core. IndexingBugIDEA-259783shared-indexes: unload exception in JDKs
Core. InstallationExceptionIDEA-257865CCE at com.intellij.database.actions.AddDataSourceFromPath$1.<init>
Core. Navigation and SearchBugIDEA-259121'Go to File' shows a lot of directories first but no files
Core. Password ManagementBugIDEA-258912OSX Keychain is not available on Apple ARM chips (aarch64)
Core. Project SettingsBugIDEA-260248Project Structure dialog: changes in module name aren't applied if module dependencies were changed at the same time
BugIDEA-262628Trusted host is not recognized if recorded with protocol
BugIDEA-260145Cannot rename module with custom (i.e. non project-default) JDK
BugIDEA-260512Android facets are gone
BugIDEA-249398Persistent AddDiffException on project open after quitting IDEA
PerformanceIDEA-252694Freeze during processing changed project configuration files
CosmeticsIDEA-263464The 'trust host' checkbox label in the Trust And Open Gradle/Maven Project dialog
Core. Run. ConfigurationsBugIDEA-261259Alternative coverage runner option disappears at reopening
BugIDEA-256715'Repeat N times' option in JUnit run configuration is shown twice
BugIDEA-256734Invalid got it tooltip for 'Repeat N times'
BugIDEA-259609'<no module>' can not be selected
BugIDEA-261930Run configuration's working directory disappeared after setting it to an empty value
CosmeticsIDEA-260033[new run config UI] extra artifacts on 'Got it' tooltip
Core. Run. TargetsBugIDEA-258084Run Targets: JUnit: attempt to run 'all in package' run configuration fails with SSH target
Editor. Diff and MergeBugIDEA-257651Diff view detects big diff but change was only small
Lang. MarkdownBugIDEA-258796Unnecessary backslash escape in triple-backticked bash block
Lang. XPath and XSLTBugIDEA-207408XSLT debugger broken on Java 9+
Tools. DockerBugIDEA-259303Docker. Settings on the Tools page are wrong red marked
BugIDEA-259400Log spamming by Docker integration when host is not available anymore
User InterfaceBugIDEA-255506Inline debugger dialog incorrectly sized on Ubuntu
BugIDEA-257834Cannot open cloned project while another one is being opened
User Interface. Embedded Browser (JCEF)BugIDEA-259096JCEF: window.cefQuery_XXXXXX_XX is not a function for query created after the browser is shown
User Interface. FocusBugIDEA-259513Extra editor tab lose focus when switch between source/header
User Interface. GraphicsUsabilityIDEA-256044Close All But Pinned Broken / Missing
Version ControlBugIDEA-169090Wrong highlighting of copy-pasted fragment in editor gutter
BugIDEA-251317Viewing a diff from 'Apply Patch' dialog sometimes shows a weird error
Version Control. GitBugIDEA-251265Search everywhere doesn't find action Annotate with Git Blame by request 'git blame'
BugIDEA-253049Git Staging Area: 'Delete Files from Git' dialog shouldn't pop up on deleting unversioned files
BugIDEA-257461Missing arrows in stash camper window
Version Control. LogUsabilityIDEA-254354Branch list doesn't focus item on right click
DB IntrospectionBugDBE-12264Code: 417, e.displayText() = DB::Exception: Expected ANY or ALL in JOIN section, because setting (join_default_strictness) is empty, e.what() = DB::Exception
TaskDBE-12513Error while introspecting H2 database: Syntax Error
DB RefactoringBugDBE-12422Renaming MySQL JSON column with default value
SQL CompletionExceptionDBE-12561Throwable at com.intellij.sql.psi.impl.SqlImplUtil.quoteIdentifier
SQL HighlightingFeatureDBE-12473Better highlighting in Run Configurations
FeatureDBE-12470Support MariaDB Compound Statements outside of Stored Programs
BugDBE-12492Ambiguous column name isn't reported in qualified with CTE name
BugDBE-12371MariaDB SQL dialect: Incorrect handling of 'FOR SHARE' and 'RETURNING'
BugDBE-12493Incorrect syntax with min_active_rowversion
BugDBE-12528TODO comments ignored in procedure bodies for PostgreSQL
BugDBE-12499Can't pass multiple values in the ROWS FROM clause
BugDBE-12500Can't use type cast inside 'PARTITION OF' clause
BugDBE-12553Analytic functions are marked as error for H2
HTMLBugWEB-36210Allow ARIA accessibility attributes in SVG elements
BugWEB-49001Support data-* attribute in SVG 2.0 files
JavaScriptBugWEB-49156Incorrect syntax error 'yield is not allowed as identifier in strict mode' in a generator function
BugWEB-49307Opening project in new version of IDE changes settings of JavaScriptSettings component in .idea/misc.xml
PerformanceWEB-48983Webstorm 2020.3.x MacOS slow and high CPU compared to 2020.2
TaskWEB-49259Show suggestions from string literals only on Ctrl-Space
JavaScript. FrameworksBugWEB-48038No autocompletion for makeStyles/createStyles
BugWEB-49137Quick fix 'Add import statement' doesn't work for 'React'
BugWEB-49135Incorrect import suggestions for React methods
Unit TestsBugWEB-48569Error debugging Mocha tests run with Vue CLI due to 'Unknown argument: jobs'
BugWEB-49314Cannot debug karma v6 test code (error in karma-intellij-debug.js)

PhpStorm integrates with ESLint which brings a wide range of linting rules that can also be extended with plugins. PhpStorm shows warnings and errors reported by ESLint right in the editor, as you type. With ESLint, you can also use JavaScript Standard Style as well as lint your TypeScript code.

Besides JavaScript and TypeScript, ESLint can be applied to files of other types in the entire project or in its specific parts, see Configure linting scope.

Before you start

React Native Open Source Project

  1. Download and install Node.js.

  2. Make sure a local Node.js interpreter is configured in your project: open the Settings/Preferences dialog Ctrl+Alt+S and go to Languages and Frameworks Node.js and NPM. The Node Interpreter field shows the default project Node.js interpreter.

    Learn more from Configuring a local Node.js interpreter.

Phpstorm React

Install ESLint

  1. In the embedded Terminal (Alt+F12), type one of the following commands:

    • npm install --g eslint for global installation.

    • npm install --save-dev eslint to install ESLint as a development dependency.

  2. Optionally, install additional plugins, for example, eslint-plugin-react to lint React applications.

Activate and configure ESLint in PhpStorm

By default, ESLint is disabled. You can choose to configure it automatically or specify all the configuration settings manually.

Configure ESLint automatically

With automatic configuration, PhpStorm uses the ESLint package from the project node_modules folder and the .eslintrc.* configuration file from the folder where the current file is stored. If no .eslintrc.* is found in the current file folder, PhpStorm will look for one in its parent folders up to the project root.

If you have several package.json files with ESLint listed as a dependency, PhpStorm starts a separate process for each package.json and processes everything below it. This lets you apply a specific ESLint version or a specific set of plugins to each path in a monorepo or a project with multiple ESLint configurations.

  • To configure ESLint automatically in the current project, open the Settings/Preferences dialog Ctrl+Alt+S, go to Languages and Frameworks JavaScript Code Quality Tools ESLint, and select the Automatic ESLint configuration option.

  • To configure ESLint automatically in all new projects, open the Settings for New Projects dialog (File Settings for New Projects), go to Languages and Frameworks JavaScript Code Quality Tools ESLint, and select the Automatic ESLint configuration option.

Configure ESLint manually

With manual configuration, you can use a custom ESLint package, configuration file, and working directories, as well as apply various additional rules and options.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Languages and Frameworks JavaScript Code Quality Tools ESLint, and select Manual ESLint configuration.

  2. In the ESLint package field, specify the location of the eslint or standard package.

  3. In the Working directories field, specify the working directories for the ESLint process.

    By default the field is empty and PhpStorm detects the working directory automatically. First it looks for a directory closest to the linted file which contains a .eslintignore or .eslintrc.* file, or a package.json file with either a eslintIgnore or a eslintConfig property.

    If the auto-detected working directory doesn't match your project configuration, you need to specify the working directory (directories) manually. Use semicolons as separators. The acceptable values are:

    • Absolute paths.

    • Paths relative to the project base directory (the parent folder of the .idea folder where PhpStorm-specific project metadata is stored). For example:

      • ./- use project base directory as ESLint process working directory.

      • client;server- use the <project_base_dir>/client and <project_base_dir>/server as working directories. For files that are neither under the client not under the server folder, the working directory will be auto-detected as described above.

      • packages/*- each subfolder of the <project_base_dir>/packages folder will be used as the working directory for the corresponding linted files.

    • Paths relative to the content roots can be used if some linted files are not under project base directory in the folder hierarchy.

    • Glob patterns that define relative paths to the working directories. For example, with **/foo -* each folder with the name starting with foo- will be used as the working directory for the corresponding linted files.

  4. Choose the configuration to use.

    • Automatic search- select this option if ESLint rules are configured in your a package.json or in a .eslintrc.* file. This can be a .eslintrc, .eslintrc.json, or .eslintrc.yaml file, or a file in another supported format, see the ESLint official website for details.

      PhpStorm looks for a .eslintrc.* file or for a eslintConfig property in a package.json. PhpStorm starts the search from the folder where the file to be checked is stored, then searches in its parent folder, and so on until the project root is reached.

    • Configuration File- select this option to use a custom file and specify the file location in the Path field.

    Learn more about configuring ESLint from the ESLint official website.

  5. Optionally:

    • In the Extra eslint options field, specify additional command-line options to run ESLint with, use spaces as separators.

      Learn more about ESLint CLI options from the ESLint official website.

    • In the Additional rules directory field, specify the location of the files with additional code verification rules. These rules will be applied after the rules from package.json, .eslintrc.*, or a custom configuration file and accordingly will override them.

      See the ESLint official website for more information about ESLint configuration files and adding rules.

Configure linting scope

  1. Open the Settings/Preferences dialog Ctrl+Alt+S, go to Languages and Frameworks JavaScript Code Quality Tools ESLint, and select Automatic ESLint configuration or Manual ESLint configuration.

  2. In the Run for files field, specify the pattern that defines the set of files to be linted. You can accept the default pattern or type a custom one.

    With the default pattern, {**/*,*}.{js,ts,jsx,tsx,html,vue}, ESLint will wake up and process any updated JavaScript, TypeScript, JSX, TSX, HTML, or Vue file. To lint files of other types or files stored in specific folders, use glob patterns to update the default pattern.

    • For example, to automatically reformat CoffeeScript files as well, add coffee to the default pattern as follows:

    • To lint files from a specific folder, replace {**/*,*} with <path to the folder>*.

      Suppose, you have a project with the following structure:

      To lint only the files in the coffee folder, update the pattern as follows:

      coffee/*.{js,ts,jsx,tsx,html,vue,coffee}

      As a result, the file linting.coffee will be linted while no_linting.coffee will not.

Fix problems automatically on save

ESLint can fix the detected problems every time your changes are saved either manually, with Ctrl+S, or automatically, when you launch a run/debug configuration, or close PhpStorm, or perform version control actions, see Autosave for details.

  • Open the Settings/Preferences dialog Ctrl+Alt+S, go to Languages and Frameworks JavaScript Code Quality Tools ESLint, and select the Run eslint --fix on save checkbox.

Lint your code

When installed and enabled, ESLint activates automatically every time you open a JavaScript file.

By default, PhpStorm marks detected problems based on the severity levels from the ESLint configuration. See Configuring ESLint highlighting to learn how to override these settings.

Descriptions of the errors detected in the current file and quick-fixes for them are available from the editor and from the Current File tab of the Problems tool window.

Errors in all previously opened files and quick-fixes for them are shown in the Project Errors tab of the Problems tool window. To open the tool window, click the Inspection widget in the upper-right corner of the editor:

See View problems and apply quick-fixes in the editor and Problems tool window for details.

View problems and apply quick-fixes in the editor

  • To view the description of a problem, hover over the highlighted code.

    To resolve the detected problem, click ESLint: Fix '<rule name>' or press Alt+Shift+Enter.

    To resolve all the detected problems in the current file, click More actions (Alt+Enter) and select ESLint: Fix current file from the list.

    See View problems and apply quick-fixes in the editor for details.

  • Alternatively open the Current File tab of the Problems tool window Alt+6, where you can view problem descriptions, apply quick-fixes, navigate to the fragments in the source code where errors occurred, as well as fix them in the Editor Preview pane without leaving the tool window. Learn more from Problems tool window.

  • You can also configure ESLint to fix all the problems in a file when this file is saved. To configure such behavior, select the Run eslint --fix on save checkbox on the ESLint page of the Settings dialog as described in Activating and configuring ESLint in PhpStorm.

Lint your code in the Problems tool window

To open the Problems tool window, click the Inspections widget in the upper-right corner of the editor.

Alternatively select View Tool windows Problems from the main menu or press Alt+6.

The Project Errors tab shows the errors in all files that were opened during the current session, with error messages grouped by files in which they were detected.

Here you can view problem descriptions, apply quick-fixes, navigate to the fragments in the source code where errors occurred, as well as fix them in the Editor Preview pane without leaving the tool window. Learn more from Problems tool window.

Configure highlighting for ESLint

By default, PhpStorm marks the detected errors and warnings based on the severity levels from the ESLint configuration. For example, errors are highlighted with a red squiggly line, while warnings are marked with a yellow background. See Code inspections and Change inspection severity for details.

Change the severity level of a rule in the ESLint configuration

  • In .eslintrc or under eslintConfig in package.json, locate the rule you want to edit and set its ID to 1warn or to 2error.

    Learn more from the ESLint official website.

You can override the severities from the ESLint configuration so that PhpStorm ignores them and shows everything reported by the linter as errors, warnings, or in a custom color.

Ignore the severity levels from the configuration

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor Inspections. The Inspections page opens.

  2. In the central pane, go to JavaScript Code quality tools ESLint.

  3. In the right-hand pane, clear the Use rule severity from the configuration file checkbox and select the severity level to use instead of the default one.

Phpstorm reactions

Import code style from ESLint

You can import some of the ESLint code style rules to the PhpStorm JavaScript code style settings. That enables PhpStorm to use more accurate code style options for your project when auto-completing, generating, or refactoring the code or adding import statements. When you use the Reformat action, PhpStorm will then no longer break properly formatted code from the ESLint perspective.

PhpStorm understands ESLint configurations in all official formats: .eslintrc JSON files, package.json files with the eslintConfig field, as well as JavaScript and YAML configuration files.

  • When you open your project for the first time, PhpStorm imports the code style from the project ESLint configuration automatically.

  • If your ESLint configuration is updated (manually or from your version control), open it in the editor and choose Apply ESLint Code Style Rules from the context menu.

    Alternatively, just answer Yes to the 'Apply code style from ESLint?' question on top of the file.

    The list of applied rules is shown in the Event log tool window:

Use JavaScript Standard Style

You can set JavaScript Standard Style as default JavaScript code style for your application so its main rules are applied when you type the code or reformat it. Since Standard is based on ESLint, you can also use Standard via the PhpStorm ESLint integration.

Install JavaScript Standard

Phpstorm Reactions

  • In the embedded Terminal (Alt+F12), type:

    npm install standard --save-dev

    Learn more from the JavaScript Standard Style official website.

Enable linting with Standard via ESLint

If you open a project where standard is listed in the project's package.json file, PhpStorm enables linting with Standard automatically.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Languages and Frameworks JavaScript Code Quality Tools ESLint.

  2. On the ESLint page that opens, select Manual ESLint configuration and specify the location of the standard package in the ESLint Package field.

Phpstorm Active Server

Set the JavaScript Standard Style as default

Phpstorm React Support

Phpstorm reactions

Phpstorm Reactor

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor Code Style JavaScript.

  2. On the Code Style. JavaScript page that opens, click Set from, and then select JavaScript Standard Style. The style will replace your current scheme.