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

4.0.0: ESLint configuration is invalid: - Unexpected top-level property "ecmaFeatures" #8726

Closed
doberkofler opened this Issue Jun 13, 2017 · 27 comments

Comments

Projects
None yet
@doberkofler
Contributor

doberkofler commented Jun 13, 2017

Tell us about your environment

  • ESLint Version: 4.0.0
  • Node Version: 6.11.0
  • npm Version: 5.0.3

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

Please show your full configuration:

.eslintrc.json

{
    "extends": [
        "./eslintDefaults.json"
	]
}

eslintDefaults.json

{
    "parserOptions": {
        "ecmaVersion": 8
    },
	"env": {
        "es6": true
    },
    "extends": "eslint:recommended",
    "globals": {
    },
    "plugins": [
    ],
    "rules": {
    }
}

What did you do? Please include the actual source code causing the issue.

What did you expect to happen?

What actually happened? Please include the actual, raw output from ESLint.

Error: D:\MyDev\ljs_app\trunk\periscope\build\test\selenium\public\.eslintrc:
        ESLint configuration is invalid:
        - Unexpected top-level property "ecmaFeatures".

@eslintbot eslintbot added the triage label Jun 13, 2017

@platinumazure

This comment has been minimized.

Member

platinumazure commented Jun 13, 2017

Can you please run node ./node_modules/eslint/bin/eslint.js --print-config ./index.js (pointing at some top-level file) and share the results?

@emirdeliz

This comment has been minimized.

emirdeliz commented Jun 13, 2017

+1

@doberkofler

This comment has been minimized.

Contributor

doberkofler commented Jun 13, 2017

@platinumazure

