Skip to content
代码片段 群组 项目
  • Paul Gascou-Vaillancourt's avatar
    a312aa7d
    Lint against outdated usages of `helpPagePath` · a312aa7d
    Paul Gascou-Vaillancourt 创作于
    As docs pages get moved around or deleted, docs links that we display in
    the product might become outdated without us noticing.
    This adds an ESLint rule that ensures `helpPagePath` always points to
    files and anchors that still exist.
    In future iterations, we should add a similar rule to check usages of
    the `HelpPageLink` Vue component, and a Rubocop rule for the backend
    `help_page_path` helper.
    未验证
    a312aa7d
    历史
    Lint against outdated usages of `helpPagePath`
    Paul Gascou-Vaillancourt 创作于
    As docs pages get moved around or deleted, docs links that we display in
    the product might become outdated without us noticing.
    This adds an ESLint rule that ensures `helpPagePath` always points to
    files and anchors that still exist.
    In future iterations, we should add a similar rule to check usages of
    the `HelpPageLink` Vue component, and a Rubocop rule for the backend
    `help_page_path` helper.
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。
eslint-plugin-local-rules+3.0.2.patch 1.24 KiB
diff --git a/node_modules/eslint-plugin-local-rules/index.js b/node_modules/eslint-plugin-local-rules/index.js
index b58ad76..8d92826 100644
--- a/node_modules/eslint-plugin-local-rules/index.js
+++ b/node_modules/eslint-plugin-local-rules/index.js
@@ -3,9 +3,14 @@
 
 var { requireUp } = require('./requireUp');
 var { DEFAULT_EXTENSIONS } = require('./constants');
+var path = require('path');
 
 // First check for local rules in the current working directory and its ancestors (enables npm/yarn/pnpm workspaces support)
-var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, process.cwd());
+var rules = requireUp(
+  'eslint-local-rules',
+  DEFAULT_EXTENSIONS,
+  path.join(process.cwd(), 'tooling/eslint-config/eslint-local-rules/'),
+);
 
 if (!rules) {
   // Then try the directory containing this plugin and its ancestors
@@ -22,16 +27,14 @@ if (!rules) {
       process.cwd() +
       '" and "' +
       __dirname +
-      '").'
+      '").',
   );
 }
 
 var getConfig = (type) => ({
-    rules: Object.fromEntries(
-      Object
-        .keys(rules)
-        .map((rule) => [`local-rules/${rule}`, type])
-    ),
+  rules: Object.fromEntries(
+    Object.keys(rules).map((rule) => [`local-rules/${rule}`, type]),
+  ),
 });
 
 module.exports = {