-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[perhaps a Feature Request] Custom rule #108
Comments
Hey @askarby! We don't have that capability yet. I like the suggestion. What rule are you thinking about adding? |
I'm thinking about rules like:
etc. Granted, I could contribute separate rules for those, but sometimes, the rules you require can be very specific (hence not very general purpose) |
I'm in for this too. For example, we want to restrict the 'files' value for library packages in our mono-repo, so adding something to validate the value of it against something we want would be awesome. |
Thanks, @dietergeerts. I'm moving (slowly) through v4. I'm hoping this will be a part of it. Do you have any thoughts on your preferred interface for writing custom rules? I'm starting to think through how this might work. |
I too would love this feature. In terms of an interface, I'd prefer to have one similar to that of On that same note, I'd prefer to have a TypeScript interface available to write custom rules. |
Consolidating issue #208 here. Adding the notes mentioned on the other issue: There are use cases where certain projects may want to implement custom rule integration. A plugin system similar to adding rules to eslint or stylelint. Examples of custom rules:
|
Would it not be a possibility to have a JSON Schema provided that can be checked? Because then we can provide all our custom rules through that JSON Schema. Off course, error messages may be a bit more difficult to understand then, but at least, then we can define any custom rule we want. It is JSON after all. I like a lot of the rules that are available, and they make it easy to configure and know what it will check without needing to know some internals on JSON Schemas, but the way I see it is that such extra optional JSON Schema is similar to what ESLint provides with the https://eslint.org/docs/rules/no-restricted-syntax rule, where you can use a "selector" for the syntax you don't want. |
A few custom rules I'd make if I could:
|
I would like to create a rule for enforcing naming conventions for scripts. We have multiple repos and the naming is all over the place. |
Even though it is not officially supported and requires using internal api, but custom rules can be added using nodejs api:
Custom rule should be provided in commonjs format. Inspired by #596 (comment) |
It may just be me, but...
I can't seem to find a way to include my own, custom rule (just like ESLint and TSLint provides). Granted, I could create a rule, and submit a pull request for it, but I may have a very domain specific rule, that I want to apply.
Is there already an option to do that.... if not, this can be considered a feature request 😄
The text was updated successfully, but these errors were encountered: