This commit is contained in:
Luke Gustafson
2024-11-27 00:28:10 +00:00
parent 1fd7b595f8
commit e159477406
15 changed files with 29654 additions and 18 deletions

View File

@@ -0,0 +1,126 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/semantic-release.json",
"definitions": {
"branch-object": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"channel": {
"type": "string"
},
"range": {
"type": "string"
},
"prerelease": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
}
}
}
},
"properties": {
"extends": {
"description": "List of modules or file paths containing a shareable configuration. If multiple shareable configurations are set, they will be imported in the order defined with each configuration option taking precedence over the options defined in a previous shareable configuration",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"branches": {
"description": "The branches on which releases should happen.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/branch-object"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/branch-object"
}
]
}
}
],
"default": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
]
},
"repositoryUrl": {
"type": "string",
"description": "The git repository URL"
},
"tagFormat": {
"type": "string",
"description": "The Git tag format used by semantic-release to identify releases. The tag name is generated with Lodash template and will be compiled with the version variable.",
"default": "v${version}"
},
"plugins": {
"type": "array",
"description": "Define the list of plugins to use. Plugins will run in series, in the order defined",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "array"
}
]
},
"default": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
},
"dryRun": {
"type": "boolean",
"description": "The objective of the dry-run mode is to get a preview of the pending release. Dry-run mode skips the following steps: prepare, publish, success and fail. In addition to this it prints the next version and release notes to the console"
},
"ci": {
"type": "boolean",
"description": "Set to false to skip Continuous Integration environment verifications. This allows for making releases from a local machine",
"default": true
}
},
"title": "semantic-release Schema",
"type": "object"
}

View File

