xojs / vscode-linter-xo

Linter for XO
MIT License
176 stars 29 forks source link

Allow using relative paths for settings #105

Closed flying-sheep closed 3 years ago

flying-sheep commented 3 years ago

There’s two possible ways to go about this:

One step in the resolution of #71

flying-sheep commented 3 years ago

@sindresorhus which one would you prefer? I could do a quick PR.

spence-s commented 3 years ago

I'm willing to support/merge this if you want to make a PR @flying-sheep seems like a reasonable use case to me.

The only line that would need to be changed is this: https://github.com/xojs/vscode-linter-xo/blob/master/server/server.js#L464

I don't think we should use the same variable substitution that vscode uses, because I don't think we need to support any token other than workspace folder. Maybe a token like? "path": "WORKSPACE_FOLDER/path/to/xo"

A relative path would be fine too - it just needs to be clear in the docs that if you supply an absolute path it must be in file uri format and the path will always be relative to the folder root.

Will need to change this as well: https://github.com/xojs/vscode-linter-xo/blob/master/package.json#L82

flying-sheep commented 3 years ago

I’d prefer a relative path to a custom placeholder. The ${workspaceFolder} idea was because it’s familiar, but so is using a relative path (e.g. for eslint.nodePath)

spence-s commented 3 years ago

sounds good @flying-sheep - I will take care of this later today If I don't see a PR.

spence-s commented 3 years ago

@flying-sheep this is published now 3.7.0 - I went ahead an added a couple of lines to deprecate the file uri and made the option take an absolute path or a relative path because I felt this made more sense. Thanks for your help!

flying-sheep commented 3 years ago

great, thank you!