Steven Fukase 4 سال پیش
والد
کامیت
9e1811a42d
1فایلهای تغییر یافته به همراه10 افزوده شده و 10 حذف شده
  1. 10 10
      packages/app/src/client/util/codemirror/codemirror-textlint.ts

+ 10 - 10
packages/app/src/client/util/codemirror/codemirror-textlint.ts

@@ -23,7 +23,15 @@ const ruleModulesList = {
 
 const logger = loggerFactory('growi:codemirror:codemirror-textlint');
 const kernel = new TextlintKernel();
-const textlintOption: TextlintRuleOptions<RuleExtension> = { ext: '.md' };
+const textlintOption: TextlintRuleOptions<RuleExtension> = {
+  ext: '.md',
+  plugins: [
+    {
+      pluginId: 'markdown',
+      plugin: require('textlint-plugin-markdown'),
+    },
+  ],
+};
 
 const createSetupRules = (rules, ruleOptions) => (
   Object.keys(rules).map(ruleName => (
@@ -60,15 +68,7 @@ export const createValidator = (rulesConfigArray: RulesConfigArray): AsyncLinter
 
   Object.assign(
     textlintOption,
-    {
-      rules: createSetupRules(rules, rulesOption),
-      plugins: [
-        {
-          pluginId: 'markdown',
-          plugin: require('textlint-plugin-markdown'),
-        },
-      ],
-    },
+    { rules: createSetupRules(rules, rulesOption) },
   );