Post-merge-review: Fix template-require-form-method: throw on bad config; default enabled#2698
Merged
NullVoxPopuli merged 5 commits intoember-cli:masterfrom Apr 15, 2026
Conversation
| } | ||
|
|
||
| return false; | ||
| // Invalid configuration (e.g. unknown method in allowedMethods). Throw a |
Contributor
There was a problem hiding this comment.
Comments describing 'what' instead of 'why' are usually worthless. Bad bot
| '<div method="randomType"></div>', | ||
| // Default behavior: when no options are provided, the rule is disabled. | ||
| // A bare <form> should NOT error. | ||
| '<form></form>', |
Contributor
There was a problem hiding this comment.
this is supposed to be invalid, according to ember-template-lint
parseConfig now throws on invalid allowedMethods (matches upstream's strictness instead of silently disabling). parseConfig(undefined) returns false so the rule doesn't run when options are omitted (matches upstream default). Schema accepts boolean root for parity.
…ber-template-lint Align with upstream: bare <form> and invalid method values are now flagged without explicit configuration. Pass `false` to opt out.
3d2e871 to
34225ac
Compare
| options: [{ allowedMethods: ['get'] }], | ||
| code: '<form method="GET"></form>', | ||
| }, | ||
| '<form method="POST"></form>', |
Contributor
There was a problem hiding this comment.
why'd all these get removed? do we not want to test what happens with no options anymore?
Contributor
Author
There was a problem hiding this comment.
thanks, reverted, now, was only moved to wrappers on the sort { options: [true], code: ', but that was unnecessary for most.
…h no options With the rule default-enabled, `options: [true]` is redundant with no options. Switch most valid cases to bare strings so the tests exercise the default user path. Keep one `options: [true]` and one `options: [false]` as sentinels documenting that the explicit boolean forms still work.
NullVoxPopuli
approved these changes
Apr 15, 2026
This was referenced Apr 20, 2026
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.
Summary
<form>and invalid method values are flagged without any configurationfalseto explicitly disable:'template-require-form-method': ['error', false]parseConfigthrows on invalidallowedMethodsvalues instead of silently disablingTest plan
<form>flagged<form method="NOT_A_VALID_METHOD">flaggedoptions: [true]→ rule enabled with POST,GET,DIALOGoptions: [false]→ rule explicitly disabledoptions: [{ allowedMethods: ['PATCH'] }]→ throws configuration error