github-pages-deploy-action/node_modules/eslint/conf/config-schema.js

94 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2020-09-13 06:19:45 +08:00
/*
* STOP!!! DO NOT MODIFY.
*
* This file is part of the ongoing work to move the eslintrc-style config
* system into the @eslint/eslintrc package. This file needs to remain
* unchanged in order for this work to proceed.
*
* If you think you need to change this file, please contact @nzakas first.
*
* Thanks in advance for your cooperation.
*/
2020-03-07 11:45:40 +08:00
/**
* @fileoverview Defines a schema for configs.
* @author Sylvan Mably
*/
"use strict";
const baseConfigProperties = {
2020-03-31 20:40:00 +08:00
$schema: { type: "string" },
2020-03-07 11:45:40 +08:00
env: { type: "object" },
2020-03-31 20:40:00 +08:00
extends: { $ref: "#/definitions/stringOrStrings" },
2020-03-07 11:45:40 +08:00
globals: { type: "object" },
2020-03-31 20:40:00 +08:00
overrides: {
type: "array",
items: { $ref: "#/definitions/overrideConfig" },
additionalItems: false
},
2020-03-07 11:45:40 +08:00
parser: { type: ["string", "null"] },
parserOptions: { type: "object" },
plugins: { type: "array" },
2020-03-31 20:40:00 +08:00
processor: { type: "string" },
2020-03-07 11:45:40 +08:00
rules: { type: "object" },
settings: { type: "object" },
2020-03-31 20:40:00 +08:00
noInlineConfig: { type: "boolean" },
reportUnusedDisableDirectives: { type: "boolean" },
2020-03-07 11:45:40 +08:00
ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
};
2020-03-31 20:40:00 +08:00
const configSchema = {
definitions: {
stringOrStrings: {
2020-03-07 11:45:40 +08:00
oneOf: [
{ type: "string" },
{
type: "array",
items: { type: "string" },
2020-03-31 20:40:00 +08:00
additionalItems: false
2020-03-07 11:45:40 +08:00
}
]
},
2020-03-31 20:40:00 +08:00
stringOrStringsRequired: {
2020-03-07 11:45:40 +08:00
oneOf: [
{ type: "string" },
{
type: "array",
2020-03-31 20:40:00 +08:00
items: { type: "string" },
additionalItems: false,
minItems: 1
2020-03-07 11:45:40 +08:00
}
]
2020-03-31 20:40:00 +08:00
},
// Config at top-level.
objectConfig: {
type: "object",
properties: {
root: { type: "boolean" },
ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
...baseConfigProperties
},
additionalProperties: false
},
2020-03-07 11:45:40 +08:00
2020-03-31 20:40:00 +08:00
// Config in `overrides`.
overrideConfig: {
type: "object",
properties: {
excludedFiles: { $ref: "#/definitions/stringOrStrings" },
files: { $ref: "#/definitions/stringOrStringsRequired" },
...baseConfigProperties
},
required: ["files"],
additionalProperties: false
2020-03-07 11:45:40 +08:00
}
2020-03-31 20:40:00 +08:00
},
2020-03-07 11:45:40 +08:00
2020-03-31 20:40:00 +08:00
$ref: "#/definitions/objectConfig"
2020-03-07 11:45:40 +08:00
};
module.exports = configSchema;