Developing prisma-lint
November 6, 2025 ยท View on GitHub
Set up
mise install
corepack enable
yarn
Build & run
yarn build && node ./dist/cli.js -c example/.prismalintrc.json example/valid.prisma
Test
A few options:
- To run all unit tests use
yarn test. - To run a specific unit test use
yarn test <test>. - To run a local version against example test cases, see example/README.md. Feel free to add or edit examples.
- To use a local version of
prisma-lintwithin a different repository, update the other repository'spackage.jsondependency as shown below, then runyarnandyarn prisma-lintwithin the other repository.
"prisma-lint": "portal:/Users/max/loop/prisma-lint",
Deprecating rules
To deprecate a rule, add a deprecated field to the rule definition:
export default {
ruleName: 'my-old-rule',
configSchema: Config,
create: (config, context) => {
// rule implementation
},
deprecated: {
message: 'This rule is no longer maintained.',
replacedBy: 'my-new-rule', // optional
},
} satisfies ModelRuleDefinition<z.infer<typeof Config>>;
When users configure a deprecated rule in their .prismalintrc.json, they will see a warning message like:
Warning: Rule 'my-old-rule' is deprecated. This rule is no longer maintained. Use 'my-new-rule' instead.
The rule will still function normally, but users are encouraged to migrate to the replacement rule.
Review
To prepare a pull request for review:
- Generate rules documentation (
RULES.md) by runningyarn docs. - Add an entry to the "Unreleased" section in
CHANGELOG.md. Omit this step if there is no user-facing change. - Create a pull request.
Release
To release a new version:
- Check out a new branch.
- Run
yarn bump-version. - Create a pull request and merge it.
- The
release.ymlGitHub Action will publish to NPM.