Commit 67706e7
feat(eslint-plugin): add
* 🚧 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 <[email protected]>key-spacing rule extension for interface & type declarations (#6211)1 parent 09d57ce commit 67706e7
File tree
11 files changed
+1789
-16
lines changed- packages/eslint-plugin
- docs/rules
- src
- configs
- rules
- util
- tests/rules
- typings
11 files changed
+1789
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 5 | | |
21 | 6 | | |
22 | 7 | | |
| |||
163 | 148 | | |
164 | 149 | | |
165 | 150 | | |
166 | | - | |
| 151 | + | |
| 152 | + | |
167 | 153 | | |
168 | 154 | | |
169 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
0 commit comments