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.

types.js 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * @fileoverview Define common types for input completion.
  3. * @author Toru Nagashima <https://github.com/mysticatea>
  4. */
  5. "use strict";
  6. /** @type {any} */
  7. module.exports = {};
  8. /** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */
  9. /** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */
  10. /** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */
  11. /**
  12. * @typedef {Object} EcmaFeatures
  13. * @property {boolean} [globalReturn] Enabling `return` statements at the top-level.
  14. * @property {boolean} [jsx] Enabling JSX syntax.
  15. * @property {boolean} [impliedStrict] Enabling strict mode always.
  16. */
  17. /**
  18. * @typedef {Object} ParserOptions
  19. * @property {EcmaFeatures} [ecmaFeatures] The optional features.
  20. * @property {3|5|6|7|8|9|10|11|12|2015|2016|2017|2018|2019|2020|2021} [ecmaVersion] The ECMAScript version (or revision number).
  21. * @property {"script"|"module"} [sourceType] The source code type.
  22. */
  23. /**
  24. * @typedef {Object} ConfigData
  25. * @property {Record<string, boolean>} [env] The environment settings.
  26. * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs.
  27. * @property {Record<string, GlobalConf>} [globals] The global variable settings.
  28. * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint.
  29. * @property {boolean} [noInlineConfig] The flag that disables directive comments.
  30. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files.
  31. * @property {string} [parser] The path to a parser or the package name of a parser.
  32. * @property {ParserOptions} [parserOptions] The parser options.
  33. * @property {string[]} [plugins] The plugin specifiers.
  34. * @property {string} [processor] The processor specifier.
  35. * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments.
  36. * @property {boolean} [root] The root flag.
  37. * @property {Record<string, RuleConf>} [rules] The rule settings.
  38. * @property {Object} [settings] The shared settings.
  39. */
  40. /**
  41. * @typedef {Object} OverrideConfigData
  42. * @property {Record<string, boolean>} [env] The environment settings.
  43. * @property {string | string[]} [excludedFiles] The glob patterns for excluded files.
  44. * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs.
  45. * @property {string | string[]} files The glob patterns for target files.
  46. * @property {Record<string, GlobalConf>} [globals] The global variable settings.
  47. * @property {boolean} [noInlineConfig] The flag that disables directive comments.
  48. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files.
  49. * @property {string} [parser] The path to a parser or the package name of a parser.
  50. * @property {ParserOptions} [parserOptions] The parser options.
  51. * @property {string[]} [plugins] The plugin specifiers.
  52. * @property {string} [processor] The processor specifier.
  53. * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments.
  54. * @property {Record<string, RuleConf>} [rules] The rule settings.
  55. * @property {Object} [settings] The shared settings.
  56. */
  57. /**
  58. * @typedef {Object} ParseResult
  59. * @property {Object} ast The AST.
  60. * @property {ScopeManager} [scopeManager] The scope manager of the AST.
  61. * @property {Record<string, any>} [services] The services that the parser provides.
  62. * @property {Record<string, string[]>} [visitorKeys] The visitor keys of the AST.
  63. */
  64. /**
  65. * @typedef {Object} Parser
  66. * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables.
  67. * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment.
  68. */
  69. /**
  70. * @typedef {Object} Environment
  71. * @property {Record<string, GlobalConf>} [globals] The definition of global variables.
  72. * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment.
  73. */
  74. /**
  75. * @typedef {Object} LintMessage
  76. * @property {number} column The 1-based column number.
  77. * @property {number} [endColumn] The 1-based column number of the end location.
  78. * @property {number} [endLine] The 1-based line number of the end location.
  79. * @property {boolean} fatal If `true` then this is a fatal error.
  80. * @property {{range:[number,number], text:string}} [fix] Information for autofix.
  81. * @property {number} line The 1-based line number.
  82. * @property {string} message The error message.
  83. * @property {string|null} ruleId The ID of the rule which makes this message.
  84. * @property {0|1|2} severity The severity of this message.
  85. * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions.
  86. */
  87. /**
  88. * @typedef {Object} SuggestionResult
  89. * @property {string} desc A short description.
  90. * @property {string} [messageId] Id referencing a message for the description.
  91. * @property {{ text: string, range: number[] }} fix fix result info
  92. */
  93. /**
  94. * @typedef {Object} Processor
  95. * @property {(text:string, filename:string) => Array<string | { text:string, filename:string }>} [preprocess] The function to extract code blocks.
  96. * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages.
  97. * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix.
  98. */
  99. /**
  100. * @typedef {Object} RuleMetaDocs
  101. * @property {string} category The category of the rule.
  102. * @property {string} description The description of the rule.
  103. * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset.
  104. * @property {string} url The URL of the rule documentation.
  105. */
  106. /**
  107. * @typedef {Object} RuleMeta
  108. * @property {boolean} [deprecated] If `true` then the rule has been deprecated.
  109. * @property {RuleMetaDocs} docs The document information of the rule.
  110. * @property {"code"|"whitespace"} [fixable] The autofix type.
  111. * @property {Record<string,string>} [messages] The messages the rule reports.
  112. * @property {string[]} [replacedBy] The IDs of the alternative rules.
  113. * @property {Array|Object} schema The option schema of the rule.
  114. * @property {"problem"|"suggestion"|"layout"} type The rule type.
  115. */
  116. /**
  117. * @typedef {Object} Rule
  118. * @property {Function} create The factory of the rule.
  119. * @property {RuleMeta} meta The meta data of the rule.
  120. */
  121. /**
  122. * @typedef {Object} Plugin
  123. * @property {Record<string, ConfigData>} [configs] The definition of plugin configs.
  124. * @property {Record<string, Environment>} [environments] The definition of plugin environments.
  125. * @property {Record<string, Processor>} [processors] The definition of plugin processors.
  126. * @property {Record<string, Function | Rule>} [rules] The definition of plugin rules.
  127. */
  128. /**
  129. * Information of deprecated rules.
  130. * @typedef {Object} DeprecatedRuleInfo
  131. * @property {string} ruleId The rule ID.
  132. * @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
  133. */