Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): add
key-spacing
rule extension for interface &…
… type declarations (#6211) * 🚧 key-spacing for interface on default settings * 🚧 Support type literals as welll * 🚧 Add full typing for the options * 🚧 Add 'mode' param * 🐛 Fix index signatures * ✨ Support classes * 🩹 fixes * ✅ Add tests on mode, multiLine, singleLine * 🏷️ Allow options.multiline.align to be an object * 🎨 Use ast utils to locate last character before token * ✨ Support comments in-between properties * ✅ Add test cases for nested type declarations & multiline type annotations * ✨ Autofix for non-aligned values * ✨ Autofix for aligned values * ✏️ * 🚨 * 🐛 Support optional ? token * ✅ Add tests with class property assignments * 📝 Add documentation on key-spacing * 🎨 Use .at() to access last element of array * ✅ Fix tests * fixup! ✅ Fix tests * ✅ Add some coverage * 🐛 Fix edge case in determining aligned groups In case there is three statements in one line, and one statement in the line after * ⚡️ Use Array.concat instead of .push(...) .push could error if 60k + arguments * 🎨 Improve readability * 🎨 Use tempate literals in tests * ✅ Add test with anonymous types * ✅ Add test with quoted keys * ➕ Add grapheme-splitter to deal with emojis * ✅ Add test case for multiline comments * 🚨 Remove 'in' statements, reduce amount of null-assertions * ✅ Add test case for properties without type annotation or assignments * ✅ Add wacky test cases * ✅ Add coverage * ✅ Add coverage, again * ✅ Add coverage, again * ✅ Add coverage when align is an object, but align.on is missing It defaults to 'colon' in this case * KeyTypeNodeWithTypeAnnotation * Extract to shared helper Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
- Loading branch information