Makes [ESLint]( available as a tool in [Cake](

#addin nuget:?package=Cake.ESLint&version=3.0.0

dotnet add package Cake.ESLint --version 3.0.0

<PackageReference Include="Cake.ESLint" Version="3.0.0" />


Functions to call eslint.

In order to use this add-in, eslint has to be available.

One option is using Cake.Npm.Module to install ESLint from

Another option is, if you have an npm project setup, to add ESLint to package.json and call NpmInstall() to be sure it is available.


 #addin "nuget:?package=Cake.Npm"
 #addin "nuget:?package=Cake.ESLint"
   .Does(() => {
     // ensure elsint is installed from npm
     NpmInstall(new NpmInstallSettings {
       WorkingDirectory = "src"

     // run lint
     ESLint(x => {
         x.WorkingDirectory = "src2";
         x.Output = "../output.json"; // relative to WorkingDirectory
         x.OutputFormat = ESLintOutputFormat.Json;
         x.ContinueOnErrors = true;
         x.AddDirectory("."); // relative to WorkingDirectory


ESLint(Action<ESLintSettings>) Runs ESLint, using the default settings.
ESLint(ESLintSettings) Runs ESLint, using the given settings.