babel-plugin-check-es2015-constants
Advanced tools
Comparing version 6.8.0 to 6.22.0
@@ -1,2 +0,2 @@ | ||
/*istanbul ignore next*/"use strict"; | ||
"use strict"; | ||
@@ -9,9 +9,9 @@ exports.__esModule = true; | ||
exports.default = function ( /*istanbul ignore next*/_ref) { | ||
/*istanbul ignore next*/var messages = _ref.messages; | ||
exports.default = function (_ref) { | ||
var messages = _ref.messages; | ||
return { | ||
visitor: { /*istanbul ignore next*/ | ||
visitor: { | ||
Scope: function Scope(_ref2) { | ||
/*istanbul ignore next*/var scope = _ref2.scope; | ||
var scope = _ref2.scope; | ||
@@ -22,4 +22,3 @@ for (var name in scope.bindings) { | ||
for ( /*istanbul ignore next*/var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { | ||
/*istanbul ignore next*/ | ||
for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { | ||
var _ref3; | ||
@@ -46,5 +45,4 @@ | ||
/*istanbul ignore next*/ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
module.exports = exports["default"]; |
{ | ||
"name": "babel-plugin-check-es2015-constants", | ||
"version": "6.8.0", | ||
"version": "6.22.0", | ||
"description": "Compile ES2015 constants to ES5", | ||
@@ -12,7 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-check-es2015-constants", | ||
"dependencies": { | ||
"babel-runtime": "^6.0.0" | ||
"babel-runtime": "^6.22.0" | ||
}, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "^6.8.0" | ||
"babel-helper-plugin-test-runner": "^6.22.0" | ||
} | ||
} |
# babel-plugin-check-es2015-constants | ||
Validate ES2015 constants | ||
Validate ES2015 constants (prevents reassignment of const variables). | ||
## Example | ||
**In** | ||
```js | ||
const a = 1; | ||
a = 2; | ||
``` | ||
**Out** | ||
```bash | ||
repl: "a" is read-only | ||
1 | const a = 1; | ||
> 2 | a = 2; | ||
| ^ | ||
``` | ||
[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015&experimental=false&loose=false&spec=false&code=const%20a%20%3D%201%3B%0Aa%20%3D%202%3B&playground=true) | ||
## Installation | ||
```sh | ||
$ npm install babel-plugin-check-es2015-constants | ||
npm install --save-dev babel-plugin-check-es2015-constants | ||
``` | ||
@@ -26,3 +46,3 @@ | ||
```sh | ||
$ babel --plugins check-es2015-constants script.js | ||
babel --plugins check-es2015-constants script.js | ||
``` | ||
@@ -40,2 +60,2 @@ | ||
This check will only validate consts. If you need it to compile down to `var` then you must also install and enable [`transform-es2015-block-scoping`](../babel-plugin-transform-es2015-block-scoping). | ||
This check will only validate consts. If you need it to compile down to `var` then you must also install and enable [`transform-es2015-block-scoping`](http://babeljs.io/docs/plugins/transform-es2015-block-scoping/). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2811
60
32
Updatedbabel-runtime@^6.22.0