Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

space-before-function-paren: <object> is invalid configuration #4535

Closed
holyjak opened this issue Nov 24, 2015 · 2 comments
Closed

space-before-function-paren: <object> is invalid configuration #4535

holyjak opened this issue Nov 24, 2015 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@holyjak
Copy link

holyjak commented Nov 24, 2015

According to http://eslint.org/docs/rules/space-before-function-paren.html, this should be legal: "space-before-function-paren": {"anonymous": "never", "named": "always"}. However eslint myfile.js fails with

/myproject/node_modules/eslint/lib/config/config-validator.js:102
        throw new Error(message.join(""));
              ^
Error: /myproject/.eslintrc:
    Configuration for rule "space-before-function-paren" is invalid:
    Value "[object Object]" is the wrong type.

    at validateRuleOptions (/myproject/node_modules/eslint/lib/config/config-validator.js:102:15)
    at /myproject/node_modules/eslint/lib/config/config-validator.js:148:13
    at Array.forEach (native)
    at Object.validate (/myproject/node_modules/eslint/lib/config/config-validator.js:147:35)
    at Object.load (/myproject/node_modules/eslint/lib/config/config-file.js:390:19)
    at loadConfig (/myproject/node_modules/eslint/lib/config.js:74:33)
    at getLocalConfig (/myproject/node_modules/eslint/lib/config.js:177:23)
    at Config.getConfig (/myproject/node_modules/eslint/lib/config.js:272:22)
    at processText (/myproject/node_modules/eslint/lib/cli-engine.js:203:27)
    at processFile (/myproject/node_modules/eslint/lib/cli-engine.js:270:18)

eslint --version => v1.10.1

And .eslintrc:

{
  "parser": "babel-eslint",
  "extends": "eslint:recommended",
  "root": true,
  "plugins": ["react"],
  "env": {
        "browser": true,
        "node": true,
        "es6": true
  },
  "ecmaFeatures": {
    "jsx": true
  },
  "rules": {
    "strict": 0,
    "eqeqeq": 1,
    "no-use-before-define": 1,
    "no-trailing-spaces": 1,
    "space-before-function-paren": {"anonymous": "never", "named": "always"}
  }
}
@eslintbot
Copy link

@jakubholynet Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Nov 24, 2015
@holyjak
Copy link
Author

holyjak commented Nov 24, 2015

I see my error now; the config should have been

"space-before-function-paren": [2, { "anonymous": "always", "named": "never" }]

@holyjak holyjak closed this as completed Nov 24, 2015
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

2 participants