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

Version Path
govuk_publishing_components-16.19.0 node_modules/standard/node_modules/eslint/conf/config-schema.js
govuk_publishing_components-16.18.0 node_modules/standard/node_modules/eslint/conf/config-schema.js
govuk_publishing_components-16.17.0 node_modules/standard/node_modules/eslint/conf/config-schema.js