Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Remove the remark messaging linter #449

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .remarkrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import {
} from "./.build/server/docs-helpers.mjs";
import {
loadConfig,
loadMessagingConfig,
} from "./.build/server/config-docs.mjs";
import { remarkLintMessaging } from "./.build/server/remark-lint-messaging.mjs";

const configFix = {
settings: {
Expand Down Expand Up @@ -76,10 +74,6 @@ const configLint = {
// Disabling the remarkLintFrontmatter check until we fix
// gravitational/docs#80
// [remarkLintFrontmatter, ["error"]],
[
remarkLintMessaging,
loadMessagingConfig(resolve("messaging-config.json")),
],
],
};

Expand Down
18 changes: 0 additions & 18 deletions messaging-config.json

This file was deleted.

40 changes: 0 additions & 40 deletions server/config-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { existsSync, readFileSync } from "fs";
import { isExternalLink, isHash, splitPath } from "../utils/url";
import { NavigationCategory, NavigationItem } from "../layouts/DocsPage/types";
import { loadConfig as loadSiteConfig } from "./config-site";
import { RemarkLintMessagingOptions } from "./remark-lint-messaging";

const { latest } = loadSiteConfig();
export interface Config {
Expand Down Expand Up @@ -130,32 +129,6 @@ const validator = ajv.compile({
additionalProperties: false,
});

// Schema for the document that configures the messaging linter
const messagingConfigValidator = ajv.compile({
type: "array",
items: {
type: "object",
properties: {
incorrect: {
type: "string",
},
correct: {
type: "string",
},
explanation: {
type: "string",
},
where: {
type: "array",
items: {
type: "string",
enum: ["title", "description", "comments", "body", "headers"],
},
},
},
},
});

/*
* We store relative paths in the config so we don't need to change them all
* when we add new version, but for next/link and next/router to work they should be absolte.
Expand Down Expand Up @@ -356,16 +329,3 @@ export const loadConfig = (version: string) => {

return normalize(config, version);
};

export const loadMessagingConfig = (
path: string
): RemarkLintMessagingOptions => {
if (!existsSync(path)) {
throw Error(`File ${path} does not exist.`);
}
const content = readFileSync(path, "utf-8");
const config = JSON.parse(content) as RemarkLintMessagingOptions;
validateConfig<RemarkLintMessagingOptions>(messagingConfigValidator, config);

return config;
};
209 changes: 0 additions & 209 deletions server/remark-lint-messaging.ts

This file was deleted.

Loading