Conformance Custom Rules
Conformance is available on Enterprise plans
Vercel's built-in Conformance rules are crafted from extensive experience in developing large-scale codebases and high-quality web applications. Recognizing the unique needs of different companies, teams, and products, Vercel offers configurable, no-code custom rules. These allow for tailored solutions to specific challenges.
Custom rules in Vercel feature unique error names and messages, providing deeper context and actionable resolution guidance. For example, they may include:
- Links to internal documentation
- Alternative methods for logging issues
- Information on who to contact for help
You can use custom rules to proactively prevent future issues, to reactively prevent issues from reoccuring, and/or as a mitigation tool.
We support the following custom rules types:
The no-code custom rules are defined and configured in .
In this example, you will set up a custom rule with the type. This rule disallows importing a package called , and suggests to users that they should instead use a newer version of that package.
At the root of your directory, create a file named . If one already exists, skip to the next step.
First, define a new custom rule in .
All custom rules require the properties:
Other required and optional configuration depends on the custom rule type. In this example, we're using the type, which requires an property.
As all custom rules are disabled by default, you'll need to enable rules in . Refer to the documentation for each custom rule type for more information.
Rule names must be prefixed with when enabled, and any allowlist files and entries will also be prefixed with . This prefix is added to ensure that the names of custom rules don't conflict with built-in rules.
In the example below, we're enabling the rule for the entire project by providing it with the required configuration (targeting all files in ).
In this example, we've used the same configuration as above, but have also restricted the rule and configuration to the workspace.
In this example used the same configuration as above, but have also restricted the rule and configuration to the workspace:
Was this helpful?