indent rule's ignoredNodes not respected when multiline
See original GitHub issueTell us about your environment
- ESLint Version: 4.16.0
- Node Version: 8.9.4
- npm Version: 5.6.0
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint
Please show your full configuration:
Configuration
module.exports = {
parser: 'babel-eslint',
rules: {
indent: ['error', 4, {
ignoredNodes: [
'JSXOpeningElement',
],
}],
},
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
function Test() {
return (
<div>
{_.map(array, arrayValue => {
return (condition &&
<Inner
one={arrayValue.one}
>
{arrayValue.two}
</Inner>
);
})}
</div>
);
}
./node_modules/.bin/eslint test.jsx
What did you expect to happen?
No error.
What actually happened? Please include the actual, raw output from ESLint.
path/to/sandbox/2018-01-23/test.jsx
8:1 error Expected indentation of 24 spaces but found 20 indent
✖ 1 problem (1 error, 0 warnings)
1 error, 0 warnings potentially fixable with the `--fix` option.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:10 (8 by maintainers)
Top Results From Across the Web
indent - ESLint - Pluggable JavaScript Linter
This rule has an object option: "ignoredNodes" can be used to disable indentation checking for any AST node. This accepts an array of...
Read more >Ignore the indentation in a template literal, with the ESLint ...
1. I got a warning from eslint using this config, specifically since it expects ignoredNodes to be an array. · I didn't get...
Read more >indent-legacy - Rules - ESLint中文文档
Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix; Tabs: jQuery; Four spaces: Crockford. Rule Details. This rule enforces a...
Read more >How can you indent multiple lines all at once? - HTML FAQ
This is very late, but for anyone who comes across this: You can indent multiple things by selecting everything you want to indent,...
Read more >[Review] SE-0168: Multi-Line String Literals - Swift Forums
On a separate note, I'd like to bring up the de-indentation behavior I described ... Why not simple rule that content of multi-line...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Airbnb is having this same problem; when
JSXOpeningElement
is in ignored nodes, the>
on a multiline opening element - which has no node type - is not ignored.That’s the only scenario I’ve seen it in, but i can’t really survey 10k+ files 😃
I’ll try it locally as well.