當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript kernel.TextlintKernelDescriptor類代碼示例

本文整理匯總了TypeScript中@textlint/kernel.TextlintKernelDescriptor的典型用法代碼示例。如果您正苦於以下問題:TypeScript TextlintKernelDescriptor類的具體用法?TypeScript TextlintKernelDescriptor怎麽用?TypeScript TextlintKernelDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TextlintKernelDescriptor類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: setupPlugins

 /**
  * register Processors
  * @param {Object} plugins
  * @param {Object} [pluginsConfig]
  */
 setupPlugins(
     plugins: { [index: string]: TextlintPluginCreator } = {},
     pluginsConfig: { [index: string]: TextlintPluginOptions } = {}
 ) {
     // Append default plugin to the plugins list.
     // Because, default plugin can be override by user plugins
     this.textlintKernelDescriptor = this.textlintKernelDescriptor.shallowMerge({
         plugins: pluginsObjectToKernelRule(plugins, pluginsConfig).concat(this.defaultPlugins)
     });
 }
開發者ID:textlint,項目名稱:textlint,代碼行數:15,代碼來源:textlint-core.ts

示例2: addProcessor

 /**
  * Use setupPlugins insteadof it.
  *
  * ````
  * textlint.setupPlugins({
  *   yourPluginName: yourPlugin
  * });
  * ````
  *
  * @param {*} Processor
  * @deprecated
  *
  * It will be removed until textlint@10
  */
 addProcessor(Processor: TextlintPluginProcessorConstructor) {
     throwIfTesting(
         "Use setupPlugins insteadof addProcessor method.`addProcessor` will be removed in the future." +
             "For more details, See https://github.com/textlint/textlint/issues/293"
     );
     this.textlintKernelDescriptor = this.textlintKernelDescriptor.shallowMerge({
         plugins: [
             {
                 pluginId: "`${Processor.name}@deprecated`",
                 plugin: { Processor }
             }
         ].concat(this.defaultPlugins)
     });
 }
開發者ID:textlint,項目名稱:textlint,代碼行數:28,代碼來源:textlint-core.ts

示例3: setupFilterRules

 /**
  * Register filterRules and filterRulesConfig.
  * if want to release rules, please call {@link resetRules}.
  * @param {object} filterRules rule objects array
  * @param {object} [filterRulesOption] ruleConfig is object
  */
 setupFilterRules(filterRules = {}, filterRulesOption = {}) {
     this.textlintKernelDescriptor = this.textlintKernelDescriptor.shallowMerge({
         filterRules: filterRulesObjectToKernelRule(filterRules, filterRulesOption)
     });
 }
開發者ID:textlint,項目名稱:textlint,代碼行數:11,代碼來源:textlint-core.ts

示例4: setupRules

 /**
  * Register rules and rulesConfig.
  * if want to release rules, please call {@link resetRules}.
  * @param {object} rules rule objects array
  * @param {object} [rulesOption] ruleConfig is object
  */
 setupRules(rules = {}, rulesOption = {}) {
     this.textlintKernelDescriptor = this.textlintKernelDescriptor.shallowMerge({
         rules: rulesObjectToKernelRule(rules, rulesOption)
     });
 }
開發者ID:textlint,項目名稱:textlint,代碼行數:11,代碼來源:textlint-core.ts


注:本文中的@textlint/kernel.TextlintKernelDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。