Forum Discussion
Ivan Steblenko
Jan 16, 2018Copper Contributor
SPFx coding guidelines
Morning everyone,
We are in the middle of process of preparing migration our logic from typicall react components (React, Typescript and so on) to SPFx components and we are trying to make them...
Jan 21, 2018
TSLint rules is really up to you, but I would stick to the ones that come with SPFx solutions instead of using the ones you mentioned.
TSLint config files are created inside the Config folder on SPFx solutions, so if you are using TSLint extension for VSCode it will not work by default. I have created a blog post with a simple workaround if you need this scenario to work: https://joelfmrodrigues.wordpress.com/2017/12/06/tslint-spfx/
Regarding component structure, it's again up to you. I personally prefer to have multiple files with small blocks of code than having a long file with multiple entities. I find it easier to maintain.
There's really no right or wrong answer here. Give both a try and pick the one that you feel better with :)
TSLint config files are created inside the Config folder on SPFx solutions, so if you are using TSLint extension for VSCode it will not work by default. I have created a blog post with a simple workaround if you need this scenario to work: https://joelfmrodrigues.wordpress.com/2017/12/06/tslint-spfx/
Regarding component structure, it's again up to you. I personally prefer to have multiple files with small blocks of code than having a long file with multiple entities. I find it easier to maintain.
There's really no right or wrong answer here. Give both a try and pick the one that you feel better with :)