How to export jshint config file from WebStorm - configuration

I used to work alone on a project. I used to use WebStorm's JSHint plugin for code quality testing.
Now couple of friends joined me so I thought to create a .jshintrc file for all of us to use. But it is quite boring to do it manually and I'm perfectly happy with my current settings.
Is there a way to export my project-wide settings in order to share it with co-worker?

JSHint configuration from Settings(Preferences) | Languages & Frameworks | JavaScript | Code Quality Tools | JSHint is stored in <project_dir>\.idea\jsLinters\jshint.xml. You can share this file with your co-workers

Related

Create Vanila HTML / JS project inside PhpStorm where PHP has already been configured

I use Storm daily for PHP/Laravel, and hence have PHP configured. When I want to create a vanilla HTML / JS side project, Storm takes it upon itself to add the PHP libraries without asking. I don't want any PHP Libraries. When initially creating the project, I used "empty project".
Here is a screen shot to illustrate.
So, how to create an empty project without PHP libraries?
You are using PhpStorm, an IDE that supports PHP. That entry that you see there is a list of stubs for PHP (the stuff that IDE knows about core PHP and other common extensions: classes/functions/constants etc).
AFAIK it always will be there (as it's a PHP oriented IDE) and you cannot remove it. But you try this:
Settings (Preferences on macOS)
Languages & Frameworks | PHP
PHP Runtime tab
Uncheck ALL entries there.
If the above will not get rid of the whole node then you will have to ignore that entry. And I do not see any problems in having it here: it will not affect your JS/HTML in any way.
P.S. Whatever will be in a default/new project can be configured at File | New Projects Settings | Settings for New Projects...

How to attach a project without mixing class declarations in PhpStorm?

I like PhpStorm's ability to attach multiple projects to the current window:
I've noticed, however, that all classes declared in both projects are available in both projects, which can lead to duplicate declarations:
I understand how this can be useful at times, however I'd like to attach projects just to navigate easily between them (I prefer this to switching windows), while keeping them separate as if they were in separate windows.
Is this possible?
Currently IDE does not have "scoped indexing" that may be able to resolve this. Right now you would need to exclude such duplicate files or tell IDE to not to treat them as PHP so they do not get indexed as such.
Your current options:
Use Mark Directory As | Excluded via context menu in Project View panel (or manually via Settings (Preferences on macOS) | Directories) for a folder(s) from additional project.
Mark individual files as Plain Text via context menu in Project View panel. The downside: such "marking" is IDE-wide as far as I know, so the same file path will be excluded in another project as well.
Any other exclusion mechanic that is currently available (e.g. Settings (Preferences on macOS) | Editor | File Types | Ignore files and folders -- global as well and based on file name only and file will be completely ignored from all operations... so not really acceptable for your case).
Consider watching after https://youtrack.jetbrains.com/issue/WI-17646 (star/vote/comment) and related tickets to get notified on any progress.
If they are the same classes, have you thought about making a composer package for them? Would be easier to manage it all I think.

JSCS can not find jscs files on PhpStorm and WebStorm

I work adonis.js. I have a problem. When I open adonis project in WebStorm and PhpStorm, editors create a problem "jscs can not find".
It is a general view. I try on both editor.
The same problem occur. I search it on the Google, they say we solve the problem, but it is alive.
Please try disabling JSCS support by clearing Enable checkbox in Settings | Languages & Frameworks | JavaScript | Code Quality Tools | JSCS - can you still see the error?
Also, from screenshot it seems that ES6 syntax in your file is not accepted; please make sure to switch Javascript Language version (Settings | Languages & Frameworks | JavaScript) to ECMAScript 6

What is the proper way to set modifiable install path in PackageMaker?

First of all, I'm talking about PackageMaker, a GUI application; not packagemaker, a command-line program.
I'm trying to make a install package that has three components, installed in different locations:
XxxxBin.app application, default installed to /Applications;
Xxxx.bundle plugin bundle, default installed to /Library/Audio/Plug-Ins/VST/ (and renamed to Xxxx.vst, which is very easy to be achieved by using post-install script);
some resource files, default installed in /Library/Company/Xxxx_resources/.
And I want to allow users to change target directories of each compnent during installation.
I noticed there are two layers in PackageMaker: choice and package. When you drag an app/bundle/directory into PackageMaker, it will create a new choice and a new package. However, both choice and package layer contains Destination, which greatly confused me. In addition, in Components page for packages that is derived from an app or bundle, there is a check box labelled "Allow Relocation", which introduced further confusion.
I failed to find detailed information on those options. And after many attempts, I'm using the following layout and combination of options, that are very close to my target:
three choices and packages, each contain the app, the bundle, or the directory of resources.
in all choice layers, fill the Destination entry with actual default install paths, and select the "Allow alternate volume" checkbox;
in all package layers, fill the Destination entry with /, and select the "Allow custom location" checkbox;
in all Components page in package layers, deselect all Allow Relocation checkbox.
However, it still has a very weird behavior: the app is copied twice, to both its own directory, and overwriting the directory of the plugin bundle. If you "show content" on the installed bundle, it will look something like this:
/Library/Audio/Plug-Ins/VST/Xxxx.vst
|
+contents
|
+-info.plist: after looking on its content, it is actually the app's plist, not the bundle's
|
+-MacOS
| |
| +-Xxxx: the bundle's dynamic library, which is expected to be here
| |
| +-XxxxBin: the app's executable, which is NOT expected to be here
|
+-Resources
|
+-Xxxx.xml: some config info for the bundle, which is expected to be here
|
+-icon.icns: the app's icon, which is NOT expected to be here
I am quite exhausted on this stuff, but still not reaching my target that looks pretty simple: user-changeable install directory for multiple components. It's really appreciate for someone who can drag me out of this quagmire. Thanks for a lot!
Finally I found the actual cause is not in PackageMaker stuffs, but is inside the bundles being packaged. The bundle identifier of both the app and the plugin is empty. After I assign them with distinct values, everything just work fine.

Configure PHP CodeSniffer to fix code on the fly in PhpStorm

I have PhpStorm 10 and want to setup php Code Sniffer to automatically correct me code. This article https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm points to "Project Settings | Code Style" and I cannot even find that. I have File | Edit | View | Navigate | Code | Refactor | Run | Tools | VCS | Window | Help at the top and have no idea where to find project settings. I do have File > Settings but cannot figure it out.
My project is a web portal built in Symfony. I saw a colleague run Atom and when he saves a file it is code-fixed on the fly - that is what I want. Help please.
PhpStorm does not support code fixing on the fly with Code Sniffer.
https://youtrack.jetbrains.com/issue/WI-25815 -- watch this ticket (star/vote/comment) to get notified on any progress.
Right now, if you wish you may create an External Tools entry for that and run it manually when needed.
Find this from web (how to config the external tools)
https://thiagoponte.wordpress.com/2015/08/03/run-php-codesniffer-code-beautifier-and-fixer-from-phpstorm/