From a3151bef1d75b847456f021d57b4fda3a0e18746 Mon Sep 17 00:00:00 2001 From: Vitaly Kramskikh Date: Wed, 11 May 2016 20:14:03 +0300 Subject: [PATCH] Update descriptions of ES6-related options OpenStack starts to support ES6, so the config has been updated with instructions how to enable ES6 support. "ecmaFeatures" were moved under "parserOptions" as it's required by ESLint 2.x, all ES6-related flags were removed as they're enabled using env.es6. Change-Id: I5531534e2ab12ece0859816679aa19deb974957e --- .eslintrc | 55 ++++++++++++++++++++++++++------------------------- spec/index.js | 10 ---------- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2c821ce..2e9dda8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -46,7 +46,7 @@ env: # OpenStack uses Jasmine, not Mocha. # mocha: false - # Openstack does not support ES6 at its present level of adoption. + # Enables ES6 flags in ecmaFeatures. # es6: false @@ -847,7 +847,7 @@ rules: ############################################################################# - # ECMAScript 6 (All Off) + # ECMAScript 6 ############################################################################# # require braces in arrow function body # http://eslint.org/docs/rules/arrow-body-style @@ -976,28 +976,29 @@ rules: no-plusplus: 0 -# We only support ECMA5, disable everything else. -ecmaFeatures: - arrowFunctions: false - binaryLiterals: false - blockBindings: false - classes: false - defaultParams: false - destructuring: false - forOf: false - generators: false - modules: false - objectLiteralComputedProperties: false - objectLiteralDuplicateProperties: false - objectLiteralShorthandMethods: false - objectLiteralShorthandProperties: false - octalLiterals: false - regexUFlag: false - regexYFlag: false - restParams: false - spread: false - superInFunctions: false - templateStrings: false - unicodeCodePointEscapes: false - globalReturn: false - jsx: false +# Parser options are used to specify language-level options which you want to +# supprt. The defaults enable ECMAScript 5, which may be overridden on a per +# project basis. Please enable these settings to meet the needs of your own +# project. +# +parserOptions: + + # The ECMAScript version. Supported values are: 3, 5, 6, 7. + # ecmaVersion: 5 + + # Set sourceType to "module" if your project uses ES6 modules. + # sourceType: script + + ecmaFeatures: + + # Permit return statements in the global scope. + globalReturn: false + + # Enable global strict mode (if ecmaVersion is 5 or greater) + impliedStrict: false + + # Enable JSX + jsx: false + + # Enable support for the experimental object rest/spread properties + experimentalObjectRestSpread: false diff --git a/spec/index.js b/spec/index.js index 3a0c26b..d9ba627 100644 --- a/spec/index.js +++ b/spec/index.js @@ -6,16 +6,6 @@ describe("Unit: eslint-config-openstack", function() { expect(config.parser).toEqual('espree'); }); - it("should disable all ecma6 features.", function() { - var config = require('../index'); - - var keys = Object.keys(config.ecmaFeatures); - - keys.forEach(function(key) { - expect(config.ecmaFeatures[key]).toBeFalsy(); - }); - }); - it("should disable all environments.", function() { var config = require('../index'); expect(config.env).toBeFalsy();