Folder templates for VS Code and Webstorm
VScode - Folder templates
Webstorm - File and Code Templates
- Opprett template files. Én hovedfil med noen sub-files
Create main file
Name: component folder
Extension: tsx
File name: $NAME/$NAME
import React from 'react';
import classes from './${NAME}.module.css';
interface ${NAME}Props {
}
export const ${NAME} = ({ }: ${NAME}Props) => {
return (
<div className={classes.root}>
</div>
)
};
Create a child template file
File name: $NAME/index
Extension: ts
export {${NAME}} from './${NAME}';
And a css file
File name: ${NAME}/${NAME}.module
Extension: css
.root {
}
Stygg error med nested template files: Navn forsvinner helt uten videre!!
Issue: https://youtrack.jetbrains.com/issue/IDEA-279811/File-template-file-name-is-removed