Skip to content

Syntax definitions for ES6 JavaScript with React JSX extensions.

License

Notifications You must be signed in to change notification settings

F2Ealexis/babel-sublime

 
 

Repository files navigation

babel-sublime (previously 6to5-sublime)

Language definitions for ES6 JavaScript with React JSX syntax extensions, and snippets for common React constructs (like lifecycle methods) in ES6.

Installation

Find it as Babel through Package Control.

Setting as the default syntax

To set it as the default syntax for a particular extension:

  1. Open a file with that extension,
  2. Select View from the menu,
  3. Then Syntax -> Open all with current extension as... -> Babel -> JavaScript (Babel).
  4. Repeat this for each extension (e.g.: .js and .jsx).

Setting a Color Scheme

Babel comes bundled with Next and Monokai from Benvie/JavaScriptNext.tmLanguage. Select one from Preferences -> Color Scheme -> Babel

Screenshots

babel-sublime-vs-sublime-react--react-class

babel-sublime-vs-sublime-react--jsx-comments-etc

  • babel-sublime correctly matches JSX comments between attributes, namespaced components, and non-alpha characters in tag/attribute names.

babel-sublime-vs-sublime-react--jsx-illegal

  • Illegal JSX attribute names; missing equals, quotes or braces; and missing values, are highlighted to easily spot mistakes.

babel-sublime-vs-sublime-react--jsx-tight

  • Greater-/less-than comparisons are correctly identified as such and not mistaken for JSX tags.

Snippets

Find them in SNIPPETS.md

Suggested Resources

Sublime Text Color Scheme which is ready for JavaScript's new features and babel-sublime package.

About

Under the hood, babel-sublime is based on the excellent Benvie/JavaScriptNext.tmLanguage with JSX syntax support built on top. The initial definitions for JSX came from reactjs/sublime-react via yungters/sublime - but we've added a few improvements like support for JSX namespaces, comments between JSX attributes and invalid attribute matching.

Contributing

Pull Requests should include your changes to the respective YAML-tmKittens file as well as the converted tmKittens file. Use AAAPackageDev to convert the YAML-tmKittens files.

About

Syntax definitions for ES6 JavaScript with React JSX extensions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%