question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

indent MemberExpression not working

See original GitHub issue

Tell us about your environment

  • ESLint Version: 2.13.1
  • Node Version: v6.5.0
  • npm Version: 3.10.3

What parser (default, Babel-ESLint, etc.) are you using? none

Please show your full configuration:

What did you do? Please include the actual source code causing the issue. Created tmp.js with this example from doc

/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/

var foo = [];

foo
.bar
.baz();

Then ran:

node_modules/eslint/bin/eslint.js tmp.js

What did you expect to happen? Error about lack of spaces before indents What actually happened? Please include the actual, raw output from ESLint.

/Users/mikael/Work/lint/.eslintrc:
    Configuration for rule "indent" is invalid:
    Value "data["1"].MemberExpression" has additional properties.

Error: /Users/mikael/Work/lint/.eslintrc:
    Configuration for rule "indent" is invalid:
    Value "data["1"].MemberExpression" has additional properties.

    at validateRuleOptions (/Users/mikael/Work/lint/node_modules/eslint/lib/config/config-validator.js:119:15)
    at /Users/mikael/Work/lint/node_modules/eslint/lib/config/config-validator.js:166:13
    at Array.forEach (native)
    at Object.validate (/Users/mikael/Work/lint/node_modules/eslint/lib/config/config-validator.js:165:35)
    at Object.load (/Users/mikael/Work/lint/node_modules/eslint/lib/config/config-file.js:523:19)
    at loadConfig (/Users/mikael/Work/lint/node_modules/eslint/lib/config.js:64:33)
    at getLocalConfig (/Users/mikael/Work/lint/node_modules/eslint/lib/config.js:126:23)
    at Config.getConfig (/Users/mikael/Work/lint/node_modules/eslint/lib/config.js:227:22)
    at processText (/Users/mikael/Work/lint/node_modules/eslint/lib/cli-engine.js:223:27)
    at processFile (/Users/mikael/Work/lint/node_modules/eslint/lib/cli-engine.js:298:18)

Maybe because MemberExpression isn’t defined in the schema for indent?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marneborncommented, Oct 17, 2016

Yes, the problem was with eslint 2.5, works in 3.1.

-mikael

0reactions
vitorbalcommented, Oct 17, 2016

friendly ping @marneborn, were you able to verify if your issue is solved after upgrading your version of ESLint?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint indent rule indents decorated members - Stack Overflow
but now I am experiencing problem with decorators, which get indented although my preference is to have them aligned with the member. @prop({ ......
Read more >
indent - 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 >
ESLint - indent - The --fix option on the command line can ...
indent. The --fix option on the command line can automatically fix some of the problems reported by this rule. Enforces consistent indentation.
Read more >
[Solved]-Eslint indent with chained methods-Reactjs
"Indent of 2 spaces with MemberExpression set to 0 will indent the multi-line property chains ... Eslint (Airbnb) indentation issues with React code(JSX) ......
Read more >
indent-legacy - Rules - ESLint - Pluggable JavaScript linter | Js中文网
"MemberExpression" (off by default) enforces indentation level for ... Indent of 2 spaces with SwitchCase set to 0 will not indent case clauses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found