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
This commit is contained in:
parent
5c164b6bea
commit
a3151bef1d
49
.eslintrc
49
.eslintrc
@ -46,7 +46,7 @@ env:
|
|||||||
# OpenStack uses Jasmine, not Mocha.
|
# OpenStack uses Jasmine, not Mocha.
|
||||||
# mocha: false
|
# mocha: false
|
||||||
|
|
||||||
# Openstack does not support ES6 at its present level of adoption.
|
# Enables ES6 flags in ecmaFeatures.
|
||||||
# es6: false
|
# es6: false
|
||||||
|
|
||||||
|
|
||||||
@ -847,7 +847,7 @@ rules:
|
|||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# ECMAScript 6 (All Off)
|
# ECMAScript 6
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# require braces in arrow function body
|
# require braces in arrow function body
|
||||||
# http://eslint.org/docs/rules/arrow-body-style
|
# http://eslint.org/docs/rules/arrow-body-style
|
||||||
@ -976,28 +976,29 @@ rules:
|
|||||||
no-plusplus: 0
|
no-plusplus: 0
|
||||||
|
|
||||||
|
|
||||||
# We only support ECMA5, disable everything else.
|
# 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:
|
ecmaFeatures:
|
||||||
arrowFunctions: false
|
|
||||||
binaryLiterals: false
|
# Permit return statements in the global scope.
|
||||||
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
|
globalReturn: false
|
||||||
|
|
||||||
|
# Enable global strict mode (if ecmaVersion is 5 or greater)
|
||||||
|
impliedStrict: false
|
||||||
|
|
||||||
|
# Enable JSX
|
||||||
jsx: false
|
jsx: false
|
||||||
|
|
||||||
|
# Enable support for the experimental object rest/spread properties
|
||||||
|
experimentalObjectRestSpread: false
|
||||||
|
@ -6,16 +6,6 @@ describe("Unit: eslint-config-openstack", function() {
|
|||||||
expect(config.parser).toEqual('espree');
|
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() {
|
it("should disable all environments.", function() {
|
||||||
var config = require('../index');
|
var config = require('../index');
|
||||||
expect(config.env).toBeFalsy();
|
expect(config.env).toBeFalsy();
|
||||||
|
Loading…
Reference in New Issue
Block a user