Skip to content

Conversation

@cspotcode
Copy link

This PR adds a JSON schema for Intellisense in pug-lint config files. It also associates .pug-lintrc and .jade-lintrc with 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.

@mrmlnc mrmlnc self-assigned this Nov 18, 2016
Copy link
Owner

@mrmlnc mrmlnc left a 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": [
Copy link
Owner

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.

Copy link
Author

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.

Copy link
Owner

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 @@
{
Copy link
Owner

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?

Copy link
Author

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.

Copy link
Owner

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": [
{
Copy link
Owner

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 😄

Copy link
Author

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.

Copy link
Owner

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

Copy link
Author

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification! 👍

@mrmlnc
Copy link
Owner

mrmlnc commented Apr 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants