Skip to content

Commit

Permalink
Fix several small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Apr 11, 2024
1 parent 3351f0d commit c3ebf5e
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 24 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/automatic-tsconfig-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'tsconfig-modified-comment'
on:
pull_request:
paths:
- 'src/schemas/json/tsconfig.json'
- 'src/schemas/json/jsconfig.json'

jobs:
post-comment:
if: github.repository == 'SchemaStore/schemastore'
runs-on: 'ubuntu-latest'
permissions: 'write-all'
steps:
- uses: 'actions/github-script@v7'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Detected modification of either 'tsconfig.json' or 'jsconfig.json' file.
If applicable, if you modified one file, you likely need to modify the other file to keep both in sync.`
})
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Recommended Extensions](#recommended-extensions)
- [Schema Authoring](#schema-authoring)
- [Best practices](#best-practices)
- [Avoiding overconstraint](#avoiding-overconstraint)
- [Undocumented Features](#undocumented-features)
- [API Compatibility](#api-compatibility)
- [Troubleshooting](#troubleshooting)
Expand Down Expand Up @@ -108,6 +109,13 @@ There is an [unofficial draft-07][draft-07-unofficial-strict] schema that uses J
[base-04]: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base-04.json
[draft-07-unofficial-strict]: https://json.schemastore.org/metaschema-draft-07-unofficial-strict.json

#### Avoiding overconstraint

Sometimes, constraints do more harm than good. For example, [cron strings](http://pubs.opengroup.org/onlinepubs/7908799/xcu/crontab.html) validation regexes. False positives are likely as due to their complexity and abundance of implementations; and, when there is an error, the error message isn't helpful. Such cases can include:

- cron regexes
- string-embedded DSLs

### Undocumented Features

The use of undocumented features in schemas is permitted and encouraged. However they must be labeled as such.
Expand Down
3 changes: 1 addition & 2 deletions src/schema-validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
"schema-org-contact-point.json",
"schema-org-place.json",
"servicehub.config.schema.json",
"sourcemap-v3.json",
"starlake.json",
"swagger-2.0.json",
"vega.json",
Expand Down Expand Up @@ -649,7 +648,7 @@
"externalSchema": ["jsbeautifyrc.json"]
},
"jsconfig.json": {
"unknownKeywords": ["markdownDescription"]
"unknownKeywords": ["markdownDescription", "markdownEnumDescriptions"]
},
"launchsettings.json": {
"unknownKeywords": ["allowTrailingCommas"]
Expand Down
4 changes: 4 additions & 0 deletions src/schemas/json/eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@
"description": "Prevent comments from changing config or rules",
"type": "boolean"
},
"reportUnusedDisableDirectives": {
"description": "Report unused eslint-disable comments",
"type": "boolean"
},
"parser": {
"type": "string"
},
Expand Down
3 changes: 1 addition & 2 deletions src/schemas/json/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@
},
"schedule": {
"type": "string",
"description": "A cron expression of the format '{second} {minute} {hour} {day} {month} {day of week}' to specify the schedule.",
"pattern": "^(\\*|((([1-5]\\d)|\\d)(-(([1-5]\\d)|\\d)(/\\d+)?)?)(,((([1-5]\\d)|\\d)(-(([1-5]\\d)|\\d)(/\\d+)?)?))*)(/\\d+)? (\\*|((([1-5]\\d)|\\d)(-(([1-5]\\d)|\\d)(/\\d+)?)?)(,((([1-5]\\d)|\\d)(-(([1-5]\\d)|\\d)(/\\d+)?)?))*)(/\\d+)? (\\*|(((1\\d)|(2[0-3])|\\d)(-((1\\d)|(2[0-3])|\\d)(/\\d+)?)?)(,(((1\\d)|(2[0-3])|\\d)(-((1\\d)|(2[0-3])|\\d)(/\\d+)?)?))*)(/\\d+)? (\\*|((([1-2]\\d)|(3[0-1])|[1-9])(-(([1-2]\\d)|(3[0-1])|[1-9])(/\\d+)?)?)(,((([1-2]\\d)|(3[0-1])|[1-9])(-(([1-2]\\d)|(3[0-1])|[1-9])(/\\d+)?)?))*)(/\\d+)? (\\*|(([A-Za-z]+|(1[0-2])|[1-9])(-([A-Za-z]+|(1[0-2])|[1-9])(/\\d+)?)?)(,(([A-Za-z]+|(1[0-2])|[1-9])(-([A-Za-z]+|(1[0-2])|[1-9])(/\\d+)?)?))*)(/\\d+)? (\\*|(([A-Za-z]+|[0-6])(-([A-Za-z]+|[0-6])(/\\d+)?)?)(,(([A-Za-z]+|[0-6])(-([A-Za-z]+|[0-6])(/\\d+)?)?))*)(/\\d+)?$"
"description": "A cron expression of the format '{second} {minute} {hour} {day} {month} {day of week}' to specify the schedule."
},
"runOnStartup": {
"type": "boolean",
Expand Down
4 changes: 1 addition & 3 deletions src/schemas/json/github-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,7 @@
"items": {
"properties": {
"cron": {
"$comment": "https://stackoverflow.com/a/57639657/4044345",
"type": "string",
"pattern": "^(((\\d+,)+\\d+|((\\d+|\\*)/\\d+|((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?))|(\\d+-\\d+)|\\d+(-\\d+)?/\\d+(-\\d+)?|\\d+|\\*|(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?) ?){5}$"
"type": "string"
}
},
"additionalProperties": false
Expand Down
3 changes: 1 addition & 2 deletions src/schemas/json/jekyll.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
"/:categories/:year/:y_day/:title:output_ext",
"/:categories/:year/:week/:short_day/:title:output_ext",
"/:categories/:title:output_ext"
],
"pattern": "^((.*(:(year|short_year|month|i_month|short_month|long_month|day|i_day|y_day|w_year|week|w_day|short_day|long_day|hour|minute|second|title|slug|categories|slugified_categories|output_ext))+)+|date|pretty|ordinal|weekdate|none)(/?)$"
]
},
"collection-permalink": {
"description": "The collection permalink format\nhttps://jekyllrb.com/docs/permalinks/#collections",
Expand Down
58 changes: 45 additions & 13 deletions src/schemas/json/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,27 @@
"type": ["string", "null"],
"anyOf": [
{
"enum": ["classic", "node", "node16", "nodenext", "bundler"]
"enum": [
"Classic",
"Node",
"Node10",
"Node16",
"NodeNext",
"Bundler"
],
"markdownEnumDescriptions": [
"It’s recommended to use `\"Node16\"` instead",
"Deprecated, use `\"Node10\"` in TypeScript 5.0+ instead",
"It’s recommended to use `\"Node16\"` instead",
"This is the recommended setting for libraries and Node.js applications",
"This is the recommended setting for libraries and Node.js applications",
"This is the recommended setting in TypeScript 5.0+ for applications that use a bundler"
]
},
{
"pattern": "^(([Nn]ode)|([Nn]ode16)|([Nn]ode[Nn]ext)|([Cc]lassic)|([Bb]undler))$"
}
],
"default": "classic",
"markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution"
},
"newLine": {
Expand Down Expand Up @@ -945,48 +959,63 @@
"ES2021",
"ES2020.SharedMemory",
"ES2020.Intl",
"ES2020.Date",
"ES2020.Number",
"ES2021.Promise",
"ES2021.String",
"ES2021.WeakRef",
"ESNext.WeakRef",
"es2021.intl",
"ES2021.Intl",
"ES2022",
"ES2022.Array",
"ES2022.Error",
"ES2022.Intl",
"ES2022.Object",
"ES2022.String"
"ES2022.String",
"ES2022.SharedMemory",
"ES2022.RegExp",
"ES2023",
"ES2023.Array",
"Decorators",
"Decorators.Legacy",
"ES2017.Date",
"ES2023.Collection",
"ESNext.Decorators",
"ESNext.Disposable"
]
},
{
"pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$"
},
{
"pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][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oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]))?$"
},
{
"pattern": "^[Ee][Ss][Nn][Ee][Xx][Tt](\\.([Aa][Rr][Rr][Aa][Yy]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Bb][Ii][Gg][Ii][Nn][Tt]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]|[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss]|[Dd][Ii][Ss][Pp][Oo][Ss][Aa][Bb][Ll][Ee]))?$"
},
{
"pattern": "^[Dd][Oo][Mm](\\.[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee])?$"
Expand All @@ -995,7 +1024,10 @@
"pattern": "^[Ss][Cc][Rr][Ii][Pp][Tt][Hh][Oo][Ss][Tt]$"
},
{
"pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.[Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss])?$"
"pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.([Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]))?$"
},
{
"pattern": "^[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss](\\.([Ll][Ee][Gg][Aa][Cc][Yy]))?$"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/json/kubernetes-definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5674,7 +5674,7 @@
"type": "string"
},
"ip": {
"description": "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.",
"description": "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast (224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.",
"type": "string"
},
"nodeName": {
Expand Down
3 changes: 3 additions & 0 deletions src/schemas/json/sourcemap-v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"sectionMap": {
"anyOf": [
{
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"map": {
"$ref": "#"
Expand All @@ -23,6 +25,7 @@
"id": "https://json.schemastore.org/sourcemap-v3.json",
"patternProperties": {
"^x_": {
"type": "object",
"description": "Any property starting with 'x_' is valid.",
"additionalProperties": true
}
Expand Down
1 change: 0 additions & 1 deletion src/schemas/json/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"allowTrailingCommas": true,
"allOf": [
{
"$ref": "#/definitions/compilerOptionsDefinition"
Expand Down
11 changes: 11 additions & 0 deletions src/test/eslintrc/withReportUnusedDisableDirectives.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"overrides": [
{
"files": ["*-test.js", "*.spec.js"],
"rules": {
"reportUnusedDisableDirectives": false
}
}
],
"reportUnusedDisableDirectives": true
}
7 changes: 7 additions & 0 deletions src/test/jekyll/issue-3702.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defaults:
- scope:
path: '' # an empty string here means all files in the project
type: pages
values:
# https://jekyllrb.com/docs/permalinks/#pages
permalink: /:path/:basename

0 comments on commit c3ebf5e

Please sign in to comment.