This is ok and no error comes out.
return (
<p>
I'm {this.state.name}
</p>
)
when I add any character after this like:
return (
<p>
I'm {this.state.name} any string here
</p>
)
and the error comes out:
Expected indentation of 8 space characters but found 1. (react/jsx-indent)
my eslint config :
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
es6: true,
commonjs: true,
browser: true,
},
extends: [
'standard',
'standard-react'
],
plugins: [
'react',
'babel',
'promise'
],
'rules': {
'arrow-parens': 0,
'generator-star-spacing': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}
Is it a bug or something wrong with my config?
Same for me, failing e.g. on the following line:
<Time fromNumber={this.state.value}/> <Translate for="shortHours"/>
Not sure from which version it start happening.
The version I used: ^6.10.2
Yep, seems to be counting the first group of space after a react element. (6.10.2)
<Icon name="tasks" fixedWidth /> Create Order
Gives 1
<Icon name="tasks" fixedWidth /> Create Order
Gives 3
<Icon name="tasks" fixedWidth />Create Order
Gives 0
Temporary fix: use a fixed version until the bug is fixed. 6.10.0 works fine
@megapctr it is not working for me
I have 6.10.2 version and it doesn't work
<div className="PageCampaignEditSettingsAdExample__headRating">
<Rating rating={rating} />
( {reviews} )
</div>
Expected indentation of 12 space characters but found 1 react/jsx-indent
This is a duplicate of #1117 - thanks for the extra test cases!
Most helpful comment
@megapctr it is not working for me