Andrew Connell

Fix the "can't find custom rule directory: tslint-microsoft-contrib" error in SPFx projects

Learn how to resolve the error: "[tslint] Failed to load ../tslint.json: Could not find custom rule directory: tslint-microsoft-contrib"

Recently, when I was rebuilding all the projects in my Mastering the SharePoint Framework course to the latest version of the SharePoint Framework (SPFx) v1.12.1, I kept running into a random error. It didn’t happen all the time which made it not just annoying, but a pain trying to figure out the root cause.

It appears it’s just a random oddity that happens on occasion without a good explanation as to why. But the good news is that it’s easily fixed.

In this post, I’ll explain the problem as well as how to fix it.

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.