{
  "globals": {
    "Array": false,
    "ArrayBuffer": false,
    "Boolean": false,
    "constructor": false,
    "DataView": false,
    "Date": false,
    "decodeURI": false,
    "decodeURIComponent": false,
    "encodeURI": false,
    "encodeURIComponent": false,
    "Error": false,
    "escape": false,
    "eval": false,
    "EvalError": false,
    "Float32Array": false,
    "Float64Array": false,
    "Function": false,
    "hasOwnProperty": false,
    "Infinity": false,
    "Int16Array": false,
    "Int32Array": false,
    "Int8Array": false,
    "isFinite": false,
    "isNaN": false,
    "isPrototypeOf": false,
    "JSON": false,
    "Map": false,
    "Math": false,
    "NaN": false,
    "Number": false,
    "Object": false,
    "parseFloat": false,
    "parseInt": false,
    "Promise": false,
    "propertyIsEnumerable": false,
    "Proxy": false,
    "RangeError": false,
    "ReferenceError": false,
    "Reflect": false,
    "RegExp": false,
    "Set": false,
    "String": false,
    "Symbol": false,
    "SyntaxError": false,
    "System": false,
    "toLocaleString": false,
    "toString": false,
    "TypeError": false,
    "Uint16Array": false,
    "Uint32Array": false,
    "Uint8Array": false,
    "Uint8ClampedArray": false,
    "undefined": false,
    "unescape": false,
    "URIError": false,
    "valueOf": false,
    "WeakMap": false,
    "WeakSet": false
  },
  "env": {
    "es6": true
  },
  "rules": {
    "accessor-pairs": "off",
    "array-bracket-newline": "off",
    "array-bracket-spacing": [
      "warn",
      "never"
    ],
    "array-callback-return": "warn",
    "array-element-newline": "off",
    "arrow-body-style": [
      "error",
      "as-needed"
    ],
    "arrow-parens": [
      "warn",
      "always"
    ],
    "arrow-spacing": [
      "warn",
      {
        "before": true,
        "after": true
      }
    ],
    "block-scoped-var": "off",
    "block-spacing": [
      "warn",
      "never"
    ],
    "brace-style": [
      "warn",
      "1tbs"
    ],
    "callback-return": "off",
    "camelcase": "warn",
    "capitalized-comments": "off",
    "class-methods-use-this": "warn",
    "comma-dangle": "off",
    "comma-spacing": [
      "warn",
      {
        "before": false,
        "after": true
      }
    ],
    "comma-style": [
      "warn",
      "last"
    ],
    "complexity": "off",
    "computed-property-spacing": [
      "warn",
      "never"
    ],
    "consistent-return": "warn",
    "consistent-this": [
      "warn",
      "that"
    ],
    "constructor-super": "error",
    "curly": [
      "error",
      "all"
    ],
    "default-case": "error",
    "dot-location": "off",
    "dot-notation": [
      "error",
      {
        "allowKeywords": true,
        "allowPattern": "^[a-zA-Z]+(_[a-zA-Z]+)+$"
      }
    ],
    "eol-last": "warn",
    "eqeqeq": "error",
    "for-direction": "off",
    "func-call-spacing": [
      "warn",
      "never"
    ],
    "func-name-matching": "off",
    "func-names": "off",
    "func-style": "off",
    "generator-star-spacing": [
      "warn",
      {
        "before": true,
        "after": false
      }
    ],
    "global-require": "warn",
    "guard-for-in": "error",
    "handle-callback-err": "off",
    "id-blacklist": "off",
    "id-length": "off",
    "id-match": "off",
    "indent": [
      "warn",
      "tab",
      {
        "SwitchCase": 1
      }
    ],
    "indent-legacy": "off",
    "init-declarations": "off",
    "jsx-quotes": "off",
    "key-spacing": [
      "warn",
      {
        "beforeColon": false,
        "afterColon": true
      }
    ],
    "keyword-spacing": [
      "error",
      {
        "before": true,
        "after": true,
        "overrides": {}
      }
    ],
    "line-comment-position": "off",
    "linebreak-style": "off",
    "lines-around-comment": "off",
    "lines-around-directive": "off",
    "max-depth": [
      "warn",
      10
    ],
    "max-len": [
      "warn",
      2000
    ],
    "max-lines": "off",
    "max-nested-callbacks": [
      "warn",
      10
    ],
    "max-params": [
      "warn",
      10
    ],
    "max-statements": [
      "warn",
      150
    ],
    "max-statements-per-line": [
      "warn",
      {
        "max": 2
      }
    ],
    "multiline-ternary": "off",
    "new-cap": "warn",
    "new-parens": "warn",
    "newline-after-var": [
      "off",
      "always"
    ],
    "newline-before-return": "off",
    "newline-per-chained-call": "off",
    "no-alert": "off",
    "no-array-constructor": "warn",
    "no-await-in-loop": "error",
    "no-bitwise": "warn",
    "no-buffer-constructor": "off",
    "no-caller": "error",
    "no-case-declarations": "error",
    "no-catch-shadow": "error",
    "no-class-assign": "error",
    "no-compare-neg-zero": "error",
    "no-cond-assign": "error",
    "no-confusing-arrow": "error",
    "no-console": "off",
    "no-const-assign": "error",
    "no-constant-condition": "error",
    "no-continue": "warn",
    "no-control-regex": "error",
    "no-debugger": "warn",
    "no-delete-var": "error",
    "no-div-regex": "error",
    "no-dupe-args": "error",
    "no-dupe-class-members": "error",
    "no-dupe-keys": "error",
    "no-duplicate-case": "error",
    "no-duplicate-imports": "error",
    "no-else-return": "warn",
    "no-empty": "error",
    "no-empty-character-class": "error",
    "no-empty-function": "off",
    "no-empty-pattern": "warn",
    "no-eq-null": "error",
    "no-eval": "error",
    "no-ex-assign": "error",
    "no-extend-native": "error",
    "no-extra-bind": "error",
    "no-extra-boolean-cast": "warn",
    "no-extra-label": "warn",
    "no-extra-parens": "off",
    "no-extra-semi": "error",
    "no-fallthrough": "warn",
    "no-floating-decimal": "error",
    "no-func-assign": "error",
    "no-global-assign": "error",
    "no-implicit-coercion": [
      "warn",
      {
        "boolean": true,
        "number": true,
        "string": true
      }
    ],
    "no-implicit-globals": "off",
    "no-implied-eval": "error",
    "no-inline-comments": "off",
    "no-inner-declarations": "error",
    "no-invalid-regexp": "error",
    "no-invalid-this": "off",
    "no-irregular-whitespace": "error",
    "no-iterator": "error",
    "no-label-var": "error",
    "no-labels": [
      "error",
      {
        "allowLoop": false,
        "allowSwitch": false
      }
    ],
    "no-lone-blocks": "off",
    "no-lonely-if": "off",
    "no-loop-func": "error",
    "no-magic-numbers": "off",
    "no-mixed-operators": "off",
    "no-mixed-requires": "off",
    "no-mixed-spaces-and-tabs": "warn",
    "no-multi-assign": "warn",
    "no-multi-spaces": "warn",
    "no-multi-str": "error",
    "no-multiple-empty-lines": "off",
    "no-native-reassign": "error",
    "no-negated-condition": "off",
    "no-negated-in-lhs": "off",
    "no-nested-ternary": "warn",
    "no-new": "error",
    "no-new-func": "error",
    "no-new-object": "warn",
    "no-new-require": "warn",
    "no-new-symbol": "error",
    "no-new-wrappers": "error",
    "no-obj-calls": "error",
    "no-octal": "error",
    "no-octal-escape": "error",
    "no-param-reassign": "off",
    "no-path-concat": "warn",
    "no-plusplus": "off",
    "no-process-env": "error",
    "no-process-exit": "off",
    "no-proto": "error",
    "no-prototype-builtins": "off",
    "no-redeclare": "error",
    "no-regex-spaces": "error",
    "no-restricted-globals": [
      "error",
      "jQuery"
    ],
    "no-restricted-imports": "off",
    "no-restricted-modules": "off",
    "no-restricted-properties": [
      "error",
      {
        "object": "$",
        "property": "each",
        "message": "Use native es2015 forEach."
      },
      {
        "object": "$",
        "property": "camelCase"
      },
      {
        "object": "$",
        "property": "cookie"
      },
      {
        "object": "$",
        "property": "error"
      },
      {
        "object": "$",
        "property": "extend"
      },
      {
        "object": "$",
        "property": "globalEval"
      },
      {
        "object": "$",
        "property": "grep"
      },
      {
        "object": "$",
        "property": "inArray"
      },
      {
        "object": "$",
        "property": "isArray"
      },
      {
        "object": "$",
        "property": "isEmptyObject"
      },
      {
        "object": "$",
        "property": "isFunction"
      },
      {
        "object": "$",
        "property": "isNumeric"
      },
      {
        "object": "$",
        "property": "isPlainObject"
      },
      {
        "object": "$",
        "property": "makeArray"
      },
      {
        "object": "$",
        "property": "map",
        "message": "Use native es2015 map."
      },
      {
        "object": "$",
        "property": "merge"
      },
      {
        "object": "$",
        "property": "noop"
      },
      {
        "object": "$",
        "property": "now"
      },
      {
        "object": "$",
        "property": "parseJSON"
      },
      {
        "object": "$",
        "property": "parseXML"
      },
      {
        "object": "$",
        "property": "trim"
      },
      {
        "object": "$",
        "property": "type"
      },
      {
        "object": "$",
        "property": "proxy",
        "message": "Use native Function.bind."
      },
      {
        "object": "$",
        "property": "when"
      }
    ],
    "no-restricted-syntax": [
      "warn",
      "WithStatement"
    ],
    "no-return-assign": "error",
    "no-return-await": "off",
    "no-script-url": "error",
    "no-self-assign": "error",
    "no-self-compare": "error",
    "no-sequences": "error",
    "no-shadow": [
      "warn",
      {
        "builtinGlobals": false
      }
    ],
    "no-shadow-restricted-names": "error",
    "no-spaced-func": "off",
    "no-sparse-arrays": "error",
    "no-sync": "off",
    "no-tabs": "off",
    "no-template-curly-in-string": "error",
    "no-ternary": "off",
    "no-this-before-super": "error",
    "no-throw-literal": "error",
    "no-trailing-spaces": "warn",
    "no-undef": "error",
    "no-undef-init": "error",
    "no-undefined": "warn",
    "no-underscore-dangle": "off",
    "no-unexpected-multiline": "error",
    "no-unmodified-loop-condition": "warn",
    "no-unneeded-ternary": "warn",
    "no-unreachable": "error",
    "no-unsafe-finally": "error",
    "no-unsafe-negation": "error",
    "no-unused-expressions": "error",
    "no-unused-labels": "error",
    "no-unused-vars": [
      "warn",
      {
        "vars": "all",
        "args": "after-used"
      }
    ],
    "no-use-before-define": [
      "error",
      "nofunc"
    ],
    "no-useless-call": "error",
    "no-useless-computed-key": "warn",
    "no-useless-concat": "warn",
    "no-useless-constructor": "error",
    "no-useless-escape": "warn",
    "no-useless-rename": "warn",
    "no-useless-return": "warn",
    "no-var": "error",
    "no-void": "error",
    "no-warning-comments": "off",
    "no-whitespace-before-property": "off",
    "no-with": "error",
    "nonblock-statement-body-position": "off",
    "object-curly-newline": "off",
    "object-curly-spacing": [
      "warn",
      "never"
    ],
    "object-property-newline": "off",
    "object-shorthand": "off",
    "one-var": "off",
    "one-var-declaration-per-line": "off",
    "operator-assignment": "off",
    "operator-linebreak": [
      "warn",
      "after",
      {
        "overrides": {
          "?": "ignore",
          ":": "ignore"
        }
      }
    ],
    "padded-blocks": "off",
    "padding-line-between-statements": "off",
    "prefer-arrow-callback": "off",
    "prefer-const": "warn",
    "prefer-destructuring": "off",
    "prefer-numeric-literals": "off",
    "prefer-promise-reject-errors": "off",
    "prefer-reflect": "off",
    "prefer-rest-params": "off",
    "prefer-spread": "off",
    "prefer-template": "off",
    "quote-props": [
      "warn",
      "consistent"
    ],
    "quotes": [
      "warn",
      "single",
      "avoid-escape"
    ],
    "radix": "error",
    "require-await": "off",
    "require-jsdoc": "off",
    "require-yield": "error",
    "rest-spread-spacing": "off",
    "semi": [
      "warn",
      "always"
    ],
    "semi-spacing": [
      "warn",
      {
        "before": false,
        "after": true
      }
    ],
    "semi-style": "off",
    "sort-imports": "off",
    "sort-keys": "off",
    "sort-vars": "off",
    "space-before-blocks": "warn",
    "space-before-function-paren": [
      "warn",
      {
        "anonymous": "always",
        "named": "never"
      }
    ],
    "space-in-parens": "off",
    "space-infix-ops": "off",
    "space-unary-ops": "off",
    "spaced-comment": [
      "off",
      "always"
    ],
    "strict": [
      "error",
      "global"
    ],
    "switch-colon-spacing": "off",
    "symbol-description": "off",
    "template-curly-spacing": "error",
    "template-tag-spacing": "off",
    "unicode-bom": [
      "error",
      "never"
    ],
    "use-isnan": "error",
    "valid-jsdoc": [
      "warn",
      {
        "prefer": {
          "return": "returns",
          "argument": "param",
          "arg": "param",
          "constructor": "class",
          "virtual": "abstract"
        },
        "preferType": {
          "Boolean": "boolean",
          "Number": "number",
          "String": "string",
          "object": "Object",
          "array": "Array",
          "date": "Date"
        },
        "matchDescription": ".+",
        "requireParamDescription": true,
        "requireReturnDescription": true,
        "requireReturn": false,
        "requireReturnType": true
      }
    ],
    "valid-typeof": "error",
    "vars-on-top": "error",
    "wrap-iife": [
      "error",
      "outside"
    ],
    "wrap-regex": "off",
    "yield-star-spacing": "error",
    "yoda": [
      "error",
      "never",
      {
        "exceptRange": true
      }
    ]
  },
  "parserOptions": {
    "ecmaVersion": 8
  },
  "extends": [
    "eslint:recommended",
    "./eslintDefaults.json"
  ],
  "plugins": []
}
@stevearoonie

