Configure Babel in my work team

1

I am trying to follow some tutorials to learn the improvements and changes that ES6 brings, but I have taken this with the use of a transpiler, in this case, Babel.js.

On the Babel page now to install it, they recommend, for the CLI , the following line from the console

npm install -g babel-cli npm install --save-dev babel-cli

I have installed both, and when I want to transpile from the console, for example using the following form

babel --watch file-es6.js --out-file file-es5.js

And create the file, but not transpiled, just make an exact copy.

I'm using VS Code, and I get the following error messages or alerts

 'Advertencia'
message: ''template literal syntax' is only available in ES6 (use 'esversion: 6'). (W119)'
at: '3,10'
source: 'jshint'

Because, as I understand, it has not activated the recognition of ES6.

    
asked by Pedro Miguel Pimienta Morales 05.07.2017 в 05:50
source

1 answer

1

It's a warning of JSHint and to correct it you need a file .jshintrc which indicates the version of your JavaScript syntax.

{
  "esversion": 6
}

or start the file individually with:

/*jshint esversion: 6*/

// resto de código
    
answered by 05.07.2017 / 09:06
source