Consider this test:
const original = `interface Test {
a: boolean
b: boolean
c: boolean
d: boolean
e: boolean
f: boolean
}`
const incoming = `interface Test {
// a
a: boolean
// b
b: boolean
// c
c: boolean
// d
d: boolean
// d
e: boolean
/**
* multi-line comment
*/
f: boolean
}`
it('correctly determines the indentation to be 4 characters for both', () => {
const originalIndent = detectIndent(original)
const incomingIndent = detectIndent(incoming)
expect(incomingIndent.amount).toBe(originalIndent.amount)
// FAIL:
// originalIndent.amount === 4 (correct)
// incomingIndent.amount === 1 (incorrect, seems to use the multi-line comment indent)
})
I would expect that the incoming indent would be 4
. The multi-line comment means that we return 1
as the indent amount
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too