This comment has been minimized.

stevearoonie commented Jun 14, 2017

I also have the same problem:
ESLint: v4.0.0
Airbnb config v15.0.1, JSX Ally v5.0.3, React plugin v7.1.0
Node v7.9.0
npm v4.2.0

.eslintrc.yml

extends: airbnb
plugins:
  - react
  - jsx-a11y
  - import
$ node ./node_modules/eslint/bin/eslint.js --print-config ./handler.js
/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint-config-airbnb/rules/react-a11y.js:
	ESLint configuration is invalid:
	- Unexpected top-level property "ecmaFeatures".

Referenced from: airbnb
Referenced from: /Users/xxxx/Projects/yyyy/zzzz/.eslintrc.yml
Error: /Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint-config-airbnb/rules/react-a11y.js:
	ESLint configuration is invalid:
	- Unexpected top-level property "ecmaFeatures".

Referenced from: airbnb
Referenced from: /Users/xxxx/Projects/yyyy/zzzz/.eslintrc.yml
    at validateConfigSchema (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-validator.js:187:15)
    at Object.validate (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-validator.js:200:5)
    at load (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:550:19)
    at configExtends.reduceRight (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:421:36)
    at Array.reduceRight (native)
    at applyExtends (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:405:28)
    at load (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:557:22)
    at configExtends.reduceRight (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:421:36)
    at Array.reduceRight (native)
    at applyExtends (/Users/xxxx/Projects/yyyy/zzzz/node_modules/eslint/lib/config/config-file.js:405:28)

