@pilotlint/plugin-changes
v0.2.4
Published
pilotlint rules for files that must or must not change together.
Readme
@pilotlint/plugin-changes
pilotlint rules for changes: files that must change
together, and generated files that must not be edited by hand. The rules compare the working
tree with a git ref, HEAD by default.
Install
npm install -D pilotlint @pilotlint/plugin-changesUse
// pilotlint.config.ts
import changes from '@pilotlint/plugin-changes';
import { defineConfig } from 'pilotlint';
export default defineConfig({
plugins: [changes],
rules: {
'changes/requires-change': [
'error',
{
rules: [
{
when: 'src/**/messages.ts',
require: 'src/translations/en.json',
hint: 'Run pnpm extract-intl.',
},
],
},
],
'changes/no-manual-edit': [
'error',
{
rules: [{ files: 'src/generated/**', unless: 'schema.graphql', hint: 'Run pnpm codegen.' }],
},
],
},
});In CI, compare with the main branch: pilotlint check --base origin/main.
Rules
| Rule | Checks |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| requires-change | When some files change, the files that depend on them change too |
| no-manual-edit | Generated files change only together with the input they come from |
See all options, or run
pilotlint rules explain changes/<rule>.
License
MIT
