`prefer-const` not triggered (regression from 2.4.0)
See original GitHub issueWhat version of ESLint are you using? 2.7.0
What parser (default, Babel-ESLint, etc.) are you using?
“babel-eslint”: “~6.0.0”
Please show your full configuration:
{
"parser": "babel-eslint",
"extends": "airbnb",
"rules": {
"semi": [2, "never"],
"arrow-body-style": 0
}
}
What did you do? Please include the actual source code causing the issue.
import React, { PropTypes } from 'react'
const innerStyle = {
color: '#343434',
color2: 'white',
}
const ToolBar = ({ style, draw }) => {
let dynStyle = {
...innerStyle,
...style,
}
dynStyle.color = draw ? dynStyle.color2 : dynStyle.color
return (
<div style={dynStyle} />
)
}
ToolBar.propTypes = {
style: PropTypes.object,
draw: PropTypes.bool,
}
export default ToolBar
What did you expect to happen?
prefer-const
should trigger and ask me to change let dynStyle
to const dynStyle
What actually happened? Please include the actual, raw output from ESLint.
ESLint don’t trigger the prefer-const
rule.
Note I tried these versions :
~2.4.0
: Works~2.5.0
: Doesn’t work~2.6.0
: Doesn’t work~2.7.0
: Doesn’t work
Commits that are related to prefer-const
(maybe I miss some) :
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (17 by maintainers)
Top Results From Across the Web
prefer-const - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Release Notes — Airflow Documentation
In order to make airflow dags test more useful as a testing and debugging tool, we no longer run a backfill job and...
Read more >Zephyr 2.4.0 — Zephyr Project Documentation - nRF51 SDK
Enabled the new TCP stack, TCP2, by default. This stack was introduced in Zephyr v2.1.0 to improve network protocol testability with open source ......
Read more >4. Release Notes — Buildbot 2.4.0 documentation
UI now shows a paginated view for trigger step sub builds. 4.1.5. Deprecations and Removals¶. Support for older browsers that were not working...
Read more >Apache 2.4 Change Log
Credits: The Apache HTTP Server project would like to thank Gaetan Ferry ... While working on some servers, EAB handling is not uniform...
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 FreeTop 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
Top GitHub Comments
Oh, I’m sorry. I had lost the track of this issue.
I will fix this.
Thank you for explaining. I understood it.