@@ -0,0 +1,867 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON schema for NPM package.json files",
"definitions": {
"person": {
"description": "A person who has been involved in creating or maintaining this package.",
"type": [
"object",
"string"
],
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"email": {
"type": "string",
"format": "email"
}
}
},
"dependency": {
"description": "Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"license": {
"anyOf": [
{
"type": "string"
},
{
"enum": [
"AGPL-3.0-only",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BSL-1.0",
"CC0-1.0",
"CDDL-1.0",
"CDDL-1.1",
"EPL-1.0",
"EPL-2.0",
"GPL-2.0-only",
"GPL-3.0-only",
"ISC",
"LGPL-2.0-only",
"LGPL-2.1-only",
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"LGPL-3.0-or-later",
"MIT",
"MPL-2.0",
"MS-PL",
"UNLICENSED"
]
}
]
},
"scriptsInstallAfter": {
"description": "Run AFTER the package is installed.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsPublishAfter": {
"description": "Run AFTER the package is published.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsRestart": {
"description": "Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsStart": {
"description": "Run by the 'npm start' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsStop": {
"description": "Run by the 'npm stop' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsTest": {
"description": "Run by the 'npm test' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsUninstallBefore": {
"description": "Run BEFORE the package is uninstalled.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsVersionBefore": {
"description": "Run BEFORE bump the package version.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"packageExportsEntryPath": {
"type": [
"string",
"null"
],
"description": "The module path that is resolved when this specifier is imported. Set to `null` to disallow importing this module.",
"pattern": "^\\./"
},
"packageExportsEntryObject": {
"type": "object",
"description": "Used to specify conditional exports, note that Conditional exports are unsupported in older environments, so it's recommended to use the fallback array option if support for those environments is a concern.",
"properties": {
"require": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when this specifier is imported as a CommonJS module using the `require(...)` function."
},
"import": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when this specifier is imported as an ECMAScript module using an `import` declaration or the dynamic `import(...)` function."
},
"node": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when this environment is Node.js."
},
"default": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when no other export type matches."
},
"types": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved for TypeScript types when this specifier is imported. Should be listed before other conditions."
}
},
"patternProperties": {
"^[^.0-9]+$": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when this environment matches the property name."
}
},
"additionalProperties": false
},
"packageExportsEntry": {
"oneOf": [
{
"$ref": "#/definitions/packageExportsEntryPath"
},
{
"$ref": "#/definitions/packageExportsEntryObject"
}
]
},
"packageExportsFallback": {
"type": "array",
"description": "Used to allow fallbacks in case this environment doesn't support the preceding entries.",
"items": {
"$ref": "#/definitions/packageExportsEntry"
}
},
"packageExportsEntryOrFallback": {
"oneOf": [
{
"$ref": "#/definitions/packageExportsEntry"
},
{
"$ref": "#/definitions/packageExportsFallback"
}
]
},
"fundingUrl": {
"type": "string",
"format": "uri",
"description": "URL to a website with details about how to fund the package."
},
"fundingWay": {
"type": "object",
"description": "Used to inform about ways to help fund development of the package.",
"properties": {
"url": {
"$ref": "#/definitions/fundingUrl"
},
"type": {
"type": "string",
"description": "The type of funding or the platform through which funding can be provided, e.g. patreon, opencollective, tidelift or github."
}
},
"additionalProperties": false,
"required": [
"url"
]
}
},
"type": "object",
"patternProperties": {
"^_": {
"description": "Any property starting with _ is valid.",
"tsType": "any"
}
},
"properties": {
"name": {
"description": "The name of the package.",
"type": "string",
"maxLength": 214,
"minLength": 1,
"pattern": "^(?:(?:@(?:[a-z0-9-*~][a-z0-9-*._~]*)?/[a-z0-9-._~])|[a-z0-9-~])[a-z0-9-._~]*$"
},
"version": {
"description": "Version must be parseable by node-semver, which is bundled with npm as a dependency.",
"type": "string"
},
"description": {
"description": "This helps people discover your package, as it's listed in 'npm search'.",
"type": "string"
},
"keywords": {
"description": "This helps people discover your package as it's listed in 'npm search'.",
"type": "array",
"items": {
"type": "string"
}
},
"homepage": {
"description": "The url to the project homepage.",
"type": "string"
},
"bugs": {
"description": "The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.",
"type": [
"object",
"string"
],
"properties": {
"url": {
"type": "string",
"description": "The url to your project's issue tracker.",
"format": "uri"
},
"email": {
"type": "string",
"description": "The email address to which issues should be reported.",
"format": "email"
}
}
},
"license": {
"$ref": "#/definitions/license",
"description": "You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it."
},
"licenses": {
"description": "DEPRECATED: Instead, use SPDX expressions, like this: { \"license\": \"ISC\" } or { \"license\": \"(MIT OR Apache-2.0)\" } see: 'https://docs.npmjs.com/files/package.json#license'.",
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/license"
},
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"author": {
"$ref": "#/definitions/person"
},
"contributors": {
"description": "A list of people who contributed to this package.",
"type": "array",
"items": {
"$ref": "#/definitions/person"
}
},
"maintainers": {
"description": "A list of people who maintains this package.",
"type": "array",
"items": {
"$ref": "#/definitions/person"
}
},
"files": {
"description": "The 'files' field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder.",
"type": "array",
"items": {
"type": "string"
}
},
"main": {
"description": "The main field is a module ID that is the primary entry point to your program.",
"type": "string"
},
"exports": {
"description": "The \"exports\" field is used to restrict external access to non-exported module files, also enables a module to import itself using \"name\".",
"oneOf": [
{
"$ref": "#/definitions/packageExportsEntryPath",
"description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field."
},
{
"type": "object",
"properties": {
".": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field."
}
},
"patternProperties": {
"^\\./.+": {
"$ref": "#/definitions/packageExportsEntryOrFallback",
"description": "The module path prefix that is resolved when the module specifier starts with \"name/\", set to \"./*\" to allow external modules to import any subpath."
}
},
"additionalProperties": false
},
{
"$ref": "#/definitions/packageExportsEntryObject",
"description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field."
},
{
"$ref": "#/definitions/packageExportsFallback",
"description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field."
}
]
},
"bin": {
"type": [
"string",
"object"
],
"additionalProperties": {
"type": "string"
}
},
"type": {
"description": "When set to \"module\", the type field allows a package to specify all .js files within are ES modules. If the \"type\" field is omitted or set to \"commonjs\", all .js files are treated as CommonJS.",
"type": "string",
"enum": [
"commonjs",
"module"
],
"default": "commonjs"
},
"types": {
"description": "Set the types property to point to your bundled declaration file.",
"type": "string"
},
"typings": {
"description": "Note that the \"typings\" field is synonymous with \"types\", and could be used as well.",
"type": "string"
},
"typesVersions": {
"description": "The \"typesVersions\" field is used since TypeScript 3.1 to support features that were only made available in newer TypeScript versions.",
"type": "object",
"additionalProperties": {
"description": "Contains overrides for the TypeScript version that matches the version range matching the property key.",
"type": "object",
"properties": {
"*": {
"description": "Maps all file paths to the file paths specified in the array.",
"type": "array",
"items": {
"type": "string",
"pattern": "^[^*]*(?:\\*[^*]*)?$"
}
}
},
"patternProperties": {
"^[^*]+$": {
"description": "Maps the file path matching the property key to the file paths specified in the array.",
"type": "array",
"items": {
"type": "string"
}
},
"^[^*]*\\*[^*]*$": {
"description": "Maps file paths matching the pattern specified in property key to file paths specified in the array.",
"type": "array",
"items": {
"type": "string",
"pattern": "^[^*]*(?:\\*[^*]*)?$"
}
}
},
"additionalProperties": false
}
},
"man": {
"type": [
"array",
"string"
],
"description": "Specify either a single file or an array of filenames to put in place for the man program to find.",
"items": {
"type": "string"
}
},
"directories": {
"type": "object",
"properties": {
"bin": {
"description": "If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.",
"type": "string"
},
"doc": {
"description": "Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.",
"type": "string"
},
"example": {
"description": "Put example scripts in here. Someday, it might be exposed in some clever way.",
"type": "string"
},
"lib": {
"description": "Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.",
"type": "string"
},
"man": {
"description": "A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.",
"type": "string"
},
"test": {
"type": "string"
}
}
},
"repository": {
"description": "Specify the place where your code lives. This is helpful for people who want to contribute.",
"type": [
"object",
"string"
],
"properties": {
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"directory": {
"type": "string"
}
}
},
"funding": {
"oneOf": [
{
"$ref": "#/definitions/fundingUrl"
},
{
"$ref": "#/definitions/fundingWay"
},
{
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/fundingUrl"
},
{
"$ref": "#/definitions/fundingWay"
}
]
},
"minItems": 1,
"uniqueItems": true
}
]
},
"scripts": {
"description": "The 'scripts' member is an object hash of script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.",
"type": "object",
"properties": {
"lint": {
"type": "string",
"description": "Run code quality tools, e.g. ESLint, TSLint, etc."
},
"prepublish": {
"type": "string",
"description": "Run BEFORE the package is published (Also run on local npm install without any arguments)."
},
"prepare": {
"type": "string",
"description": "Run both BEFORE the package is packed and published, and on local npm install without any arguments. This is run AFTER prepublish, but BEFORE prepublishOnly."
},
"prepublishOnly": {
"type": "string",
"description": "Run BEFORE the package is prepared and packed, ONLY on npm publish."
},
"prepack": {
"type": "string",
"description": "run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies)."
},
"postpack": {
"type": "string",
"description": "Run AFTER the tarball has been generated and moved to its final destination."
},
"publish": {
"type": "string",
"description": "Publishes a package to the registry so that it can be installed by name. See https://docs.npmjs.com/cli/v8/commands/npm-publish"
},
"postpublish": {
"$ref": "#/definitions/scriptsPublishAfter"
},
"preinstall": {
"type": "string",
"description": "Run BEFORE the package is installed."
},
"install": {
"$ref": "#/definitions/scriptsInstallAfter"
},
"postinstall": {
"$ref": "#/definitions/scriptsInstallAfter"
},
"preuninstall": {
"$ref": "#/definitions/scriptsUninstallBefore"
},
"uninstall": {
"$ref": "#/definitions/scriptsUninstallBefore"
},
"postuninstall": {
"type": "string",
"description": "Run AFTER the package is uninstalled."
},
"preversion": {
"$ref": "#/definitions/scriptsVersionBefore"
},
"version": {
"$ref": "#/definitions/scriptsVersionBefore"
},
"postversion": {
"type": "string",
"description": "Run AFTER bump the package version."
},
"pretest": {
"$ref": "#/definitions/scriptsTest"
},
"test": {
"$ref": "#/definitions/scriptsTest"
},
"posttest": {
"$ref": "#/definitions/scriptsTest"
},
"prestop": {
"$ref": "#/definitions/scriptsStop"
},
"stop": {
"$ref": "#/definitions/scriptsStop"
},
"poststop": {
"$ref": "#/definitions/scriptsStop"
},
"prestart": {
"$ref": "#/definitions/scriptsStart"
},
"start": {
"$ref": "#/definitions/scriptsStart"
},
"poststart": {
"$ref": "#/definitions/scriptsStart"
},
"prerestart": {
"$ref": "#/definitions/scriptsRestart"
},
"restart": {
"$ref": "#/definitions/scriptsRestart"
},
"postrestart": {
"$ref": "#/definitions/scriptsRestart"
},
"serve": {
"type": "string",
"description": "Start dev server to serve application files"
}
},
"additionalProperties": {
"type": "string",
"tsType": "string | undefined",
"x-intellij-language-injection": "Shell Script"
}
},
"config": {
"description": "A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.",
"type": "object",
"additionalProperties": true
},
"dependencies": {
"$ref": "#/definitions/dependency"
},
"devDependencies": {
"$ref": "#/definitions/dependency"
},
"optionalDependencies": {
"$ref": "#/definitions/dependency"
},
"peerDependencies": {
"$ref": "#/definitions/dependency"
},
"peerDependenciesMeta": {
"description": "When a user installs your package, warnings are emitted if packages specified in \"peerDependencies\" are not already installed. The \"peerDependenciesMeta\" field serves to provide more information on how your peer dependencies are utilized. Most commonly, it allows peer dependencies to be marked as optional. Metadata for this field is specified with a simple hash of the package name to a metadata object.",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true,
"properties": {
"optional": {
"description": "Specifies that this peer dependency is optional and should not be installed automatically.",
"type": "boolean"
}
}
}
},
"bundleDependencies": {
"description": "Array of package names that will be bundled when publishing the package.",
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "boolean"
}
]
},
"bundledDependencies": {
"description": "DEPRECATED: This field is honored, but \"bundleDependencies\" is the correct field name.",
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "boolean"
}
]
},
"resolutions": {
"description": "Resolutions is used to support selective version resolutions using yarn, which lets you define custom package versions or ranges inside your dependencies. For npm, use overrides instead. See: https://classic.yarnpkg.com/en/docs/selective-version-resolutions",
"type": "object"
},
"overrides": {
"description": "Overrides is used to support selective version overrides using npm, which lets you define custom package versions or ranges inside your dependencies. For yarn, use resolutions instead. See: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides",
"type": "object"
},
"packageManager": {
"description": "Defines which package manager is expected to be used when working on the current project. This field is currently experimental and needs to be opted-in; see https://nodejs.org/api/corepack.html",
"type": "string",
"pattern": "(npm|pnpm|yarn|bun)@\\d+\\.\\d+\\.\\d+(-.+)?"
},
"engines": {
"type": "object",
"properties": {
"node": {
"type": "string"
}
},
"additionalProperties": {
"type": "string"
}
},
"volta": {
"description": "Defines which tools and versions are expected to be used when Volta is installed.",
"type": "object",
"properties": {
"extends": {
"description": "The value of that entry should be a path to another JSON file which also has a \"volta\" section",
"type": "string"
}
},
"patternProperties": {
"(node|npm|pnpm|yarn)": {
"type": "string"
}
}
},
"engineStrict": {
"type": "boolean"
},
"os": {
"description": "Specify which operating systems your module will run on.",
"type": "array",
"items": {
"type": "string"
}
},
"cpu": {
"description": "Specify that your code only runs on certain cpu architectures.",
"type": "array",
"items": {
"type": "string"
}
},
"preferGlobal": {
"type": "boolean",
"description": "DEPRECATED: This option used to trigger an npm warning, but it will no longer warn. It is purely there for informational purposes. It is now recommended that you install any binaries as local devDependencies wherever possible."
},
"private": {
"description": "If set to true, then npm will refuse to publish it.",
"oneOf": [
{
"type": "boolean"
},
{
"enum": [
"false",
"true"
]
}
]
},
"publishConfig": {
"type": "object",
"properties": {
"access": {
"type": "string",
"enum": [
"public",
"restricted"
]
},
"tag": {
"type": "string"
},
"registry": {
"type": "string",
"format": "uri"
},
"provenance": {
"type": "boolean"
}
},
"additionalProperties": true
},
"dist": {
"type": "object",
"properties": {
"shasum": {
"type": "string"
},
"tarball": {
"type": "string"
}
}
},
"readme": {
"type": "string"
},
"module": {
"description": "An ECMAScript module ID that is the primary entry point to your program.",
"type": "string"
},
"esnext": {
"description": "A module ID with untranspiled code that is the primary entry point to your program.",
"type": [
"string",
"object"
],
"properties": {
"main": {
"type": "string"
},
"browser": {
"type": "string"
}
},
"additionalProperties": {
"type": "string"
}
},
"workspaces": {
"description": "Allows packages within a directory to depend on one another using direct linking of local files. Additionally, dependencies within a workspace are hoisted to the workspace root when possible to reduce duplication. Note: It's also a good idea to set \"private\" to true when using this feature.",
"anyOf": [
{
"type": "array",
"description": "Workspace package paths. Glob patterns are supported.",
"items": {
"type": "string"
}
},
{
"type": "object",
"properties": {
"packages": {
"type": "array",
"description": "Workspace package paths. Glob patterns are supported.",
"items": {
"type": "string"
}
},
"nohoist": {
"type": "array",
"description": "Packages to block from hoisting to the workspace root. Currently only supported in Yarn only.",
"items": {
"type": "string"
}
}
}
}
]
},
"jspm": {
"$ref": "#"
},
"eslintConfig": {
"$ref": "https://json.schemastore.org/eslintrc.json"
},
"prettier": {
"$ref": "https://json.schemastore.org/prettierrc.json"
},
"stylelint": {
"$ref": "https://json.schemastore.org/stylelintrc.json"
},
"ava": {
"$ref": "https://json.schemastore.org/ava.json"
},
"release": {
"$ref": "https://json.schemastore.org/semantic-release.json"
},
"jscpd": {
"$ref": "https://json.schemastore.org/jscpd.json"
}
},
"anyOf": [
{
"type": "object",
"not": {
"required": [
"bundledDependencies",
"bundleDependencies"
]
}
},
{
"type": "object",
"not": {
"required": [
"bundleDependencies"
]
},
"required": [
"bundledDependencies"
]
},
{
"type": "object",
"not": {
"required": [
"bundledDependencies"
]
},
"required": [
"bundleDependencies"
]
}
],
"$id": "https://json.schemastore.org/package.json"
}

