Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(eslint-plugin-internal): add plugin-test-formatting rule (#1821)
The strings that are used for eslint plugins will not be checked for formatting. This can lead to diff noise as one contributor adjusts formatting, uses different quotes, etc. This rule just enforces the following: - all code samples are formatted with prettier - all single line tests do not use backticks - all multiline tests have: - no code on the first line - no code on the last line - the closing backtick indentation === property indentation - one of the following indentations: - no indentation at all - indentation of 1 + object indent examples of enforced style: ```ts ruleTester.run('foo', rule, { valid: [ 'const a = 1;', ` const a = 1; `, ` const a = 1; `, { code: 'const a = 1;', }, { code: ` const a = 1; `, }, { code: ` const a = 1; `, }, ], invalid: [ { code: 'const a = 1;', }, { code: ` const a = 1; `, }, { code: ` const a = 1; `, }, ], }); ```
- Loading branch information