In vscode prettier, how to use default settings if no config present in directory - prettier

If I set no value to "prettier.configPath": "" then it will use the default settings I set for the extension, but if I set it to "prettier.configPath": "prettier.config.js", then it uses the config file.
How do I set it so it uses the default settings, but the config if present in directory?

Related

Generate shell doesn't work on Windows Toolbox

I enabled Generate shell script on Toolbox and I am sure have added the C:\Windows to path environment variables.
But it claims the webstorm is not a program, why?
You need to add the path that you used to export the generated shell scripts.
Ex.: If you set the path of the "Generate shell scripts" option to "C:/Shell Scripts" (without quotes of course); You need to add this path to your environment variables
What about changing your shell location to A custom path but not the system's path(e.g. c:\myshells)
then add your path to the system environment.
The "Select" function of my toolbox is not working, I need to fill the path on myself.

Overriding Conan Storage directory

I am trying to use conan for a dummy C++ project (language irrelevant here), but I don't like to mess with the user's home directory. By default, conan install will use ~/conan/data as specified by ~/conan/conan.conf:
[storage]
# This is the default path, but you can write your own. It must be an absolute path or a
# path beginning with "~" (if the environment var CONAN_USER_HOME is specified, this directory, even
# with "~/", will be relative to the conan user home, not to the system user home)
path = ~/.conan/data
Is there a way to override the storage directory to a local one?
I have tried to add a [storage] section to a profile I created but apparently conan doesn't like it (`ERROR: Error reading './locally' profile: ConfigParser: Unrecognized field 'storage').

WebStorm: configure Prettier to use tabs?

The Prettier docs say to use --use-tabs to override the default behavior. WebStorm automatically populated the Prettier package:
That's a folder. I tried changing it to npm\prettier.cmd and adding the switch, but that doesn't work (It just turns red).
How can I set WebStorm to use tabs with Prettier?
If your project has a .editorconfig file, you can override the indent_style setting in there.
# top-most EditorConfig file
root = true
[*]
indent_size = 4
indent_style = tab
I found these resources helpful too:
https://prettier.io/docs/en/options.html#tabs
https://editorconfig.org/
Due to https://github.com/prettier/prettier/pull/2434 fix, Prettier (even global!) uses configuration file nearest to current file (up the directory tree) when formatting.
So, you can install it globally and configure it in your project, by adding the corresponding .prettierrc file or "prettier" section in project package.json.

Autocomplete import paths WebStorm

I have a create-react-app and I have NODE_PATH = src/ in my .env file to make import paths of common components simpler. But WebStorm isn't recognizing it and wont autocomplete any of them like it does if I were to import ../../Common/foo or how it autocompletes node modules import Button from 'material-ui/Button always gives me a long list of material-ui components and helps make sure I don't have any typos.
Is there a way I can configure this in WebStorm?
You can try setting NODE_PATH in default Node.js run configuration to get it respected - see https://youtrack.jetbrains.com/issue/WEB-19476#comment=27-1255547:
in Run | Edit configurations, expand Defaults node, select Node.js
in default Node.js run configuration, press ellipsis button next to Environment variables: field
add NODE_PATH variable there, specify a full path to src folder as a value
in Project tool window, mark src folder as Resource root
reopen the project

Configure maintenance_template_path for 'capistrano-maintenace' gem

In the capistrano/maintenance gem, I'm having trouble setting the path for the :maintenance_template_path variable.
I've tried
# Set the maintenance file path
set :maintenance_template_path, '/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance'
set :maintenance_template_path, '/app/views/errors/maintenance'
set :maintenance_template_path, '/errors/maintenance.erb.html'
set :maintenance_template_path, '/views/errors/maintenance.erb.html'
set :maintenance_template_path, 'app/views/errors/maintenance.erb.html'
I keep getting No such file or directory # rb_sysopen error.
The file is in the correct spot /Users/David/Documents/Development/myRailsApp/app/views/errors/maintenance.erb.html
What is the correct configuration?
It requires an absolute path. Assuming you are using config/deploy.rb, then you could do this:
set :maintenance_template_path,
File.expand_path("../../app/views/errors/maintenance.erb.html", __FILE__)