Sublime Forum

How to change package-settings on a project basis?

#1

Heyho partypeople;

I installed JsPrettier and love it!

Now I’m working on a project where the lead developer has very strict rules, like “strings only in single quotes” – On another project the lead wants double quotes though…

So I need to overwrite this JsPrettier setting for this particular project.

In this thread Package settings per project people request the same, and I hope that now, years later, this is somehow achievable. If not natively, maybe with a package that extends ST3 with this functionality?

{
	"folders":
	[
		{
			"path": "website/src"
		},
		{
			"path": "website/wordpress"
		}
	],
	"settings": {
		"tab_size": 2,
		"translate_tabs_to_spaces": true,
                "singleQuote": true, // won't work since the global settings don't know this setting
	}
}
0 Likes

#2

Did you take a look at editorconfig project and its package EditorConfig? It may not be exactly what you’re looking for, but it’s better than nothing, also being syntax oriented you can have, other than per project settings, also per project > per language settings (eg. project 1 with 2 spaces indent global + 3 spaces indent for .scss files, project 2 with tabs indent global & 2 spaces for .js/.css and so on)…
For single/double quotes you can try a linter (like jshint/jslint/eslint with sublimelinter) they usually also have a “fix” flag to auto correct issues (or as I do, try to use the right quotation from the start :wink: ).

0 Likes