Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,38 @@
"description": "Run the linter on save (onSave) or on type (onType)."
}
}
}
},
"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 👍

{
"id": "json",
"filenames": [
".pug-lintrc",
".jade-lintrc"
]
}
],
"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! 👍

"fileMatch": ".pug-lintrc",
"url": "./schemas/pug-lintrc-schema.json"
},
{
"fileMatch": ".pug-lintrc.json",
"url": "./schemas/pug-lintrc-schema.json"
},
{
"fileMatch": ".pug-lint.json",
"url": "./schemas/pug-lintrc-schema.json"
},
{
"fileMatch": ".jade-lintrc",
"url": "./schemas/pug-lintrc-schema.json"
},
{
"fileMatch": ".jade-lint.json",
"url": "./schemas/pug-lintrc-schema.json"
}
]
},
"dependencies": {
"vscode-languageclient": "2.5.0",
Expand Down
Loading