How to create a multi-factor template in PhpStorm (or WebStorm)?

I need 2 files to create a new component in React:

$ {NAME} .js

import React from 'react'; import css from './${NAME}.css'; const ${NAME} = () => ( <div></div> ); export default ${NAME}; 

$ {NAME} .css

 /* Empty */ 

Note: $ {NAME} must be entered as a constant when creating these files.

I would like to use the file template function (or some other simple way) to create both files - only to create a component, for example, in the image below:

Example

Is something like this possible?

+5
source share
1 answer

As far as I know, this is not possible ... unless you yourself code the plugin for this.

https://youtrack.jetbrains.com/issue/IDEA-91565 - look at this ticket (star / vote / comment) to receive notification of any progress.

This duplicate ticket asked the same thing ... only for Angular.


Some links if you are thinking of coding it yourself:

+7
source

Source: https://habr.com/ru/post/1259559/


All Articles