Unexpected `indent` complaint after multiline destructure
See original GitHub issueTell us about your environment
- ESLint Version: 4.0.0
- Node Version: 6.9.1
- npm Version: 3.10.8
What parser (default, Babel-ESLint, etc.) are you using?
deafault
Please show your full configuration:
var path = require('path')
// Warnings are errors in production.
var OFF = 'off';
var ERROR = 'error';
var WARNING = isTruthy(process.env.CI) ? ERROR : 'warn';
function isTruthy(value) {
if (!value) return false;
return ['1', 'true'].indexOf(value.toLowerCase()) >= 0;
}
module.exports = {
"settings": {
"import/extensions": [
".js",
],
"import/ignore": [
"node_modules",
],
"import/resolver": {
"webpack": {
"config": path.join(__dirname, 'config', 'webpack.config.js')
}
}
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"extends": [
"eslint:recommended",
"plugin:import/warnings",
"plugin:import/errors",
"plugin:react/recommended"
],
"plugins": ["import", "react"],
"rules": {
"comma-dangle": OFF,
"eqeqeq": [WARNING, "allow-null"],
"import/imports-first": OFF,
"jindent": [WARNING, 2, {"SwitchCase": 1}],
"max-len": [WARNING, 100, 2],
"no-console": [WARNING, {"allow": ["warn", "error"]}],
"no-debugger": WARNING,
"no-fallthrough": WARNING,
"no-unreachable": WARNING,
"no-unused-vars": [WARNING, {"vars": "all", "args": "none"}],
"no-var": ERROR,
"prefer-const": WARNING,
"react/prop-types": [WARNING, {"ignore": ["className"]}],
"semi": [WARNING, "never"],
"no-warning-comments": [WARNING, {"location": "anywhere"}],
"react/no-deprecated": OFF,
"react/no-unescaped-entities": OFF,
},
"env": {
"commonjs": true
},
"globals": {
"alert": false,
"ArrayBuffer": false,
"Audio": false,
"clearInterval": false,
"clearTimeout": false,
"confirm": false,
"console": false,
"document": false,
"File": false,
"FileReader": false,
"FormData": false,
"Image": false,
"process": false,
"Promise": false,
"setInterval": false,
"setTimeout": false,
"Uint8Array": false,
"window": false
}
}
What did you do? Please include the actual source code causing the issue.
const {
a
} = {
a: 1
}
const [
b
] = [
2
]
What did you expect to happen?
No complaint from ESLint, equivalent to:
const c = [
3
]
What actually happened? Please include the actual, raw output from ESLint.
ESLintError:
/Users/rhys/[some path]
53:5 warning 'a' is assigned a value but never used no-unused-vars
55:1 warning Expected indentation of 6 spaces but found 4 indent
56:1 warning Expected indentation of 4 spaces but found 2 indent
59:5 warning 'b' is assigned a value but never used no-unused-vars
61:1 warning Expected indentation of 6 spaces but found 4 indent
62:1 warning Expected indentation of 4 spaces but found 2 indent
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
What should I do with "Unexpected indent" in Python?
If you got an unexpected indent and you see that all the code is perfectly indented, try opening it with another editor and...
Read more >Ruby Style Guide
Indent when to case Indent when as deep as case . This is the style established in both "The Ruby Programming Language" and...
Read more >How do i resolve the unexpected indent error in python
As the error message indicates, you have an unexpected indent error. This error occurs when a statement is unnecessarily indented or its ...
Read more >Airbnb JavaScript Style Guide()
7.15 Functions with multiline signatures, or invocations, should be indented just like every other multiline list in this guide: with each item on...
Read more >cpplint.py - Washington
We do a small hack, which is to ignore //'s with "'s after them on the ... (Category names are printed with the...
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
@VictorHom Yes, issue is accepted so please go ahead. Just post back if you’re no longer able to work on the issue so someone else can pick it up (if something comes up). Stop by our Gitter chat if you need help or want to chat. Thanks for volunteering!
@idris can you please create a new issue? I’m not sure your problem is the same as the one from this issue.
Also, keep in mind that we don’t officially support flow, so it’s not guaranteed that all the core rules will work well with it. (That said, we are trying to make the
indent
rule work reasonably well in most cases when it encounters syntax it’s unfamiliar with)