testShorthands
Test cases with only a code property can use string shorthand syntax instead of object literal syntax.
✅ This rule is included in the flint logical presets.
When defining test cases for linting rules, if a test case only requires a code property
without any additional configuration (like options, errors, etc.), it can be simplified using string shorthand syntax.
Examples
Section titled “Examples”ruleTester.describe(rule, { valid: ["a", { code: "a" }], invalid: [],});ruleTester.describe(rule, { valid: ["a", "a"], invalid: [],});ruleTester.describe(rule, { valid: [ { code: "a", fileName: "b.ts" }, { code: "a", fileName: "c.ts" }, ], invalid: [],});Options
Section titled “Options”This rule is not configurable.
Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.