---
source_url: https://itmustbecode.com/pcf-controls-tips-and-tricks-how-to-skip-linting-at-build-time/
title: PCF Controls Tips and Tricks : How to skip Linting at Build-Time
date: 2025-07-08T01:09:42+00:00
categories:
  - blog
tags:
  - dataverse
  - eslint
  - pcf
word_count: 866
reading_time_minutes: 5
type: posts
---

Have you ever been unable to properly **build** a PCF control because of **linting** errors? Well, lately I have, and it can get really frustrating. Especially when the errors have nothing to do with your code, but are caused by an unexpected failure in the way the PCF framework handles the linting process.

{{< figure src="./image-4.png" alt="" caption="" >}}

Turns out I'm not alone as other members of the PCF community like [Charles Channon](https://www.linkedin.com/in/cchannon/) have recently flagged linting issues with recent `pcf-scripts` releases.

In this post, I’ll show you how I found a way to **skip** linting during the PCF control build process. This keeps you focused on building and deploying your controls, even if the linter crashes.

But while we are at it, let’s talk about what **linting** is and how it’s implemented in PCF projects.

## Linting in PCF controls

In a nutshell, linting is a **static code analysis process** that checks your code for errors, potential bugs, and style violations. By enforcing **coding standards**, it helps catch problems early in the development cycle, and improve overall code quality.

Many projects run linting automatically during builds, commits, and even within the IDE during development to catch issues early.

The **PCF framework** integrates **[ESLint](https://eslint.org/)**, a popular linting tool, into the scaffolded code generated by the `pac pcf init` command. When a PCF project is initialized, a file named `eslint.config.mjs` is added to the project structure.

{{< figure src="./eslint.png" alt="" caption="" width="100px" >}}

{{< figure src="./image.png" alt="" caption="" >}}

The `eslint.config.mjs` file contains a set of **recommended** rules, along with a `rules` section that you can **customize** to your liking. There’s a lot more more to dive into, but that’s beyond the scope of this post.

{{< figure src="./image-2.png" alt="" caption="" >}}

With proper setup in your IDE this will make you editor scream when rules are infringed.

{{< figure src="./image-5.png" alt="" caption="" >}}

In typical TypeScript projects, linting is generally under your control and can be executed on demand. But **in PCF control development**, linting is **baked into the build process**. The `pcf-scripts` package runs ESLint _every single time_ you call `npm run build`.

{{< figure src="./image-3.png" alt="" caption="" >}}

While this setup works well in an ideal world, I’ve occasionally run into **unexpected** crashes during the linting step.

In my experience, these issues rarely relate to actual linting rules. They usually stem from deeper configuration quirks or conflicts with other dependencies. It’s really annoying and makes it impossible to move on.

{{< figure src="./image-9.png" alt="" caption="" >}}

So, let’s look at how we can **separate the linting step from the PCF build**,

## Skipping Linting during PCF Build

With a bit of reverse engineering, I tracked down the part of the `pcf-scripts` package where the linting task is **invoked** during the build.

Located deep in `node_modules\pcf-scripts\tasks\validateTask.js`, I discovered that linting could be skipped if `context.getSkipBuildLinting()` returned `true`. _Looks promising, but how is this property set ?_

{{< figure src="./Capture-decran-2025-06-24-121227.png" alt="" caption="" >}}

I figured out that the **build context** was defined in this file `node_modules\pcf-scripts\buildContext.js`, and found that `getSkipBuildLinting()` gets is value from a configuration switch. _Getting closer..._

{{< figure src="./image-5-1.png" alt="" caption="" >}}

Digging further, I found that the **`context`** object is **configured** in `node_modules\pcf-scripts\buildConfig.js`. _I’m nearly there, I can tell_...

{{< figure src="./Capture-decran-2025-06-24-120230.png" alt="" caption="" >}}

From there, I traced the configuration source to `node_modules\pcf-scripts\constants.js`, where the constant `CONFIGURATION_FILE_NAME` revealed that the settings are loaded from the project’s own `pcfconfig.json`. _BINGO!_.

{{< figure src="./Capture-decran-2025-06-24-120948.png" alt="" caption="" >}}

💡That’s when it clicked— _and I knew I had blog post material on my hands._

Now, by simply adding a line of code to the `pcfconfig.json` and setting **`skipBuildLinting`** to `true`...

{{< figure src="./image-6.png" alt="" caption="" >}}

{{< figure src="./Capture-decran-2025-06-24-121620.png" alt="" caption="" >}}

...we can see that the Linting step gets properly skipped when we build the control. 😎

{{< figure src="./Capture-decran-2025-06-24-121810.png" alt="" caption="" >}}

By doing this, I was able to decouple **linting** from the **build**, and go back to the real development of the control.

Also, like [Charles Channon](https://www.linkedin.com/in/cchannon/) pointed out in the LinkedIn post mentioned earlier, you can still run **EsLint** manually at any time using a command that doesn't rely on the PCF framework. _The best of both worlds!_

```
npx eslint './**/*.{ts,tsx}' --format stylish
```

{{< figure src="./image-8.png" alt="" caption="" >}}

## **TakeAway**

Linting is a powerful tool that helps keep your code clean, consistent, and error-free. It’s important for any serious project. But sometimes, you just need to get things done and can’t afford to be blocked by unexpected linting crashes.

In PCF projects, **linting** is enforced as part of the build by **default**. But, you can **skip** the linting step by adding `"skipBuildLinting": true` to your `pcfconfig.json` file—something that’s not officially documented, but works.

{{< figure src="./SkipLinting.png" alt="" caption="" >}}

You can still run linting **manually at any time** using a standalone command that bypasses the PCF Framework scripts.

Hope this helps!

{{< linkcard url="https://www.linkedin.com/posts/cchannon_pcf-activity-7342178570611425282-HWfF?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAQ8HekBwn3f7gyX_Ed66HLqs2vKnb1dNoI" title="I haven't needed to build a #PCF in a few months, but just initted one and hit a strange error related to the eslint formatter. | Charles Channon" summary="I haven't needed to build a #PCF in a few months, but just initted one and hit a strange error related to the eslint formatter. For some reason, it kept spitting out an empty error (no warnings or errors, just a flat failure) - this appears to be an issue in the pcf-scripts invocation of eslint and the default formatter. The fix is easy: don't rely on pcf-scripts to lint for you: just invoke eslint yourself with: ``` npx eslint './**/*.{ts,tsx}' --format stylish ```" image="https://static.licdn.com/aero-v1/sc/h/c45fy346jw096z9pbphyyhdz7" domain="www.linkedin.com" new_tab="true" nofollow="true" >}}


{{< linkcard url="https://eslint.org/" title="Find and fix problems in your JavaScript code - ESLint - Pluggable JavaScript Linter" summary="A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease." image="/linkcards/215d735fec0255e6.png" domain="eslint.org" new_tab="true" nofollow="true" >}}


