-
Notifications
You must be signed in to change notification settings - Fork 1
Adds schema validation & coding assistance for .pug-lint.json files #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work, but please, correct specified comments. Thanks 👍 🥇
| } | ||
| } | ||
| }, | ||
| "languages": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed, because VS Code uses the schema automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still necessary. For files without a .json extension, VSCode defaults to "Plain Text" language mode, which means it does not use the JSON schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, sounds reasonable 👍
| @@ -0,0 +1,456 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update schemas? Or this is last version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since pugjs/pug-lint#121 was merged, the schema is now included in the pug-lint package, so I think we can update this to reference the schema within node_modules/pug-lint and avoid duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use pug-lint from workspace or global node_modules directory. VS Code can't use these files, because it's not a static files (we don't know path in advance).
| } | ||
| ], | ||
| "jsonValidation": [ | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use one glob-pattern for all files. For example, .{pug,jade}-lint{rc,}{.json,} or *{pug,jade}-lint{rc,}{.json,}. But test it, because i'm not sure that VS Code support glob with brackets 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I had to write the "jsonValidation" array this way because fileMatch can't be a glob.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it works for me in vscode-csscomb, for example, https://github.com/mrmlnc/vscode-csscomb/blob/master/package.json#L76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's wildcard matching but not necessarily globbing. Or, as you said, it's a limited form of globbing that doesn't support brackets. I tested this morning with brackets and they didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification! 👍
|
Hello, @cspotcode, I added a few comments, if you agree with me, then please correct them, if not, then I am ready to discuss them. |
This PR adds a JSON schema for Intellisense in pug-lint config files. It also associates
.pug-lintrcand.jade-lintrcwith the JSON language mode.Related to pugjs/pug-lint#121. If that PR is merged, then vscode-puglint can install pug-lint as a dependency and reference the schema from
node_modules/pug-lint/schemas/pug-lintrc-schema.json.