Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config-schema.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * @fileoverview Defines a schema for configs.
  3. * @author Sylvan Mably
  4. */
  5. "use strict";
  6. const baseConfigProperties = {
  7. $schema: { type: "string" },
  8. env: { type: "object" },
  9. extends: { $ref: "#/definitions/stringOrStrings" },
  10. globals: { type: "object" },
  11. overrides: {
  12. type: "array",
  13. items: { $ref: "#/definitions/overrideConfig" },
  14. additionalItems: false
  15. },
  16. parser: { type: ["string", "null"] },
  17. parserOptions: { type: "object" },
  18. plugins: { type: "array" },
  19. processor: { type: "string" },
  20. rules: { type: "object" },
  21. settings: { type: "object" },
  22. noInlineConfig: { type: "boolean" },
  23. reportUnusedDisableDirectives: { type: "boolean" },
  24. ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
  25. };
  26. const configSchema = {
  27. definitions: {
  28. stringOrStrings: {
  29. oneOf: [
  30. { type: "string" },
  31. {
  32. type: "array",
  33. items: { type: "string" },
  34. additionalItems: false
  35. }
  36. ]
  37. },
  38. stringOrStringsRequired: {
  39. oneOf: [
  40. { type: "string" },
  41. {
  42. type: "array",
  43. items: { type: "string" },
  44. additionalItems: false,
  45. minItems: 1
  46. }
  47. ]
  48. },
  49. // Config at top-level.
  50. objectConfig: {
  51. type: "object",
  52. properties: {
  53. root: { type: "boolean" },
  54. ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
  55. ...baseConfigProperties
  56. },
  57. additionalProperties: false
  58. },
  59. // Config in `overrides`.
  60. overrideConfig: {
  61. type: "object",
  62. properties: {
  63. excludedFiles: { $ref: "#/definitions/stringOrStrings" },
  64. files: { $ref: "#/definitions/stringOrStringsRequired" },
  65. ...baseConfigProperties
  66. },
  67. required: ["files"],
  68. additionalProperties: false
  69. }
  70. },
  71. $ref: "#/definitions/objectConfig"
  72. };
  73. module.exports = configSchema;