Switching to the google style guide fixed the issue.

@good-idea

This comment has been minimized.

good-idea commented Jun 14, 2017

I was having this issue after a recent full system reinstall. Switching from Node version 6.10.1 to 8.1.0 (using NVM) seems to have solved it. Not sure if it's exactly the same cause (I see @stevearoonie you're on Node 7.9.0) but I'm happy to paste in any config / logs / etc here that might be helpful.

Edit: Maybe not best practice, but I've installed them globally (within my NVM-managed version of node) with npm install -g eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react

@xereda

This comment has been minimized.

xereda commented Jun 14, 2017

@emirdeliz How did you solve this? tks

@metacortex

This comment has been minimized.

metacortex commented Jun 14, 2017

eslint v4 is not yet supported in eslint-config-airbnb and eslint-config-airbnb-base.
airbnb/javascript#1447

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Jun 14, 2017

Would anyone be able to create a small reproduction for this issue? It has a lot of 👍s, so it seems likely that it is a legitimate bug, but it's going to be hard to fix unless we can reproduce it.

@platinumazure

This comment has been minimized.

Member

platinumazure commented Jun 14, 2017

The common factor I've seen in all failing examples so far is "extends": "eslint:recommended". Google style guide does not extend from eslint:recommended; airbnb does. The example in the initial post also does. I can't set up a repo, but that's where I would start.

@westy92

This comment has been minimized.

westy92 commented Jun 14, 2017

Looking here, they nested ecmaFeatures under parserOptions.

@doberkofler

This comment has been minimized.

Contributor

doberkofler commented Jun 15, 2017

Sorry for bothering you, but it actually was a configuration problem on my side. An .eslintrc configuration file hidden deep in my directory structure that I just did not want to see.

@tetreault

This comment has been minimized.

tetreault commented Jun 16, 2017

Am trying to get my team on to gulp and am running into the same issue.

My error (sanitized for client name/project name) when I run gulp:

