Browse Source

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
Vitaly Kramskikh 2 years ago
parent
commit
a3151bef1d
2 changed files with 28 additions and 37 deletions
  1. 28
    27
      .eslintrc
  2. 0
    10
      spec/index.js

+ 28
- 27
.eslintrc View File

@@ -46,7 +46,7 @@ env:
46 46
   # OpenStack uses Jasmine, not Mocha.
47 47
   # mocha: false
48 48
 
49
-  # Openstack does not support ES6 at its present level of adoption.
49
+  # Enables ES6 flags in ecmaFeatures.
50 50
   # es6: false
51 51
 
52 52
 
@@ -847,7 +847,7 @@ rules:
847 847
 
848 848
 
849 849
   #############################################################################
850
-  # ECMAScript 6 (All Off)
850
+  # ECMAScript 6
851 851
   #############################################################################
852 852
   # require braces in arrow function body
853 853
   # http://eslint.org/docs/rules/arrow-body-style
@@ -976,28 +976,29 @@ rules:
976 976
   no-plusplus: 0
977 977
 
978 978
 
979
-# We only support ECMA5, disable everything else.
980
-ecmaFeatures:
981
-  arrowFunctions: false
982
-  binaryLiterals: false
983
-  blockBindings: false
984
-  classes: false
985
-  defaultParams: false
986
-  destructuring: false
987
-  forOf: false
988
-  generators: false
989
-  modules: false
990
-  objectLiteralComputedProperties: false
991
-  objectLiteralDuplicateProperties: false
992
-  objectLiteralShorthandMethods: false
993
-  objectLiteralShorthandProperties: false
994
-  octalLiterals: false
995
-  regexUFlag: false
996
-  regexYFlag: false
997
-  restParams: false
998
-  spread: false
999
-  superInFunctions: false
1000
-  templateStrings: false
1001
-  unicodeCodePointEscapes: false
1002
-  globalReturn: false
1003
-  jsx: false
979
+# Parser options are used to specify language-level options which you want to
980
+# supprt. The defaults enable ECMAScript 5, which may be overridden on a per
981
+# project basis. Please enable these settings to meet the needs of your own
982
+# project.
983
+#
984
+parserOptions:
985
+
986
+  # The ECMAScript version. Supported values are: 3, 5, 6, 7.
987
+  # ecmaVersion: 5
988
+
989
+  # Set sourceType to "module" if your project uses ES6 modules.
990
+  # sourceType: script
991
+
992
+  ecmaFeatures:
993
+
994
+    # Permit return statements in the global scope.
995
+    globalReturn: false
996
+
997
+    # Enable global strict mode (if ecmaVersion is 5 or greater)
998
+    impliedStrict: false
999
+
1000
+    # Enable JSX
1001
+    jsx: false
1002
+
1003
+    # Enable support for the experimental object rest/spread properties
1004
+    experimentalObjectRestSpread: false

+ 0
- 10
spec/index.js View File

@@ -6,16 +6,6 @@ describe("Unit: eslint-config-openstack", function() {
6 6
     expect(config.parser).toEqual('espree');
7 7
   });
8 8
 
9
-  it("should disable all ecma6 features.", function() {
10
-    var config = require('../index');
11
-
12
-    var keys = Object.keys(config.ecmaFeatures);
13
-
14
-    keys.forEach(function(key) {
15
-      expect(config.ecmaFeatures[key]).toBeFalsy();
16
-    });
17
-  });
18
-
19 9
   it("should disable all environments.", function() {
20 10
     var config = require('../index');
21 11
     expect(config.env).toBeFalsy();

Loading…
Cancel
Save