Skip to content

Commit efdf00d

Browse files
author
Kent C. Dodds
committed
[Fix] jsx-indent with tabs (fixes jsx-eslint#1057)
1 parent c97dd0f commit efdf00d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/lib/rules/jsx-indent.js

+28
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,34 @@ ruleTester.run('jsx-indent', rule, {
459459
options: ['tab'],
460460
parserOptions: parserOptions,
461461
errors: [{message: 'Expected indentation of 1 tab character but found 0.'}]
462+
}, {
463+
code: [
464+
'function MyComponent(props) {',
465+
'\treturn (',
466+
' <div',
467+
'\t\t\tclassName="foo-bar"',
468+
'\t\t\tid="thing"',
469+
' >',
470+
' Hello world!',
471+
' </div>',
472+
'\t)',
473+
'}'
474+
].join('\n'),
475+
output: [
476+
'function MyComponent(props) {',
477+
'\treturn (',
478+
'\t\t<div',
479+
'\t\t\tclassName="foo-bar"',
480+
'\t\t\tid="thing"',
481+
'\t\t>',
482+
'\t\t\tHello world!',
483+
'\t\t</div>',
484+
'\t)',
485+
'}'
486+
].join('\n'),
487+
options: ['tab'],
488+
parserOptions: parserOptions,
489+
errors: [{message: 'Expected indentation of 2 tab characters but found 0.'}]
462490
}, {
463491
code: [
464492
'function App() {',

0 commit comments

Comments
 (0)