View File

@@ -0,0 +1,396 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/prettierrc.json",
"definitions": {
"optionsDefinition": {
"type": "object",
"properties": {
"arrowParens": {
"description": "Include parentheses around a sole arrow function parameter.",
"default": "always",
"oneOf": [
{
"enum": ["always"],
"description": "Always include parens. Example: `(x) => x`"
},
{
"enum": ["avoid"],
"description": "Omit parens when possible. Example: `x => x`"
}
]
},
"bracketSameLine": {
"description": "Put > of opening tags on the last line instead of on a new line.",
"default": false,
"type": "boolean"
},
"bracketSpacing": {
"description": "Print spaces between brackets.",
"default": true,
"type": "boolean"
},
"cursorOffset": {
"description": "Print (to stderr) where a cursor at the given position would move to after formatting.",
"default": -1,
"type": "integer"
},
"embeddedLanguageFormatting": {
"description": "Control how Prettier formats quoted code embedded in the file.",
"default": "auto",
"oneOf": [
{
"enum": ["auto"],
"description": "Format embedded code if Prettier can automatically identify it."
},
{
"enum": ["off"],
"description": "Never automatically format embedded code."
}
]
},
"endOfLine": {
"description": "Which end of line characters to apply.",
"default": "lf",
"oneOf": [
{
"enum": ["lf"],
"description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
},
{
"enum": ["crlf"],
"description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
},
{
"enum": ["cr"],
"description": "Carriage Return character only (\\r), used very rarely"
},
{
"enum": ["auto"],
"description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)"
}
]
},
"experimentalTernaries": {
"description": "Use curious ternaries, with the question mark after the condition.",
"default": false,
"type": "boolean"
},
"filepath": {
"description": "Specify the input filepath. This will be used to do parser inference.",
"type": "string"
},
"htmlWhitespaceSensitivity": {
"description": "How to handle whitespaces in HTML.",
"default": "css",
"oneOf": [
{
"enum": ["css"],
"description": "Respect the default value of CSS display property."
},
{
"enum": ["strict"],
"description": "Whitespaces are considered sensitive."
},
{
"enum": ["ignore"],
"description": "Whitespaces are considered insensitive."
}
]
},
"insertPragma": {
"description": "Insert @format pragma into file's first docblock comment.",
"default": false,
"type": "boolean"
},
"jsxSingleQuote": {
"description": "Use single quotes in JSX.",
"default": false,
"type": "boolean"
},
"parser": {
"description": "Which parser to use.",
"anyOf": [
{
"enum": ["flow"],
"description": "Flow"
},
{
"enum": ["babel"],
"description": "JavaScript"
},
{
"enum": ["babel-flow"],
"description": "Flow"
},
{
"enum": ["babel-ts"],
"description": "TypeScript"
},
{
"enum": ["typescript"],
"description": "TypeScript"
},
{
"enum": ["acorn"],
"description": "JavaScript"
},
{
"enum": ["espree"],
"description": "JavaScript"
},
{
"enum": ["meriyah"],
"description": "JavaScript"
},
{
"enum": ["css"],
"description": "CSS"
},
{
"enum": ["less"],
"description": "Less"
},
{
"enum": ["scss"],
"description": "SCSS"
},
{
"enum": ["json"],
"description": "JSON"
},
{
"enum": ["json5"],
"description": "JSON5"
},
{
"enum": ["jsonc"],
"description": "JSON with Comments"
},
{
"enum": ["json-stringify"],
"description": "JSON.stringify"
},
{
"enum": ["graphql"],
"description": "GraphQL"
},
{
"enum": ["markdown"],
"description": "Markdown"
},
{
"enum": ["mdx"],
"description": "MDX"
},
{
"enum": ["vue"],
"description": "Vue"
},
{
"enum": ["yaml"],
"description": "YAML"
},
{
"enum": ["glimmer"],
"description": "Ember / Handlebars"
},
{
"enum": ["html"],
"description": "HTML"
},
{
"enum": ["angular"],
"description": "Angular"
},
{
"enum": ["lwc"],
"description": "Lightning Web Components"
},
{
"type": "string",
"description": "Custom parser"
}
]
},
"plugins": {
"description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"printWidth": {
"description": "The line length where Prettier will try wrap.",
"default": 80,
"type": "integer"
},
"proseWrap": {
"description": "How to wrap prose.",
"default": "preserve",
"oneOf": [
{
"enum": ["always"],
"description": "Wrap prose if it exceeds the print width."
},
{
"enum": ["never"],
"description": "Do not wrap prose."
},
{
"enum": ["preserve"],
"description": "Wrap prose as-is."
}
]
},
"quoteProps": {
"description": "Change when properties in objects are quoted.",
"default": "as-needed",
"oneOf": [
{
"enum": ["as-needed"],
"description": "Only add quotes around object properties where required."
},
{
"enum": ["consistent"],
"description": "If at least one property in an object requires quotes, quote all properties."
},
{
"enum": ["preserve"],
"description": "Respect the input use of quotes in object properties."
}
]
},
"rangeEnd": {
"description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",
"default": null,
"type": "integer"
},
"rangeStart": {
"description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",
"default": 0,
"type": "integer"
},
"requirePragma": {
"description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment\nin order for it to be formatted.",
"default": false,
"type": "boolean"
},
"semi": {
"description": "Print semicolons.",
"default": true,
"type": "boolean"
},
"singleAttributePerLine": {
"description": "Enforce single attribute per line in HTML, Vue and JSX.",
"default": false,
"type": "boolean"
},
"singleQuote": {
"description": "Use single quotes instead of double quotes.",
"default": false,
"type": "boolean"
},
"tabWidth": {
"description": "Number of spaces per indentation level.",
"default": 2,
"type": "integer"
},
"trailingComma": {
"description": "Print trailing commas wherever possible when multi-line.",
"default": "all",
"oneOf": [
{
"enum": ["all"],
"description": "Trailing commas wherever possible (including function arguments)."
},
{
"enum": ["es5"],
"description": "Trailing commas where valid in ES5 (objects, arrays, etc.)"
},
{
"enum": ["none"],
"description": "No trailing commas."
}
]
},
"useTabs": {
"description": "Indent with tabs instead of spaces.",
"default": false,
"type": "boolean"
},
"vueIndentScriptAndStyle": {
"description": "Indent script and style tags in Vue files.",
"default": false,
"type": "boolean"
}
}
},
"overridesDefinition": {
"type": "object",
"properties": {
"overrides": {
"type": "array",
"description": "Provide a list of patterns to override prettier configuration.",
"items": {
"type": "object",
"required": ["files"],
"properties": {
"files": {
"description": "Include these files in this override.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"excludeFiles": {
"description": "Exclude these files from this override.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"options": {
"$ref": "#/definitions/optionsDefinition",
"type": "object",
"description": "The options to apply for this override."
}
},
"additionalProperties": false
}
}
}
}
},
"oneOf": [
{
"type": "object",
"allOf": [
{
"$ref": "#/definitions/optionsDefinition"
},
{
"$ref": "#/definitions/overridesDefinition"
}
]
},
{
"type": "string"
}
],
"title": "Schema for .prettierrc"
}

