How to fix Sublime text highlighting for react-tutorial? - javascript

I recently started the official reactjs tutorial and noticed that the sublime text highlighting is completely screwed.
How can i fix this?

Install babel with the package control package, if you don't have it, get it here.
Open the package control, select install package, type babel, select it and press enter.
Setting as the default syntax
To set it as the default syntax for a particular extension:
Open a file with that extension, Select View from the menu, Then
Syntax -> Open all with current extension as... -> Babel ->
JavaScript (Babel). 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

Follow this link to install the package manager for sublime text
Now to open the command palette, press ctrl+shift+p (Win, Linux) or cmd+shift+p (OS X). From the search results select Package Control: Install Package. Now find and select packages Babel and Babel Snippets.
Now to enable proper syntax highlighting for your JSX code, open your .js/.jsx file, select View -> Syntax -> Open all with current extension as... -> Babel -> JavaScript (Babel).

Installing the following sublime package should fix those problems:
https://github.com/babel/babel-sublime

Install babel via the package control. It'll fix the syntax highlighting and adds few more features.
check https://packagecontrol.io/packages/Babel

Related

How to install JSLint plugin on Notepad++?

I downloaded JSLintNPP.0.8.3 from https://sourceforge.net/projects/jslintnpp/
,now what I see is a .dll file and am not sure about how to install the plugin on my Notepad++.
If you want to do an offline manual install without the Plugin manager.
Just locate the plugins dir within your NotePad++ installation and copy the dll there.
Open up notepad ++, go to plugins, locate plugin manager then show plugin manager.
A window will pop up, on the available tab type J and you should see JSLint, tick it and then press install.

JavaScript syntax in sublime text is missing?

I was trying to add JavaScript syntax and I can't find it.
Go to Sublime Text -> Preferences -> Settings and then in the right panel (Preferences.sublime-settings-settings -- User) remove "Javascript" from the "ignored_packages".
This version of Sublime does include a default Syntax viewer via a package. Verify that the file:
./Contents/MacOS/Packages/JavaScript.sublime-package
exists within your Sublime text install. (The above is for OSX. There is a similar path on Windows). If the file is missing, you may have to reinstall or find the package on the Internet.
A simple work-around would be to install a package such as https://packagecontrol.io/packages/JavaScript%20Ultimate. This has an improved syntax highlighter over the standard syntax highlighter.

How can I run script.js in Eclipse console?

Is it possible to do the same as this in Eclipse what he is doing in Intellij IDEA? to run the javascript file in console?
To set up Eclipse to run JavaScript files:
In Eclipse, got to Run > External Tools > External Tool Configurations
Double click on Program to open a new configuration and name your new configuration (ex. Node_Config)
Figure out where you have node.js installed. Paste the results in the 'Location' box in Eclipse. (If you haven't installed node, do so here)
Mac: in the command line, run which node.
Windows: in the command line, run where node, or see this for more/different windows advice
Fill in the following:
Working Directory: ${container_loc}
Arguments: ${resource_name}
Click apply, and then close.
Now, in the main Eclipse screen, find the play button with a red toolbox (next to the regular play button). When you have a js file open that you want to run, click this and it will be just like running it from your console using node.
Since Eclipse Neon you can do that. I suggets you that you
download Eclipse Neon and install Eclipse JEE Neon distribution.
install node.js.
With Eclipse JEE Neon, you will benefit with Run As / Node.js Application and even with Debug As / Node.js Application:
He is using WebStorm which is editor for Front-end dev from same company (JetBrains).

Coffeescript text highliting with Eclipse

I have a Coffeescript project that I'd like to edit using Eclipse.
Many people suggested that I should install the Nodeclipse Coffeescript Viewer module in order to have colors and highlights.
I did install the module but I'm still getting a plain black and white file.
What should I do?
Thanks!
PS : I have Eclipse Luna under Win7.
Seems like you have not installed well, reinstall
http://marketplace.eclipse.org/content/nodeclipse-coffeescript-viewer-editor-eclipse-431
You would get editor for .coffee files by default.
Also Nodeclipse EditBox helps a lot to see indentation
If this is not a new file, right-click on it and look in the "Open With..." menu. Eclipse will reopen the same editor you used the last time for a given file.

How to turn on Sublimelinter in Sublime Text 2 (on a mac)

I've been trying for some time to get SublimeLinter to start, but don't really see it do anything.
I downloaded it here: https://github.com/SublimeLinter/SublimeLinter
Installed with Sublime Package Control http://wbond.net/sublime_packages/package_control
It added SublimeLinter under Sublime Text 2 > Preferences > Package Settings
It shows me the README.md and it gives me a Package Control message where it says that SublimeLinter by default runs in the background.
But when I try typing in some syntax errors it doesn't say a word or hint that something is wrong. Nor when I save.
What's up? Where is the on-switch that I missed?
Thanks
I encountered this error on Linux when installing from package manager (old version). The solution was to download the last version from Github and manually copy it in packages folder.
You'll see that the size of the folder containing indexes for the language scanned (PHP in my case) is incrementing.

Categories

Resources