[17:41:58] Using gulpfile ~/git/mschf/client/projectname/gulpfile.js
[17:41:58] Starting 'lint'...
[17:41:58] Finished 'lint' after 34 ms
[17:41:58] Starting 'js'...
[17:41:58] Finished 'js' after 4.42 ms
[17:41:58] Starting 'default'...
[17:41:58] Finished 'default' after 44 μs

events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: /Users/mschf/git/mschf/client/projectname/.eslintrc:
	ESLint configuration is invalid:
	- Unexpected top-level property "ecmaFeatures".

    at validateConfigSchema (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config/config-validator.js:187:15)
    at Object.validate (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config/config-validator.js:200:5)
    at Object.load (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config/config-file.js:550:19)
    at loadConfig (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config.js:63:33)
    at getLocalConfig (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config.js:123:29)
    at Config.getConfig (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/config.js:262:26)
    at processText (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/cli-engine.js:238:33)
    at CLIEngine.executeOnText (/Users/mschf/git/mschf/client/projectname/node_modules/eslint/lib/cli-engine.js:738:26)
    at Transform.util.transform [as _transform] (/Users/mschf/git/mschf/client/projectname/node_modules/gulp-eslint/index.js:50:20)
    at Transform._read (_stream_transform.js:167:10)

Env:
Node: v7.2.0
NPM: v5.0.3

My gulpfile.js is minimal:

const gulp = require('gulp');
const gutil = require('gulp-util');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const eslint = require('gulp-eslint');
const jsSources = ['src/js/*.js'];
const jsOutputFile = 'script.js';
const jsOutputDir = 'dist/js';

// eslint 
gulp.task('lint', () => {
  gulp.src(jsSources)
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failOnError()); // fail on error for extra strictness
});

// minify and concat JS
gulp.task('js', () => {
  gulp.src(jsSources)
    .pipe(uglify())
    .pipe(concat(jsOutputFile))
    .pipe(gulp.dest(jsOutputDir));
});

// default task
gulp.task('default', ['lint', 'js']);

My .eslintrc file:

