I'm using Sublime 3 on MacOS 10.15.7 and I'm working on a React project.
I have a package installed for JSX syntax highlighting, and it works fine if I manually set it after opening the file. By default, it starts with JavaScript highlighting every time I open the files because my component files have .js extensions. (There are reasons for this.) Is there a way for me to configure Sublime to open these project files with JSX highlighting automatically? If it helps, I also use editorconfig.
NOTE: I don't want to force Sublime to globally open ANY js file as JSX because that will cause the reverse problem with all my Node.js / JavaScript projects. I need a solution that is project-specific.
Thanks in advance!
Sort of related to: Syntax specific settings in sublime-project settings file
Just go to:
View > Syntax > Open all with current extension as ... > JavaScript >
Then select JSX. It will open all JS as JSX, you can confirm it when you see the type of the file at the bottom right of the sublime window.
With further digging, I found this package which appears to enable this feature: https://github.com/reywood/sublime-project-specific-syntax
But I'd prefer a native solution, if possible.
You can use JSCustom package.
https://github.com/Thom1729/Sublime-JS-Custom
Open the command palette
Win/Linux: ctrl+shift+p, Mac: cmd+shift+p
Type Install Package Control, press enter and
search JSCustom
After installing JSCustom
choose: Preferences → Package Settings → JS Custom → Rebuild Syntaxes
Now reopen sublimeText. It will open any js file as JSX
Related
I have never work in any vscode extension neither witch nodejs/npm
im trying to compile this extension:
gutter-preview
I have download nodejs, installed, then i download the extension source, open cmd:
cd 'folder where is the extension src' > npm install package.json
it installed and created a folder node_modules
am i doing it correctly? what's the next steps?
The easiest way will be from the extension directory in your VSCode, you can open that using one of these three ways:
a. View > Extension
b. From sidebar, click on extension icon
c. CTRL + Shift + x
Then search for "gutter preview" with quotations, you'll get one result called Image Preview, that's the extension, just click on install.
Another way is visit this url
https://marketplace.visualstudio.com/items?itemName=kisstkondoros.vscode-gutter-preview.
Then press on 'Download Extension' on the right hand side, download the file then inside your vscode open the command pallet (CTRL + Shift + p) and type:
extensions install from vsix, click that command, then choose the .VSIX file you just downloaded.
And last if you must do it from the github repo, then inside the directory where you ran npm install and found the node_modules directory, run npm run webpack-prod (a command specified in the package.json file in the root of the project folder, which describes how to build the app). Then you should find a .VSIX file in the ./dist/extension directory in the project, and you apply step 2 on the generated .VSIX file
The process to follow is the same like for any extension development. When you have the code ready to build the extension package follow the publishing guidelines.
However, instead of really publishing the downloaded extension you would just build the package using:
vsce package (see also the Usage section on this page)
If you need to debug the extension code follow the Your First Extension page (jumping over the sections that explain how to create the initial extension code). See also the follow up pages like Extension Anatomy, which explain more details you might need.
I don't know what I changed but Intellij is not detecting the npm scripts anymore. I was creating a second tsconfig file and after that it stoped working. I created a new project and cleared the cache but IntelliJ keep saying that there is no script
Please make sure that *.json pattern is assigned to either JSON or JSON5 file type in Preferences | Editor | File types
Is there a way to add the NPM NodeJS External modules so my node project modules appear in 'External Libraries' and are resolved by code completion and navigate?
Thanks
Yes, besides enabling code completion in Settings (Ctrl + Alt + S) > Languages and Frameworks > Node.js after downloading it via the Settings > Plugins section, You have to actually install the Node.js kind of manually.
First, create a basic package.json file containing all the config info needed to install Node.js,
for more info look here: https://nodejs.dev/learn/the-package-json-guide
After you've done that, simply open up the terminal emulator (Alt + f12) and type in npm install.
As long as you have the package.json file in the same directory, everything should work fine, and your IDE - webstorm in this case, should add Node's external modules automatically,to the External libraries > Node.js core section in your project tab.
Cheers.
on webstorm go to:
file
settings
javascript
libraries
download or add
I am using VIM as my text editor and Yeoman to help me with my webapp development workflow.
I am already using vim-jshint to help me lint my javascript files from within VIM and I would like to use it in sync with my Yeoman setup.
My problem is that every time I run grunt, the jshint task founds lots of errors that vim-jshint couldn't find.
I am aware vim-jshint looks for a .jshintrc file in two possible paths: the HOME path and the current working directory but, in its current state of development, vim-jshint seems to be unable to find the .jshintrc that Yeoman uses, which is located in the base directory of the webapp.
Has any of you found a solution or workaround for this?
Please, switching to Sublime Text is not an option.
Got it! I was using the wrong vim-jshint plugin.
I should have used the one that's listed in JSHint's site from the beginning, but somehow I was misled to the wrong plugins. Stupid me.
Finally, having pathogen.vim installed, I just had to copy and paste this:
cd ~/.vim/bundle
git clone git://github.com/walm/jshint.vim
As stated in its own github README file, This plugin is a front for the jshint NodeJS cli module which ensures that running :JSHint inside VIM will always report the same errors as grunt's jshint task. At least if you run VIM from the same folder where JSHint's options file (.jshintrc) is located.
Just downloaded WebStorm and giving Node.js a try.
Unfortunately the autocomplete does not seem to work.
I have set the node js interpreter to node.exe but saw a post saying that I should set it to the Node.js file. When I used Node.exe, at least the version was populated in the Node.js configuration dialog, however when I download the code and select the Node.js file I get "Version not found".
Either way, autocomplete does not work.
After doing a "File -> Invalidate cache" all appeared to work.
Delete .idea (hidden) directory from your project folder and open the project again.
"File->Invalidate cache" did not work for me.