Closed ybiquitous closed 2 months ago
Name | Link |
---|---|
Latest commit | f808a7aba5d321620af9299b7533dfc3073691d9 |
Latest deploy log | https://app.netlify.com/sites/chimerical-trifle-8d3c21/deploys/66e8e485dd50b60008e4d3d6 |
Deploy Preview | https://deploy-preview-425--chimerical-trifle-8d3c21.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Wait.
I have got a better one. Ill link it here tomorrow.
@ybiquitous https://gist.github.com/Mouvedia/f7459c8d94c9a219f9e32af50b080c96
I didn't put the id
's value because it will be the url of where you will decide to store it.
Good luck reviewing it!
I may not understand well yet. What do you mean with your gist version? Replace?
The one linked on schemastore.org has deprecated rules and has been originally generated by someone else. The one that I have provided is generated from the code itself, is using the last draft of JSON Schema and doesn't have group indirections. i.e. it is stricter, simpler and use 2020-12 JSON Schema e.g.
overrides
on mine and schemastore
's oneAs explained in this comment, we shouldn't share the same schema.
Replace?
Save it somewhere.
e.g.
schemas: [
{
uri: 'https://stylelint.io/path/to/',
fileMatch: ['stylelint.schema.json'],
},
],
Got it. Thanks for the help βΊοΈ I'll save your gist version in this repo and read it in the setup code.
Got it. Thanks for the help βΊοΈ
π
You might get stuck on microsoft/monaco-editor#3160. If that happens you will have to convert it to a previous draft. It shouldn't be hard.
I'll save your gist version in this repo and read it in the setup code.
Remember to set the id
.
@Mouvedia Thank you. I pushed 036674f to use your schema. Can you take a look when you have time?
You might get stuck on https://github.com/microsoft/monaco-editor/issues/3160.
I didn't come across the issue, but I may miss it. If something wrong happens, please let me know.
I didn't come across the issue, but I may miss it.
If the main goal is auto-completion, it's fine.
The issue states that you might have no errors when you add additional properties.
i.e. "unevaluatedProperties": false
It was added in 2019-09 draft.
e.g. if someone use deprecated rules
It's not a big deal.
Can you take a look when you have time?
To tell you the truth, I don't want to review a 6000 lines file.
Most of the file is autogenerated by a script so that I don't have to review it.
I had to make some corrections in revision 1.
The other revisions after that are just refactors to slim the json file a bit.
i.e. removing repetition using $defs
Ah, you don't need to review your gist file in this PR! I want you to confirm your file is imported expectedly in this PR. π
E.g., the following way:
$ curl https://gist.githubusercontent.com/Mouvedia/f7459c8d94c9a219f9e32af50b080c96/raw/1c09516f3b8abee77b1a25aed1fdee9efec3a6d2/stylelint.schema.json > src/schema/stylelintrc.json
$ npm run format
$ git diff
should produce:
diff --git a/src/schema/stylelintrc.json b/src/schema/stylelintrc.json
index f860a85..8eb87dd 100644
--- a/src/schema/stylelintrc.json
+++ b/src/schema/stylelintrc.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://stylelint.io/schema/stylelintrc.json",
+ "$id": "",
"$defs": {
"arrayOfString": {
"type": "array",
- "$id": "https://stylelint.io/schema/stylelintrc.json",
+ "$id": "",
π
I found a bug but we can fix it in a separate PR.
It's not important because users shan't use files
in the playground.
try
{
"rules": {},
"overrides": [
{
"files": ["foo"]
}
]
}
It's probably related to https://github.com/microsoft/monaco-editor/issues/3160.
i.e. properties
doesn't extend $ref
I think a simple "allOf": []
should do the trick.
i.e. something like
"overrides": {
"type": "array",
"items": {
"allOf": [
{
"$ref": "#",
},
{
"properties": {
"files": {
"$ref": "#/$defs/arrayOfString"
}
},
},
],
"not": {
"required": [
"overrides"
]
},
"unevaluatedProperties": false
}
},
Great. Fixed with f808a7a as you suggested. Can you take a look?
Can you take a look?
Fixed it.
We can add the deprecated rules later if we feel like it.
Or we could version the json files so that it can be switched depending on the version of stylelint
used in the dependencies tab.
This is great as is.
@Mouvedia Thanks a lot for your support! π
@jeddy3 Do you have any concerns about this feature? I welcome your feedback. I'm not in a hurry to merge.
None.
The 3rd-party JSON schema provides auto-completion, validation, etc. https://json.schemastore.org/stylelintrc
See also the Monaco Editor Playground.
FYI, @Mouvedia has recently improved the schema with https://github.com/SchemaStore/schemastore/pull/4057. I appreciate that work. ππΌ