View File

@@ -0,0 +1,405 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/jscpd.json",
"additionalProperties": false,
"definitions": {
"colorPreset": {
"enum": [
"green",
"blue",
"red",
"yellow",
"orange",
"purple",
"pink",
"grey",
"gray",
"cyan",
"black"
]
},
"colorHex": {
"type": "string",
"pattern": "([0-9a-fA-F]{3}){1,2}"
},
"color": {
"oneOf": [
{
"$ref": "#/definitions/colorPreset"
},
{
"$ref": "#/definitions/colorHex"
}
]
},
"format": {
"enum": [
"abap",
"actionscript",
"ada",
"apacheconf",
"apl",
"applescript",
"arduino",
"arff",
"asciidoc",
"asm6502",
"aspnet",
"autohotkey",
"autoit",
"bash",
"basic",
"batch",
"bison",
"brainfuck",
"bro",
"c",
"c-header",
"clike",
"clojure",
"coffeescript",
"comments",
"cpp",
"cpp-header",
"crystal",
"csharp",
"csp",
"css-extras",
"css",
"d",
"dart",
"diff",
"django",
"docker",
"eiffel",
"elixir",
"elm",
"erb",
"erlang",
"flow",
"fortran",
"fsharp",
"gedcom",
"gherkin",
"git",
"glsl",
"go",
"graphql",
"groovy",
"haml",
"handlebars",
"haskell",
"haxe",
"hpkp",
"hsts",
"http",
"ichigojam",
"icon",
"inform7",
"ini",
"io",
"j",
"java",
"javascript",
"jolie",
"json",
"jsx",
"julia",
"keymap",
"kotlin",
"latex",
"less",
"liquid",
"lisp",
"livescript",
"lolcode",
"lua",
"makefile",
"markdown",
"markup",
"matlab",
"mel",
"mizar",
"monkey",
"n4js",
"nasm",
"nginx",
"nim",
"nix",
"nsis",
"objectivec",
"ocaml",
"opencl",
"oz",
"parigp",
"pascal",
"perl",
"php",
"plsql",
"powershell",
"processing",
"prolog",
"properties",
"protobuf",
"pug",
"puppet",
"pure",
"python",
"q",
"qore",
"r",
"reason",
"renpy",
"rest",
"rip",
"roboconf",
"ruby",
"rust",
"sas",
"sass",
"scala",
"scheme",
"scss",
"smalltalk",
"smarty",
"soy",
"sql",
"stylus",
"swift",
"tap",
"tcl",
"textile",
"tsx",
"tt2",
"twig",
"typescript",
"vbnet",
"velocity",
"verilog",
"vhdl",
"vim",
"visual-basic",
"wasm",
"url",
"wiki",
"xeora",
"xojo",
"xquery",
"yaml"
]
}
},
"properties": {
"minLines": {
"type": "integer",
"default": 5,
"description": "minimum size of code block in lines to check for duplication"
},
"maxLines": {
"type": "integer",
"default": 1000,
"description": "maximum size of source file in lines to check for duplication"
},
"maxSize": {
"anyOf": [
{
"type": "string",
"pattern": "^\\+?[0-9]+(\\.[0-9]+)? *[kKmMgGtTpP][bB]$"
},
{
"type": "integer"
}
],
"default": "100kb",
"description": "maximum size of source file in bytes to check for duplication (e.g.,: 1kb, 1mb, 120kb)"
},
"minTokens": {
"type": "integer",
"default": 50,
"description": "minimum size of code block in tokens to check for duplication"
},
"threshold": {
"type": "number",
"description": "maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded"
},
"formatsExts": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
},
"default": {},
"description": "custom mapping from formats to file extensions (default: https://github.com/kucherenko/jscpd/blob/master/packages/tokenizer/src/formats.ts); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md"
},
"output": {
"type": "string",
"default": "./report",
"description": "path to directory for non-console reports"
},
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "paths that should be included in duplicate detection (default: [process.cwd()])"
},
"pattern": {
"type": "string",
"default": "**/*",
"description": "glob pattern for files that should be included in duplicate detection (e.g., **/*.txt); only used to filter directories configured via path option"
},
"ignorePattern": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "ignore code blocks matching these regular expressions"
},
"mode": {
"enum": ["mild", "strict", "weak"],
"default": "mild",
"description": "mode of detection quality; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode"
},
"ignore": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "glob pattern for files that should be excluded from duplicate detection"
},
"format": {
"type": "array",
"items": {
"$ref": "#/definitions/format"
},
"description": "list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md"
},
"store": {
"enum": ["leveldb", "redis"],
"description": "store used to collect information about code (default: in-memory store); install @jscpd/leveldb-store and use leveldb for big repositories"
},
"reporters": {
"type": "array",
"items": {
"enum": [
"xml",
"json",
"csv",
"markdown",
"consoleFull",
"html",
"console",
"silent",
"threshold",
"xcode"
]
},
"default": ["console"],
"description": "a list of reporters to use to output information about duplication; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters"
},
"blame": {
"type": "boolean",
"default": false,
"description": "get information about authors and dates of duplicated blocks from Git"
},
"silent": {
"type": "boolean",
"default": false,
"description": "do not write duplicate detection progress and result to console"
},
"verbose": {
"type": "boolean",
"default": false,
"description": "show full information during duplicate detection"
},
"absolute": {
"type": "boolean",
"default": false,
"description": "use absolute paths in reports"
},
"noSymlinks": {
"type": "boolean",
"default": false,
"description": "do not follow symlinks"
},
"skipLocal": {
"type": "boolean",
"default": false,
"description": "skip duplicates within folders; just detect cross-folder duplicates"
},
"ignoreCase": {
"type": "boolean",
"default": false,
"description": "ignore case of symbols in code (experimental)"
},
"gitignore": {
"type": "boolean",
"default": false,
"description": "ignore all files from .gitignore file"
},
"reportersOptions": {
"type": "object",
"default": {},
"additionalProperties": false,
"properties": {
"badge": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"description": "output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg'))"
},
"label": {
"type": "string",
"default": "Copy/Paste",
"description": "badge subject text (URL-encoding needed for spaces or special characters)"
},
"labelColor": {
"$ref": "#/definitions/color",
"default": "555",
"description": "badge label color (name or RGB code without #); see https://github.com/badgen/badgen/blob/master/src/color-presets.ts"
},
"status": {
"type": "string",
"description": "badge value text (URL-encoding needed for spaces or special characters, default: duplication %)"
},
"color": {
"$ref": "#/definitions/color",
"description": "badge color (name or RGB code without #, default: green if beneath threshold, red if above threshold, grey if threshold not set); see https://github.com/badgen/badgen/blob/master/src/color-presets.ts"
},
"style": {
"enum": ["flat", "classic"],
"default": "classic",
"description": "badge look: flat or classic"
},
"icon": {
"type": "string",
"description": "URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...)"
},
"iconWidth": {
"type": "number",
"default": 13,
"description": "SVG width of icon to display in front of badge subject text; set this if icon is not square"
},
"scale": {
"type": "number",
"default": 1,
"description": "size of badge relative to default of 1"
}
}
}
}
},
"exitCode": {
"type": "integer",
"default": 0,
"description": "exit code to use when at least one duplicate code block is detected but threshold is not exceeded"
}
},
"type": "object"
}