{
  // http://eslint.org/docs/rules/
  "ecmaFeatures": {
    "binaryLiterals": true,                    // enable binary literals
    "blockBindings": true,                     // enable let and const (aka block bindings)
    "forOf": true,                             // enable for-of loops
    "objectLiteralComputedProperties": true,   // enable computed object literal property names
    "objectLiteralDuplicateProperties": false,  // enable duplicate object literal properties in strict mode
    "objectLiteralShorthandMethods": false,     // enable object literal shorthand methods
    "templateStrings": true                   // enable template strings
  },

  "env": {
    "browser": true,     // browser global variables.
  },

  "globals": {
    "chrome": true
  },

  "plugins": [
  ],

  "rules": {
    ////////// Possible Errors //////////
    "no-comma-dangle": 2,         // disallow trailing commas in object literals
    "no-cond-assign": 2,          // disallow assignment in conditional expressions
    "no-console": 0,              // disallow use of console (off by default in the node environment)
    "no-constant-condition": 0,   // disallow use of constant expressions in conditions
    "no-control-regex": 0,        // disallow control characters in regular expressions
    "no-debugger": 0,             // disallow use of debugger
    "no-dupe-keys": 2,            // disallow duplicate keys when creating object literals
    "no-empty": 2,                // disallow empty statements
    "no-empty-class": 0,          // disallow the use of empty character classes in regular expressions
    "no-ex-assign": 0,            // disallow assigning to the exception in a catch block
    "no-extra-boolean-cast": 0,   // disallow double-negation boolean casts in a boolean context
    "no-extra-parens": 2,         // disallow unnecessary parentheses (off by default)
    "no-extra-semi": 2i,           // disallow unnecessary semicolons
    "no-func-assign": 2,          // disallow overwriting functions written as function declarations
    "no-inner-declarations": 0,   // disallow function or variable declarations in nested blocks
    "no-invalid-regexp": 2,       // disallow invalid regular expression strings in the RegExp constructor
    "no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
    "no-negated-in-lhs": 0,       // disallow negation of the left operand of an in expression
    "no-obj-calls": 0,            // disallow the use of object properties of the global object (Math and JSON) as functions
    "no-regex-spaces": 2,         // disallow multiple spaces in a regular expression literal
    "no-reserved-keys": 2,        // disallow reserved words being used as object literal keys (off by default)
    "no-sparse-arrays": 0,        // disallow sparse arrays
    "no-unreachable": 2,          // disallow unreachable statements after a return, throw, continue, or break statement
    "use-isnan": 0,               // disallow comparisons with the value NaN
    "valid-jsdoc": 1,             // Ensure JSDoc comments are valid (off by default)
    "valid-typeof": 2,            // Ensure that the results of typeof are compared against a valid string

    ////////// Best Practices //////////
    "block-scoped-var": 2,      // treat var statements as if they were block scoped (off by default)
    "complexity": 0,            // specify the maximum cyclomatic complexity allowed in a program (off by default)
    "consistent-return": 2,     // require return statements to either always or never specify values
    "curly": [1, "multi"],                 // specify curly brace conventions for all control statements
    "default-case": 2,          // require default case in switch statements (off by default)
    "dot-notation": 2,          // encourages use of dot notation whenever possible
    "eqeqeq": 2,                // require the use of === and !==
    "guard-for-in": 1,          // make sure for-in loops have an if statement (off by default)
    "no-alert": 1,              // disallow the use of alert, confirm, and prompt
    "no-caller": 1,             // disallow use of arguments.caller or arguments.callee
    "no-div-regex": 1,          // disallow division operators explicitly at beginning of regular expression (off by default)
    "no-else-return": 2,        // disallow else after a return in an if (off by default)
    "no-empty-label": 0,        // disallow use of labels for anything other then loops and switches
    "no-eq-null": 1,            // disallow comparisons to null without a type-checking operator (off by default)
    "no-eval": 2,               // disallow use of eval()
    "no-extend-native": 0,      // disallow adding to native types
    "no-extra-bind": 0,         // disallow unnecessary function binding
    "no-fallthrough": 0,        // disallow fallthrough of case statements
    "no-floating-decimal": 2,   // disallow the use of leading or trailing decimal points in numeric literals (off by default)
    "no-implied-eval": 1,       // disallow use of eval()-like methods
    "no-iterator": 0,           // disallow usage of __iterator__ property
    "no-labels": 0,             // disallow use of labeled statements
    "no-lone-blocks": 1,        // disallow unnecessary nested blocks
    "no-loop-func": 2,          // disallow creation of functions within loops
    "no-multi-spaces": 2,       // disallow use of multiple spaces
    "no-multi-str": 0,          // disallow use of multiline strings
    "no-native-reassign": 1,    // disallow reassignments of native objects
    "no-new": 1,                // disallow use of new operator when not part of the assignment or comparison
    "no-new-func": 1,           // disallow use of new operator for Function object
    "no-new-wrappers": 2,       // disallows creating new instances of String, Number, and Boolean
    "no-octal": 0,              // disallow use of octal literals
    "no-octal-escape": 0,       // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
    "no-process-env": 0,        // disallow use of process.env (off by default)
    "no-proto": 2,              // disallow usage of __proto__ property
    "no-redeclare": [2, {"builtinGlobals": false}],          // disallow declaring the same variable more then once
    "no-return-assign": 2,      // disallow use of assignment in return statement
    "no-script-url": 0,         // disallow use of javascript: urls.
    "no-self-compare": 0,       // disallow comparisons where both sides are exactly the same (off by default)
    "no-sequences": 0,          // disallow use of comma operator
    "no-unused-expressions": 0, // disallow usage of expressions in statement position
    "no-void": 0,               // disallow use of void operator (off by default)
    "no-warning-comments": 0,   // disallow usage of configurable warning terms in comments, e.g. TODO or FIXME (off by default)
    "no-with": 0,               // disallow use of the with statement
    "radix": 0,                 // require use of the second argument for parseInt() (off by default)
    "vars-on-top": 2,           // requires to declare all vars on top of their containing scope (off by default)
    "wrap-iife": 1,             // require immediate function invocation to be wrapped in parentheses (off by default)
    "yoda": 1,                  // require or disallow Yoda conditions

    ////////// Strict Mode //////////
    "strict": [2, "global"],          // controls location of Use Strict Directives

    ////////// Variables //////////
    "no-catch-shadow": 1,             // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
    "no-delete-var": 1,               // disallow deletion of variables
    "no-label-var": 1,                // disallow labels that share a name with a variable
    "no-shadow": 1,                   // disallow declaration of variables already declared in the outer scope
    "no-shadow-restricted-names": 1,  // disallow shadowing of names such as arguments
    "no-undef": 2,                    // disallow use of undeclared variables unless mentioned in a /*global */ block
    "no-undef-init": 0,               // disallow use of undefined when initializing variables
    "no-undefined": 2,                // disallow use of undefined variable (off by default)
    "no-unused-vars": 2,              // disallow declaration of variables that are not used in the code
    "no-use-before-define": 2,        // disallow use of variables before they are defined

    ////////// Node.js //////////
    "handle-callback-err": 0,   // enforces error handling in callbacks (off by default) (on by default in the node environment)
    "no-mixed-requires": 0,     // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)
    "no-new-require": 0,        // disallow use of new operator with the require function (off by default) (on by default in the node environment)
    "no-path-concat": 0,        // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)
    "no-process-exit": 0,       // disallow process.exit() (on by default in the node environment)
    "no-restricted-modules": 0, // restrict usage of specified node modules (off by default)
    "no-sync": 0,               // disallow use of synchronous methods (off by default)

    ////////// Stylistic Issues //////////
    "brace-style": 2,               // enforce one true brace style (off by default)
    "camelcase": 2,                 // require camel case names
    "comma-spacing": 0,             // enforce spacing before and after comma
    "comma-style": [2, "last"],     // enforce one true comma style (off by default)
    "consistent-this": 1,           // enforces consistent naming when capturing the current execution context (off by default)
    "eol-last": 2,                  // enforce newline at the end of file, with no multiple empty lines
    "func-names": 1,                // require function expressions to have a name (off by default)
    "func-style": [1, "declaration"], // enforces use of function declarations or expressions (off by default)
    "key-spacing": 1,               // enforces spacing between keys and values in object literal properties
    "max-nested-callbacks": 0,      // specify the maximum depth callbacks can be nested (off by default)
    "new-cap": 2,                   // require a capital letter for constructors
    "new-parens": 1,                // disallow the omission of parentheses when invoking a constructor with no arguments
    "no-array-constructor": 2,      // disallow use of the Array constructor
    "no-inline-comments": 0,        // disallow comments inline after code (off by default)
    "no-lonely-if": 0,              // disallow if as the only statement in an else block (off by default)
    "no-mixed-spaces-and-tabs": 2,  // disallow mixed spaces and tabs for indentation
    "no-multiple-empty-lines": 2,   // disallow multiple empty lines (off by default)
    "no-nested-ternary": 0,         // disallow nested ternary expressions (off by default)
    "no-new-object": 2,             // disallow use of the Object constructor
    "no-space-before-semi": 2,      // disallow space before semicolon
    "no-spaced-func": 2,            // disallow space between function identifier and application
    "no-ternary": 0,                // disallow the use of ternary operators (off by default)
    "no-trailing-spaces": 1,        // disallow trailing whitespace at the end of lines
    "no-underscore-dangle": 1,      // disallow dangling underscores in identifiers
    "no-wrap-func": 2,              // disallow wrapping of non-IIFE statements in parens
    "one-var": 0,                   // allow just one var statement per function (off by default)
    "operator-assignment": 1,       // require assignment operator shorthand where possible or prohibit it entirely (off by default)
    "padded-blocks": 1,             // enforce padding within blocks (off by default)
    "quote-props": [2, "as-needed"],               // require quotes around object literal property names (off by default)
    "quotes": [2, "double"],                    // specify whether double or single quotes should be used
    "semi": [2, "always"],                      // require or disallow use of semicolons instead of ASI
    "sort-vars": 0,                 // sort variables within the same declaration block (off by default)
    "space-after-function-name": 0, // require a space after function names (off by default)
    "space-after-keywords": 0,      // require a space after certain keywords (off by default)
    "space-before-blocks": 0,       // require or disallow space before blocks (off by default)
    "space-in-brackets": [1, "never"],         // require or disallow spaces inside brackets (off by default)
    "space-in-parens": 0,           // require or disallow spaces inside parentheses (off by default)
    "space-infix-ops": [2, {"int32Hint": false}],           // require spaces around operators
    "space-return-throw-case": 0,   // require a space after return, throw, and case
    "space-unary-ops": 0,           // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
    "spaced-line-comment": 0,       // require or disallow a space immediately following the // in a line comment (off by default)
    "wrap-regex": 0,                // require regex literals to be wrapped in parentheses (off by default)

    ////////// ECMAScript 6 //////////
    "no-var": 2,          // require let or const instead of var (off by default)
    "generator-star": 1,  // enforce the position of the * in generator functions (off by default)
  }
}

