My goal is to write clean and readable code. The least I can do is make sure it’s formatted correctly. One of my favorite Visual Studio plugins is called Prettier. I use that plugin to make sure everything is formatted consistently throughout my code. My biggest issue is that it adds semicolons to every single function.
![](https://i0.wp.com/thomasdaly.net/wp-content/uploads/2019/07/image.png?resize=521%2C89)
But it doesn’t treat all functions equal.
![New call-to-action](https://i0.wp.com/no-cache.hubspot.com/cta/default/2571206/b025fd41-70e1-4e27-8b92-5cca2a7ca8b9.png?resize=668%2C240&ssl=1)
![](https://i0.wp.com/thomasdaly.net/wp-content/uploads/2019/07/image-3.png?resize=423%2C190)
The SPFx tslint rules don’t like that.
![](https://i0.wp.com/thomasdaly.net/wp-content/uploads/2019/07/image-1.png?resize=668%2C308)
Prettier has the option to enable / disable semicolons at the end of every statement. Disabling that setting takes away all the semicolons from all lines. I like to have semicolons after each statement.
You could disable the semi-colon check in SPFx project’s tslint.json file
![](https://i0.wp.com/thomasdaly.net/wp-content/uploads/2019/07/image-4.png?resize=668%2C270)
OR you could edit your gulpfile.js and add suppression to prevent the message.
![](https://i1.wp.com/thomasdaly.net/wp-content/uploads/2019/07/image-5.png?fit=1024%2C357)
The build.AddSuppression will accept a string or a regex. You can see here I’ve added a regex value to suppress errors that end with ‘error semicolon: Unecessary semicolon”
Either way works for me – no more semicolon warnings!
![](https://i1.wp.com/thomasdaly.net/wp-content/uploads/2019/07/2019-07-15_14-38-32.jpg?fit=1024%2C660)
Thank you so much for posting such an amazing and helpful post. All Your shares and post gives a perfect direction for developers 🙂