All Projects → joshpeng → Sublime-Babel-VSCode

joshpeng / Sublime-Babel-VSCode

Licence: MIT license
Sublime Text's babel-sublime grammar in VS Code.

Projects that are alternatives of or similar to Sublime-Babel-VSCode

PERN-Advanced-Starter
Advanced PERN stack starter kit (PostgresSQL, Express, React, & Node), complete with ESLint, Webpack 4, Redux, React-Router, and Material-UI kit.
Stars: ✭ 51 (+10.87%)
Mutual labels:  babel-es6
boilerplate-react-redux-pwa
It's sample boilerplate with pwa + react + redux + redux-saga
Stars: ✭ 14 (-69.57%)
Mutual labels:  babel-es6
boilerplate-frontend
Frontend Boilerplate for projects
Stars: ✭ 20 (-56.52%)
Mutual labels:  babel-es6
webpack-4-react-bootstrap-starter-template
Starter boilerplate template for webpack 4 with React, Bootstrap 4
Stars: ✭ 16 (-65.22%)
Mutual labels:  babel-es6

Sublime Babel VS Code marketplace button

When using your favorite theme, Visual Studio Code doesn't always display syntax highlight colors as expected. This extension tries to mimic Sublime Text's babel-sublime package as much as possible to address poor coloring.

With VS Code 1.9.0, a new token flattenizer will be implemented that finally allows VS Code to properly follow TextMate grammar rules. This significantly improves syntax highlighting with preexisting tmThemes from other editors. However, the default JavaScript grammar still needs some work to match Sublime Text. This extension solves that for you.

Installation

  1. Uninstall any preexisting JavaScript grammar extensions (e.g. Latest TypeScript and JavaScript Grammar, Babel ES6/ES7) to prevent conflicts
  2. Install Sublime Babel via ext install sublime-babel-vscode in Command Palette
  3. When opening a .js or .jsx file, ensure the language mode is set to JavaScript (Babel) or JavaScript React (Babel)

statusbar

Suggested Color Themes

For best results, please consider using these optimized themes. Other ported themes will work too, but may not necessarily handle the differences between Sublime and VS Code properly.

One Dark

Charcoal Oceanic Next

Comparisons

Here is a quick example of the improved grammar compared against the popular Babel ES6/ES7 extension on the marketplace. Notice how Babel ES6/ES7 handles comments and strings incorrectly.

Babel ES6/ES7

Sublime Babel

React

Note: These screenshots and case scenarios are old, but the premise is still valid. Other grammars do not fully tokenize like how Sublime does it.

Changelog

Please see here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].