When setting the rules I went thru pretty much every rule which I don't have set to 0 to read the doc, did I miss something? Scratching my head over here.

Any help is appreciated, thanks guys!

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Jun 16, 2017

The issue is that you have a top-level ecmaFeatures property in your config file. You should remove it. (The property has been a no-op since ESLint 2.0.0.)

@tetreault

This comment has been minimized.

tetreault commented Jun 17, 2017

oh, damn. so its that simple then? did i just miss something blatant in some documentation, because the fact that that should be removed seriously escaped me. Not being snarky, I appreciate your help. I just am cobbling together a fast way to get used to Gulp and that was no where to be seen and I obviously grabbed what was a mislabeled eslintrc template to start building off of if it has relic stuff like ecmaFeatures. Anyways, thank you for the help!

@mcquiggd

This comment has been minimized.

mcquiggd commented Jun 18, 2017

In case anyone has this issue and needs a step-by-step, there is a simple couple of actions (replacing the problematic ecmaFeatures entry in the airbnb rules) on Stackoverflow ESLint “Module build failed” error with eslint-config-airbnb . (Not my answer BTW).

I can confirm it worked for me using it with eslint installed globally, with Visual Studio Code with the ESLint extension - should work for any configuration.

@Pines-Cheng

This comment has been minimized.

Pines-Cheng commented Jun 22, 2017

also have this problem,what did eslint4 changed.

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Jun 22, 2017

@urbanlegion

This comment has been minimized.

urbanlegion commented Jun 23, 2017

eslint\CHANGELOG.md

  • 051b255 Docs: Remove or rewrite references to former ecmaFeatures (Mark Pedrotti)