View File

@@ -0,0 +1,167 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/ava.json",
"additionalProperties": false,
"definitions": {
"path": {
"type": "string",
"minLength": 1
},
"array-of-strings": {
"type": "array",
"items": {
"type": "string"
}
},
"array-of-paths": {
"type": "array",
"items": {
"$ref": "#/definitions/path"
}
}
},
"description": "Configuration Schema for the JavaScript test runner AVA",
"properties": {
"files": {
"$ref": "#/definitions/array-of-paths",
"description": "An array of glob patterns to select test files. Files with an underscore prefix are ignored. By default only selects files with `cjs`, `mjs` & `js` extensions, even if the pattern matches other files. Specify `extensions` to allow other file extensions"
},
"ignoredByWatcher": {
"$ref": "#/definitions/array-of-paths",
"description": "An array of glob patterns to match files that, even if changed, are ignored by the watcher"
},
"match": {
"$ref": "#/definitions/array-of-paths",
"description": "Not typically useful in the `package.json` configuration, but equivalent to specifying `--match` on the CLI"
},
"cache": {
"type": "boolean",
"default": true,
"description": "Defaults to `true` to cache compiled files under `node_modules/.cache/ava.` If `false`, files are cached in a temporary directory instead"
},
"concurrency": {
"type": "number",
"description": "Max number of test files running at the same time (default: CPU cores)"
},
"workerThreads": {
"type": "boolean",
"default": true,
"description": "Use worker threads to run tests (enabled by default). If `false`, tests will run in child processes"
},
"failFast": {
"type": "boolean",
"default": false,
"description": "Stop running further tests once a test fails"
},
"failWithoutAssertions": {
"type": "boolean",
"default": true,
"description": "If `false`, does not fail a test if it doesn't run assertions"
},
"environmentVariables": {
"title": "environment variables",
"type": "object",
"description": "Specifies environment variables to be made available to the tests. The environment variables defined here override the ones from `process.env`",
"additionalProperties": {
"type": "string"
}
},
"serial": {
"type": "boolean",
"default": false,
"description": "if `true`, prevents parallel execution of tests within a file"
},
"tap": {
"type": "boolean",
"default": false,
"description": "If `true`, enables the TAP reporter"
},
"verbose": {
"type": "boolean",
"default": false,
"description": "If `true`, enables verbose output (though currently non-verbose output is not supported)"
},
"snapshotDir": {
"$ref": "#/definitions/path",
"description": "Specifies a fixed location for storing snapshot files. Use this if your snapshots are ending up in the wrong location"
},
"extensions": {
"anyOf": [
{
"$ref": "#/definitions/array-of-strings"
},
{
"title": "extensions",
"type": "object",
"patternProperties": {
"^(c|m)?js$": {
"enum": [true]
}
},
"additionalProperties": {
"enum": ["commonjs", "module"]
}
}
],
"default": ["cjs", "mjs", "js"],
"description": "Extensions of test files. Setting this overrides the default `[\"cjs\", \"mjs\", \"js\"]` value, so make sure to include those extensions in the list. Experimentally you can configure how files are loaded"
},
"require": {
"$ref": "#/definitions/array-of-paths",
"description": "Extra modules to require before tests are run. Modules are required in the worker processes"
},
"timeout": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "string",
"pattern": "^(\\d+)(s|m)$"
}
],
"default": "10s",
"description": "Timeouts in AVA behave differently than in other test frameworks. AVA resets a timer after each test, forcing tests to quit if no new test results were received within the specified timeout. This can be used to handle stalled tests. See our timeout documentation for more options"
},
"nodeArguments": {
"$ref": "#/definitions/array-of-strings",
"description": "Configure Node.js arguments used to launch worker processes"
},
"utilizeParallelBuilds": {
"type": "boolean",
"default": true,
"description": "If `false`, disable parallel builds (default: `true`)"
},
"typescript": {
"title": "configuration",
"type": "object",
"description": "Configures @ava/typescript for projects that precompile TypeScript. Alternatively, you can use `ts-node` to do live testing without transpiling, in which case you shouldn't use the `typescript` property",
"properties": {
"extensions": {
"$ref": "#/definitions/array-of-paths",
"default": ["ts"],
"description": "You can configure AVA to recognize additional file extensions as TypeScript (e.g., `[\"ts\", \"tsx\"]` to add partial JSX support). Note that the preserve mode for JSX is not (yet) supported. See also AVA's `extensions` object"
},
"rewritePaths": {
"title": "paths",
"type": "object",
"description": "AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories. Paths are relative to your project directory",
"patternProperties": {
"/$": {
"type": "string",
"pattern": "/$"
}
}
},
"compile": {
"enum": [false, "tsc"],
"default": false,
"description": "If `false`, AVA will assume you have already compiled your project. If set to `'tsc'`, AVA will run the TypeScript compiler before running your tests. This can be inefficient when using AVA in watch mode"
}
}
}
},
"title": "AVA Config Schema",
"type": "object"
}