Sha256: 52d7e56b2355d384e1f77ca801058f73c7cedbdc104cf2486dc07265530cb011
Contents?: true
Size: 1.56 KB
Versions: 43
Compression:
Stored size: 1.56 KB
Contents
/** * @fileoverview Defines a schema for configs. * @author Sylvan Mably */ "use strict"; const baseConfigProperties = { env: { type: "object" }, globals: { type: "object" }, parser: { type: ["string", "null"] }, parserOptions: { type: "object" }, plugins: { type: "array" }, rules: { type: "object" }, settings: { type: "object" }, ecmaFeatures: { type: "object" } // deprecated; logs a warning when used }; const overrideProperties = Object.assign( {}, baseConfigProperties, { files: { oneOf: [ { type: "string" }, { type: "array", items: { type: "string" }, minItems: 1 } ] }, excludedFiles: { oneOf: [ { type: "string" }, { type: "array", items: { type: "string" } } ] } } ); const topLevelConfigProperties = Object.assign( {}, baseConfigProperties, { extends: { type: ["string", "array"] }, root: { type: "boolean" }, overrides: { type: "array", items: { type: "object", properties: overrideProperties, required: ["files"], additionalProperties: false } } } ); const configSchema = { type: "object", properties: topLevelConfigProperties, additionalProperties: false }; module.exports = configSchema;
Version data entries
43 entries across 43 versions & 1 rubygems