vscode-postcss-sorting icon indicating copy to clipboard operation
vscode-postcss-sorting copied to clipboard

Support for Regexp expression in settings.json

Open ghost opened this issue 8 years ago • 2 comments

Environment

  • VSCode Version: 1.20.0-insider (1.20.0-insider)
  • OS Version: 10.13.3

Actual behavior

not support for Regexp expression in settings.json

Expected behavior

support for Regexp expression in settings.json

Steps to reproduce

i would like to add some regexp expressions to selector property(existed in settings.json)

{
	"postcssSorting.config": {
    "order": [
	        "custom-properties",
	        "dollar-variables",
	        "declarations",
	        {
	            type: "rule",
	            selector: /^&/
	        }
	    ]
	}
}

After searching, I find it is impossible to realize the above feature. I has become increasingly frustrated. Here is some technical details for JSON

ghost avatar Jan 30 '18 06:01 ghost

Hello, @liuliangsir,

As you see the settings is just a JSON file. And yeap, it is impossible to realize the above feature. But you can use one of format of configs: https://github.com/mrmlnc/vscode-postcss-sorting/blob/master/src/extension.ts#L15-L20 (for example, JS file).

mrmlnc avatar Jan 30 '18 06:01 mrmlnc

@mrmlnc could you provide an example of using JS file as a config please?

v1z avatar Apr 21 '18 08:04 v1z