Suggest for enum-value-case to support more flexible enum style#782
Merged
maxh merged 5 commits intoNov 7, 2025
Merged
Conversation
added 2 commits
October 29, 2025 22:24
Contributor
Author
|
@maxh Could you please review this pull request? |
Collaborator
maxh
added a commit
that referenced
this pull request
Nov 6, 2025
For #782 ## Overview This PR adds support for deprecating rules in prisma-lint. Rule authors can now mark rules as deprecated and provide helpful migration information to users. ## Changes - **Type definitions**: Added `RuleDeprecation` type and optional `deprecated` field to all rule definition types - **Parse rules**: Enhanced `parseRules` function to detect deprecated rules and collect warnings - **CLI**: Added deprecation warning output in yellow color (suppressed in quiet mode) - **Tests**: Added comprehensive test coverage for deprecated rule scenarios - **Documentation**: Updated DEVELOPMENT.md with instructions on how to deprecate rules ## Usage Rule authors can deprecate a rule by adding the `deprecated` field: ```typescript 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 enable a deprecated rule, they'll see a warning: ``` Warning: Rule 'my-old-rule' is deprecated. This rule is no longer maintained. Use 'my-new-rule' instead. ``` The deprecated rule continues to function normally, allowing users to migrate at their own pace.
Collaborator
|
@yuta-ike please:
once these changes are in I'll approve, merge and release a new version thanks!! |
Contributor
Author
|
@maxh Thanks! I've done it |
maxh
approved these changes
Nov 7, 2025
Collaborator
|
release... let's see if github action succeeds after recent npm security lockdown #785 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for this useful tool!
In my project, we adhere to a rule where enum values must be defined using PascalCase. So I extended
enum-value-snake-caseto support camelCase and PascalCase.