-
- Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
acceptedneeds designImportant details about this change need to be discussedImportant details about this change need to be discussedrule
Description
Coming over from @bradzacher's typescript-eslint Discord comment about RuleTester
usage around suggestions
-> typescript-eslint/typescript-eslint#9639: typescript-eslint has an internal lint rule for test formatting which enforces things like "a template string must be either indented 0 or indented template indent + 2" and "all cases must be prettier formatted". This is really useful for keeping rule test code clean and readable.
Incorrect:
ruleTester.run("my-rule", { invalid: [ /* ... */ ], valid: [ `console.log ( "some code" ) ` ], });
Correct:
ruleTester.run("my-rule", { invalid: [ /* ... */ ], valid: [ `console.log("some code");` ], });
This also isn't really specific to typescript-eslint. I could see a use case for any arbitrary plugin to want it.
Proposal: would you be interested in taking this rule into eslint-plugin-eslint-plugin
?
lishaduck
Metadata
Metadata
Assignees
Labels
acceptedneeds designImportant details about this change need to be discussedImportant details about this change need to be discussedrule