Coder Social home page Coder Social logo

learn-js's Introduction

Tour d'horizon ES 5 & ES 2015

Initialiser le répertoire

> npm init -f

IE 8

IE8 ne prend pas en charge ES5 mais sa propre variante de Javascript (JScript) basée sur ES3. La seule façon d'utiliser ES5 ou plus récent sur IE8 est de passer par une couche de compatibilité qui va émuler ES5 : es5-shim. Attention toutefois, voici ce qu'en dit Facebook :

We don't support older browsers that don't support ES5 methods, but you may find that your apps do work in older browsers if polyfills such as es5-shim and es5-sham are included in the page. You're on your own if you choose to take this path.

Babel

Babel permet de transformer (transpiler) du code ES2015 en ES5, le rendant ainsi compatible à tous les navigateurs depuis IE9 (inclus).

  • Installation
> npm install --save-dev babel-cli babel-preset-es2015
  • Fichier de configuration : .babelrc
  • Transpiler (via le script build du package.json)
> npm run build script.js

ESLint

ESLint est un descendant de JSHint et JSLint. Plus modulaire, il permet une plus grande granularité dans les options de linting proposées et peut utiliser un parser custom pour, par exemple, utiliser Babel (et donc pouvoir analyser un code dont par défaut, il ne prend pas encore en charge la syntaxe).

  • Installation
> npm install --save-dev eslint babel-eslint
  • Fichier de configuration : .eslintrc
  • Analyser (via le script lint du package.json)
> npm run lint script.js

Liens

learn-js's People

Contributors

maur1th avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.