Skip to content

Commit

Permalink
Update: no-unsupported-features get supporting Node 6 (fixes #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Apr 27, 2016
1 parent 361d82f commit cf8246a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 46 deletions.
2 changes: 2 additions & 0 deletions docs/rules/no-unsupported-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This rule accepts the following version number:
- `0.12`
- `4`
- `5`
- `6`

The following patterns are considered problems:

Expand Down Expand Up @@ -228,4 +229,5 @@ If you don't want to restrict features, then it's safe to disable this rule.

## Further Reading

- http://node.green/
- http://kangax.github.io/compat-table/es6/
2 changes: 1 addition & 1 deletion lib/rules/no-unsupported-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var getValueIfString = require("../util/get-value-if-string");
// Helpers
//------------------------------------------------------------------------------

var VERSIONS = [0.10, 0.12, 4, 5];
var VERSIONS = [0.10, 0.12, 4, 5, 6];
var OPTIONS = Object.keys(features);
var FUNC_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/;
var CLASS_TYPE = /^Class(?:Declaration|Expression)$/;
Expand Down
42 changes: 21 additions & 21 deletions lib/util/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ module.exports = {
"defaultParameters": {
alias: ["syntax"],
name: "Default Parameters",
node: NaN
node: 6
},
"restParameters": {
alias: ["syntax"],
name: "Rest Parameters",
node: NaN
node: 6
},
"spreadOperators": {
alias: ["syntax"],
Expand Down Expand Up @@ -58,17 +58,17 @@ module.exports = {
"regexpY": {
alias: ["syntax"],
name: "RegExp 'y' Flags",
node: NaN
node: 6
},
"regexpU": {
alias: ["syntax"],
name: "RegExp 'u' Flags",
node: NaN
node: 6
},
"destructuring": {
alias: ["syntax"],
name: "Destructuring",
node: NaN
node: 6
},
"unicodeCodePointEscapes": {
alias: ["syntax"],
Expand All @@ -84,23 +84,23 @@ module.exports = {
alias: ["syntax"],
name: "'const' Declarations",
node: {
sloppy: NaN,
sloppy: 6,
strict: 4
}
},
"let": {
alias: ["syntax"],
name: "'let' Declarations",
node: {
sloppy: NaN,
sloppy: 6,
strict: 4
}
},
"blockScopedFunctions": {
alias: ["syntax"],
name: "Block-Scoped Functions",
node: {
sloppy: NaN,
sloppy: 6,
strict: 4
}
},
Expand All @@ -118,14 +118,14 @@ module.exports = {
alias: ["syntax"],
name: "Classes",
node: {
sloppy: NaN,
sloppy: 6,
strict: 4
}
},
"modules": {
alias: ["syntax"],
name: "Import and Export Declarations",
node: NaN
node: 6
},

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -220,13 +220,13 @@ module.exports = {
alias: ["runtime", "globalObjects"],
name: "'Proxy'",
singular: true,
node: NaN
node: 6
},
"Reflect": {
alias: ["runtime", "globalObjects"],
name: "'Reflect'",
singular: true,
node: NaN
node: 6
},
"Promise": {
alias: ["runtime", "globalObjects"],
Expand Down Expand Up @@ -448,7 +448,7 @@ module.exports = {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.isConcatSpreadablec'",
singular: true,
node: NaN
node: 6
},
"Symbol.iterator": {
alias: ["runtime", "staticMethods", "Symbol.*"],
Expand All @@ -466,37 +466,37 @@ module.exports = {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.replace'",
singular: true,
node: NaN
node: 6
},
"Symbol.search": {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.search'",
singular: true,
node: NaN
node: 6
},
"Symbol.split": {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.split'",
singular: true,
node: NaN
node: 6
},
"Symbol.match": {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.match'",
singular: true,
node: NaN
node: 6
},
"Symbol.toPrimitive": {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.toPrimitive'",
singular: true,
node: NaN
node: 6
},
"Symbol.toStringTag": {
alias: ["runtime", "staticMethods", "Symbol.*"],
name: "'Symbol.toStringTag'",
singular: true,
node: NaN
node: 6
},
"Symbol.unscopables": {
alias: ["runtime", "staticMethods", "Symbol.*"],
Expand All @@ -509,7 +509,7 @@ module.exports = {
alias: ["runtime", "extends"],
name: "Subclassing of 'Array'",
singular: true,
node: NaN
node: 6
},
"extendsRegExp": {
alias: ["runtime", "extends"],
Expand All @@ -521,7 +521,7 @@ module.exports = {
alias: ["runtime", "extends"],
name: "Subclassing of 'Function'",
singular: true,
node: NaN
node: 6
},
"extendsPromise": {
alias: ["runtime", "extends"],
Expand Down

0 comments on commit cf8246a

Please sign in to comment.