diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 8c6d249b5..ee5eff160 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,13 +1,17 @@ module.exports = { '*.{js,ts}': ['eslint --fix', 'prettier --write'], - '*.md': ['markdownlint-cli2-fix', 'prettier --write'], + '!(_*).md': ['markdownlint-cli2-fix', 'prettier --write'], '*.ya?ml': ['prettier --write'], /** - * This _should_ match if the options change, the rules change, the schema-generating script changes, - * or we've had dependency changes. + * This _should_ match if the options change, the rules change, the + * schema-generating script changes, or we've had dependency changes. + * * @returns Command to update schema */ - '(./src/rules/**/*.ts|src/options.ts|./scripts/generate-schema.ts|./package.json|./package-lock.json)': - () => ['npm run update-schema'], - './package.json': ['prettier --write'], + '(./packages/plugin-default/src/**/*.ts|packages/midnight-smoker/src/options.ts|./packages/midnight-smoker/scripts/generate-schema.ts|package.json|package-lock.json)': + () => [ + 'npm run update-schema', + 'git add -A packages/midnight-smoker/schema/midnight-smoker.schema.json', + ], + '*.json': ['prettier --write'], }; diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 000000000..545c15ac1 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,22 @@ +config: + ul-style: + style: dash + ul-indent: + indent: 2 + commands-show-output: false + no-bare-urls: false + line-length: false + no-emphasis-as-header: false + no-duplicate-header: false + header-increment: false + no-blanks-blockquote: false +ignores: + - '**/node_modules/**' + - 'docs/README.md' # generated + - 'docs/**/_*.md' # special + - '**/CHANGELOG.md' # generated +outputFormatters: + - - 'markdownlint-cli2-formatter-pretty' + - appendLink: true +showFound: true +noProgress: false diff --git a/.markdownlint.yml b/.markdownlint.yml deleted file mode 100644 index 2e0d1e46b..000000000 --- a/.markdownlint.yml +++ /dev/null @@ -1,11 +0,0 @@ -ul-style: - style: dash -ul-indent: - indent: 2 -commands-show-output: false -no-bare-urls: false -line-length: false -no-emphasis-as-header: false -no-duplicate-header: false -header-increment: false -no-blanks-blockquote: false diff --git a/package-lock.json b/package-lock.json index d09697d3a..e47bccd87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "husky": "8.0.3", "lint-staged": "14.0.1", "markdownlint-cli2": "0.11.0", + "markdownlint-cli2-formatter-pretty": "0.0.5", "mocha": "10.2.0", "npm-run-all": "4.1.5", "prettier": "3.1.1", @@ -4982,6 +4983,34 @@ "markdownlint-cli2": ">=0.0.4" } }, + "node_modules/markdownlint-cli2-formatter-pretty": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/markdownlint-cli2-formatter-pretty/-/markdownlint-cli2-formatter-pretty-0.0.5.tgz", + "integrity": "sha512-616abla6soREFCLB+KUaremXYQC0/DvMgVjYOnR4esZbXe4z0Tbfzivb1H9tQVu5Ruq45XBOB4chKolSGO3Vjw==", + "dev": true, + "dependencies": { + "chalk": "5.3.0", + "terminal-link": "3.0.0" + }, + "engines": { + "node": ">=14.18.0" + }, + "peerDependencies": { + "markdownlint-cli2": ">=0.0.4" + } + }, + "node_modules/markdownlint-cli2-formatter-pretty/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/markdownlint-cli2/node_modules/globby": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.0.tgz", @@ -8060,6 +8089,19 @@ "node": ">=8" } }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -8071,6 +8113,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/terminal-link": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-3.0.0.tgz", + "integrity": "sha512-flFL3m4wuixmf6IfhFJd1YPiLiMuxEc8uHRM1buzIeZPm22Au2pDqBJQgdo7n1WfPU1ONFGv7YDwpFBmHGF6lg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^5.0.0", + "supports-hyperlinks": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", diff --git a/package.json b/package.json index a3d5aa621..a983d2f0d 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "lint:commit": "commitlint", "lint:eslint": "eslint .", "lint:fix": "eslint . --fix", - "lint:md": "markdownlint-cli2 \"README.md\" \"packages/*/README.md\" \"docs/**/*.md\" \"!docs/README.md\"", + "lint:md": "markdownlint-cli2 \"**/*.md\"", "lint:staged": "lint-staged", "prepare": "run-p husky-install rebuild", "pretest:e2e": "run-s build", @@ -64,6 +64,7 @@ "husky": "8.0.3", "lint-staged": "14.0.1", "markdownlint-cli2": "0.11.0", + "markdownlint-cli2-formatter-pretty": "0.0.5", "mocha": "10.2.0", "npm-run-all": "4.1.5", "prettier": "3.1.1", diff --git a/packages/midnight-smoker/schema/midnight-smoker.schema.json b/packages/midnight-smoker/schema/midnight-smoker.schema.json index 3fb9bf588..3379640df 100644 --- a/packages/midnight-smoker/schema/midnight-smoker.schema.json +++ b/packages/midnight-smoker/schema/midnight-smoker.schema.json @@ -2,517 +2,266 @@ "type": "object", "properties": { "add": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Add an extra package to the list of packages to be installed" + "$ref": "#/$defs/stringOrStringArray", + "description": "Add an extra package to the list of packages to be installed." }, "all": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Operate on all workspaces. The root workspace is omitted unless `includeRoot` is `true`" + "description": "Operate on all workspaces. The root workspace is omitted unless `includeRoot` is `true`." }, "bail": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Fail on first script failure" + "description": "Fail on first script failure." }, "includeRoot": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Operate on the root workspace. Only has an effect if `all` is `true`" - }, - "include-root": { - "$ref": "#/properties/includeRoot" + "description": "Operate on the root workspace. Only has an effect if `all` is `true`." }, "json": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Output JSON only" + "description": "Output JSON only." }, "linger": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Do not delete temp directories after completion" + "description": "Do not delete temp directories after completion." }, "verbose": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "Verbose logging" + "description": "Verbose logging." }, "workspace": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "One or more workspaces to run scripts in" + "$ref": "#/$defs/stringOrStringArray", + "description": "One or more workspaces to run scripts in." }, - "pkgManager": { - "$ref": "#/$defs/arrayOfNonEmptyStrings", + "pm": { + "$ref": "#/$defs/stringOrStringArray", "default": "npm@latest", - "description": "Package manager(s) to use" - }, - "pkg-manager": { - "$ref": "#/properties/pkgManager" + "description": "Package manager(s) to use." }, "script": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Script(s) to run. Alias of `scripts`" + "$ref": "#/$defs/stringOrStringArray", + "description": "Script(s) to run. Alias of `scripts`." }, "scripts": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Script(s) to run. Alias of `script`" + "$ref": "#/$defs/stringOrStringArray", + "description": "Script(s) to run. Alias of `script`." }, "loose": { "$ref": "#/$defs/defaultFalse", "default": false, - "description": "If `true`, fail if a workspace is missing a script" + "description": "If `true`, fail if a workspace is missing a script." }, "checks": { "$ref": "#/$defs/defaultTrue", "default": true, - "description": "If `false`, run no builtin checks" + "description": "If `false`, run no builtin checks." }, "rules": { "type": "object", "properties": { "no-banned-files": { - "allOf": [ + "anyOf": [ { - "anyOf": [ - { - "type": "object", - "properties": { - "allow": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Allow these banned files" - }, - "deny": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Deny these additional files" - } - }, - "additionalProperties": false, - "default": { - "allow": [], - "deny": [] - } - }, - { - "$ref": "#/$defs/severity", - "default": "error", - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." + "$ref": "#/$defs/severity", + "default": "error", + "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error on violations." + }, + { + "type": "object", + "properties": { + "allow": { + "$ref": "#/$defs/arrayOfNonEmptyStrings", + "default": [], + "description": "Allow these banned files" }, + "deny": { + "$ref": "#/$defs/arrayOfNonEmptyStrings", + "default": [], + "description": "Deny these additional files" + } + }, + "additionalProperties": false + }, + { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/properties/rules/properties/no-banned-files/allOf/0/anyOf/1" - }, - { - "$ref": "#/properties/rules/properties/no-banned-files/allOf/0/anyOf/0" - } - ] + "$ref": "#/properties/rules/properties/no-banned-files/anyOf/1" }, { - "type": "object", - "properties": { - "severity": { - "$ref": "#/properties/rules/properties/no-banned-files/allOf/0/anyOf/1" - }, - "opts": { - "$ref": "#/properties/rules/properties/no-banned-files/allOf/0/anyOf/0" - } - }, - "additionalProperties": false + "$ref": "#/properties/rules/properties/no-banned-files/anyOf/0" } - ], - "description": "Rule-specific options" - }, - { - "$ref": "#/properties/rules/properties/no-banned-files/allOf/0/anyOf/3" + ] } ] }, - "no-missing-entry-point": { - "allOf": [ + "no-missing-pkg-files": { + "anyOf": [ { - "anyOf": [ - { - "type": "object", - "properties": {}, - "additionalProperties": true, - "description": "Empty object", - "default": {} + "$ref": "#/$defs/severity", + "default": "error", + "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error on violations." + }, + { + "type": "object", + "properties": { + "bin": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Check the \"bin\" field (if it exists)" }, - { - "$ref": "#/$defs/severity", - "default": "error", - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." + "browser": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Check the \"browser\" field (if it exists)" }, - { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/properties/rules/properties/no-missing-entry-point/allOf/0/anyOf/1" - }, - { - "$ref": "#/properties/rules/properties/no-missing-entry-point/allOf/0/anyOf/0" - } - ] + "types": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Check the \"types\" field (if it exists)" }, - { - "type": "object", - "properties": { - "severity": { - "$ref": "#/properties/rules/properties/no-missing-entry-point/allOf/0/anyOf/1" - }, - "opts": { - "$ref": "#/properties/rules/properties/no-missing-entry-point/allOf/0/anyOf/0" - } - }, - "additionalProperties": false + "unpkg": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Check the \"unpkg\" field (if it exists)" + }, + "module": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Check the \"module\" field (if it exists)" + }, + "fields": { + "$ref": "#/$defs/arrayOfNonEmptyStrings", + "default": [], + "description": "Check files referenced by these additional top-level fields" } - ], - "description": "Empty object" + }, + "additionalProperties": false }, { - "$ref": "#/properties/rules/properties/no-missing-entry-point/allOf/0/anyOf/3" + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "$ref": "#/properties/rules/properties/no-missing-pkg-files/anyOf/1" + }, + { + "$ref": "#/properties/rules/properties/no-missing-pkg-files/anyOf/0" + } + ] } ] }, - "no-missing-exports": { - "allOf": [ + "no-missing-entry-point": { + "anyOf": [ { - "anyOf": [ - { - "type": "object", - "properties": { - "types": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Assert a \"types\" conditional export matches a file with a .d.ts extension" - }, - "require": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Assert a \"require\" conditional export matches a CJS script" - }, - "import": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Assert an \"import\" conditional export matches a ESM module" - }, - "order": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Assert conditional export \"default\", if present, is the last export" - }, - "glob": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Allow glob patterns in subpath exports" - } - }, - "additionalProperties": false, - "default": { - "types": true, - "require": true, - "import": true, - "order": true, - "glob": true - } - }, - { - "$ref": "#/$defs/severity", - "default": "error", - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." - }, + "$ref": "#/$defs/severity", + "default": "error", + "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error on violations." + }, + {}, + { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/properties/rules/properties/no-missing-exports/allOf/0/anyOf/1" - }, - { - "$ref": "#/properties/rules/properties/no-missing-exports/allOf/0/anyOf/0" - } - ] + "$ref": "#/properties/rules/properties/no-missing-entry-point/anyOf/1" }, { - "type": "object", - "properties": { - "severity": { - "$ref": "#/properties/rules/properties/no-missing-exports/allOf/0/anyOf/1" - }, - "opts": { - "$ref": "#/properties/rules/properties/no-missing-exports/allOf/0/anyOf/0" - } - }, - "additionalProperties": false + "$ref": "#/properties/rules/properties/no-missing-entry-point/anyOf/0" } - ], - "description": "Rule-specific options" - }, - { - "$ref": "#/properties/rules/properties/no-missing-exports/allOf/0/anyOf/3" + ] } ] }, - "no-missing-pkg-files": { - "allOf": [ + "no-missing-exports": { + "anyOf": [ { - "anyOf": [ - { - "type": "object", - "properties": { - "bin": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Check the \"bin\" field (if it exists)" - }, - "browser": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Check the \"browser\" field (if it exists)" - }, - "types": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Check the \"types\" field (if it exists)" - }, - "unpkg": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Check the \"unpkg\" field (if it exists)" - }, - "module": { - "$ref": "#/$defs/defaultTrue", - "default": true, - "description": "Check the \"module\" field (if it exists)" - }, - "fields": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Check files referenced by these additional top-level fields" - } - }, - "additionalProperties": false, - "default": { - "bin": true, - "browser": true, - "types": true, - "unpkg": true, - "module": true, - "fields": [] - } + "$ref": "#/$defs/severity", + "default": "error", + "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error on violations." + }, + { + "type": "object", + "properties": { + "types": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Assert a \"types\" conditional export matches a file with a .d.ts extension" }, - { - "$ref": "#/$defs/severity", - "default": "error", - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." + "require": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Assert a \"require\" conditional export matches a CJS script" }, - { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/properties/rules/properties/no-missing-pkg-files/allOf/0/anyOf/1" - }, - { - "$ref": "#/properties/rules/properties/no-missing-pkg-files/allOf/0/anyOf/0" - } - ] + "import": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Assert an \"import\" conditional export matches a ESM module" }, - { - "type": "object", - "properties": { - "severity": { - "$ref": "#/properties/rules/properties/no-missing-pkg-files/allOf/0/anyOf/1" - }, - "opts": { - "$ref": "#/properties/rules/properties/no-missing-pkg-files/allOf/0/anyOf/0" - } - }, - "additionalProperties": false + "order": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Assert conditional export \"default\", if present, is the last export" + }, + "glob": { + "$ref": "#/$defs/defaultTrue", + "default": true, + "description": "Allow glob patterns in subpath exports" } - ], - "description": "Rule-specific options" + }, + "additionalProperties": false }, { - "$ref": "#/properties/rules/properties/no-missing-pkg-files/allOf/0/anyOf/3" + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "$ref": "#/properties/rules/properties/no-missing-exports/anyOf/1" + }, + { + "$ref": "#/properties/rules/properties/no-missing-exports/anyOf/0" + } + ] } ] } }, - "additionalProperties": { - "allOf": [ - { - "anyOf": [ - { - "type": "object", - "properties": {}, - "additionalProperties": true, - "description": "Empty object", - "default": {} - }, - { - "$ref": "#/$defs/severity", - "default": "error", - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." - }, - { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": [ - { - "$ref": "#/properties/rules/additionalProperties/allOf/0/anyOf/1" - }, - { - "$ref": "#/properties/rules/additionalProperties/allOf/0/anyOf/0" - } - ] - }, - { - "type": "object", - "properties": { - "severity": { - "$ref": "#/properties/rules/additionalProperties/allOf/0/anyOf/1" - }, - "opts": { - "$ref": "#/properties/rules/additionalProperties/allOf/0/anyOf/0" - } - }, - "additionalProperties": false - } - ], - "description": "Empty object" - }, - { - "$ref": "#/properties/rules/additionalProperties/allOf/0/anyOf/3" - } - ] - }, - "description": "Rule configuration for automated checks", + "additionalProperties": false, "default": { + "no-missing-pkg-files": { + "bin": true, + "browser": true, + "types": true, + "unpkg": true, + "module": true, + "fields": [] + }, "no-banned-files": { "allow": [], "deny": [] }, + "no-missing-entry-point": {}, "no-missing-exports": { "types": true, "require": true, "import": true, "order": true, "glob": true - }, - "no-missing-pkg-files": { - "bin": true, - "browser": true, - "types": true, - "unpkg": true, - "module": true, - "fields": [] } - } - }, - "plugin": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "One or more plugins to load" - }, - "executor": { - "type": "string", - "minLength": 1, - "description": "Component ID of Executor implementation", - "default": "default" - }, - "ruleRunner": { - "type": "string", - "minLength": 1, - "description": "Component ID of RuleRunner implementation", - "default": "default" - }, - "rule-runner": { - "$ref": "#/properties/ruleRunner" - }, - "scriptRunner": { - "type": "string", - "minLength": 1, - "description": "Component ID of ScriptRunner implementation", - "default": "default" - }, - "script-runner": { - "$ref": "#/properties/scriptRunner" - }, - "reporter": { - "allOf": [ - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0" - }, - { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/1" - } - ], - "description": "Component ID of Reporter implementation", - "default": ["console"] + }, + "description": "Rule configuration for checks" } }, "additionalProperties": false, @@ -520,46 +269,39 @@ "$defs": { "defaultTrue": { "type": "boolean", - "default": true, - "description": "A boolean defaulting to true" + "default": true }, "defaultFalse": { "type": "boolean", - "default": false, - "description": "A boolean defaulting to false" + "default": false }, - "arrayOfNonEmptyStrings": { - "allOf": [ + "stringOrStringArray": { + "anyOf": [ { - "anyOf": [ - { - "type": "string", - "minLength": 1, - "description": "A non-empty string" - }, - { - "type": "array", - "items": { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0/anyOf/0" - }, - "description": "An array of non-empty strings" - } - ], - "default": [] + "type": "string", + "minLength": 1 }, { "type": "array", "items": { - "$ref": "#/$defs/arrayOfNonEmptyStrings/allOf/0/anyOf/0" + "$ref": "#/$defs/stringOrStringArray/anyOf/0" } } ], - "description": "A non-empty string or array of non-empty strings, normalized to an array" + "default": [] + }, + "arrayOfNonEmptyStrings": { + "type": "array", + "items": { + "$ref": "#/$defs/stringOrStringArray/anyOf/0" + }, + "default": [] }, "severity": { "type": "string", - "enum": ["error", "warn", "off"], - "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error (non-zero exit code) on violations." + "enum": ["off", "warn", "error"], + "description": "Severity of a rule. `off` disables the rule, `warn` will warn on violations, and `error` will error on violations.", + "default": "error" } }, "$schema": "http://json-schema.org/draft-07/schema#"