This article will guide you through how to add SPCAF analysis from gulp and Visual Studio Code.
Note: This functionality is meant for use with SharePoint Framework projects.
Running SPCAF analysis of your SharePoint Framework project from gulp and Visual Studio Code allows you to stay productive and easily check if there are any issues in your project. If any issues are found you can quickly fix them.
Before you can run SPCAF analysis of your SharePoint Framework project from gulp or Visual Studio Code you need to install the SPCAF Yeoman generator. Using the SPCAF Yeoman generator you can add support for running SPCAF analysis from gulp and Visual Studio Code to your existing SharePoint Framework project.
To install the SPCAF Yeoman generator in the command line execute:
npm install generator-spcaf --global
This will install the SPCAF Yeoman generator on your computer and make it globally available for use across the different SharePoint Framework projects.
To add support for running SPCAF analysis from gulp and Visual Studio Code in the command line change the working directory to your SharePoint Framework project and then execute:
In the prompt verify that the listed path is where you have installed SPCAF. If you have installed SPCAF in a different location specify your own path instead.
During the installation process, the generator will update the following files:
Before modifying these files, the generator will create a backup copy in case you want to revert the files to their previous state.