Guessing this is part of the issue, i'm currently trying to find the exact place where to comment out since I tried to comment ecmaFeatures out from several places with no avail.

@alp82

This comment has been minimized.

alp82 commented Jun 23, 2017

Here is what i did to get rid of the errors: airbnb/javascript#1454 (comment)

@dougajmcdonald

This comment has been minimized.

dougajmcdonald commented Jun 29, 2017

@westy92 is right, you can nest the emcaFeatures inside parserOptions:

{
  "parser": "babel-eslint",
  "plugins": [
    "react"
  ],
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true,
      "modules": true
    }
  },
...
@miltonbecker

This comment has been minimized.

miltonbecker commented Jun 29, 2017

I've just run into this issue hah
I just wanted to add that they did update the doc accordingly :) http://eslint.org/docs/user-guide/configuring

niedzielski added a commit to wikimedia/eslint-config-node-services that referenced this issue Jul 3, 2017

Fix: remove ESLint incompatible option
ecmaFeatures should be and is specified within parserOptions. Remove
duplicate conflicting outermost option which was causing the following
error in ESLint v4.1.1:

[object Object]:
        ESLint configuration is invalid:
        - Unexpected top-level property "ecmaFeatures".

Referenced from: /home/stephen/dev/wmf/wikimedia-page-library/.eslintrc.yml
Error: [object Object]:
        ESLint configuration is invalid:
        - Unexpected top-level property "ecmaFeatures".

Referenced from: /home/stephen/dev/wmf/wikimedia-page-library/.eslintrc.yml
    at validateConfigSchema (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-validator.js:187:15)
    at Object.validate (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-validator.js:200:5)
    at loadFromDisk (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:549:19)
    at load (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:592:20)
    at configExtends.reduceRight (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:421:36)
    at Array.reduceRight (native)
    at applyExtends (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:405:28)
    at loadFromDisk (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:556:22)
    at Object.load (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config/config-file.js:592:20)
    at Config.getLocalConfigHierarchy (/home/stephen/dev/wmf/wikimedia-page-library/node_modules/eslint/lib/config.js:228:44)

This change appears to be compatible with ESLint v4.1.1 and ESLint
v3.12.2.

http://eslint.org/docs/user-guide/configuring#specifying-parser-options
eslint/eslint#8726
@dbykadorov

This comment has been minimized.

dbykadorov commented Jul 11, 2017

Maybe this will be helpful for someone: in my case wrong .eslintrc has been located in c:\Users\[username]\ directory (.tslintrc, .coffeelintrc and .csslintrc also been there - i think that these files were created automatically after esint installation).

Looks like eslint loaded it first and failed. After removing this file eslint works fine.

@jvanveen

This comment has been minimized.

jvanveen commented Jul 12, 2017

Same kind of issue here. I still had an old .eslintrc in one directory up that was also read, e.g.
/projects/myproject-env/.eslintrc
/projects/myproject-env/myproject/.eslintc

Isn't it weird that the first config is also parsed, while I run eslint --config=./.eslintrc *.js from /projects/myproject-env/myproject/?

@not-an-aardvark

This comment has been minimized.

Member

not-an-aardvark commented Jul 14, 2017

I'm not sure what you mean by "linking to #8933", but both issues are closed because this is working as intended. The top-level ecmaFeatures option has been invalid since ESLint v2.0.0 (released in February 2016). ESLint now raises an error when you use an invalid config property, which is why it's raising an error here. To make your config file valid, you should remove the top-level ecmaFeatures property, and the config will be have the same way that it did in ESLint 2 and 3.

@chrisdlangton

This comment has been minimized.

chrisdlangton commented Jul 14, 2017

@not-an-aardvark i deleted my comment about 5mins before you answered me - was taking me far too long to get things working with new installs of node, npm, and figuring out packages to package-name@version that i gave up and decided not to use eslint at all.
probably worth acknowledging i tried rallycoding and airbnb configs and it's probably them who are not up-to-date or dependency locking correctly.

dstucki added a commit to webplatformz/challenge that referenced this issue Jul 14, 2017

wrap ecmaFeatures in parserOptions
as suggested here eslint/eslint#8726

(cherry picked from commit 69c82e5)
@stevekennaird

This comment has been minimized.

stevekennaird commented Jul 28, 2017

I had this problem on Windows 10 when using Visual Studio Code.

The problem was the global eslint config file found at c:\users\{username}\.eslintrc

This did have a top-level ecmaFeatures property. Sledge hammer approach of deleting that file solved it for me.

@MartinDawson

This comment has been minimized.

MartinDawson commented Aug 14, 2017

@stevekennaird Answer fixes it for the eslint vscode plugin. I also had to uninstall the vscode eslint plugin and reinstall it.

noppa added a commit to noppa/babel-plugin-angularjs-annotate that referenced this issue Nov 17, 2017

Add ESLint to dependencies and fix eslintrc
ESLint configuration option "ecmaFeatures" is now
"parserOptions.ecmaFeatures". See
eslint/eslint#8726

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.