Import statements: #src/ → @/ and remove file extensions (#56560)
This commit is contained in:
@@ -2,7 +2,8 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
import frontmatter from 'gray-matter'
|
||||
import { ROOT } from '#src/frame/lib/constants.js'
|
||||
// Replace imports with hardcoded values
|
||||
const ROOT = process.env.ROOT || '.'
|
||||
|
||||
// Hard-coded language keys to avoid TypeScript import in config file
|
||||
const languageKeys = ['en', 'es', 'ja', 'pt', 'zh', 'ru', 'fr', 'ko', 'de']
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import patterns from '@/frame/lib/patterns.js'
|
||||
import { deprecated } from '@/versions/lib/enterprise-server-releases.js'
|
||||
import patterns from '@/frame/lib/patterns'
|
||||
import { deprecated } from '@/versions/lib/enterprise-server-releases'
|
||||
import type { ExtendedRequest } from '@/types'
|
||||
|
||||
type IsArchivedInfo = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path'
|
||||
import { supported, latest } from '@/versions/lib/enterprise-server-releases.js'
|
||||
import patterns from '@/frame/lib/patterns.js'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js'
|
||||
import { supported, latest } from '@/versions/lib/enterprise-server-releases'
|
||||
import patterns from '@/frame/lib/patterns'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
const latestNewVersion = `enterprise-server@${latest}`
|
||||
const oldVersions = ['dotcom'].concat(supported)
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import got from 'got'
|
||||
import type { Response, NextFunction } from 'express'
|
||||
|
||||
import patterns from '@/frame/lib/patterns.js'
|
||||
import patterns from '@/frame/lib/patterns'
|
||||
import { isArchivedVersion } from '@/archives/lib/is-archived-version'
|
||||
import {
|
||||
setFastlySurrogateKey,
|
||||
SURROGATE_ENUMS,
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { archivedCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control.js'
|
||||
import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import { archivedCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control'
|
||||
import type { ExtendedRequest } from '@/types'
|
||||
|
||||
// This module handles requests for the CSS and JS assets for
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
import type { Response, NextFunction } from 'express'
|
||||
import got from 'got'
|
||||
|
||||
import statsd from '@/observability/lib/statsd.js'
|
||||
import statsd from '@/observability/lib/statsd'
|
||||
import {
|
||||
firstVersionDeprecatedOnNewSite,
|
||||
lastVersionWithoutArchivedRedirectsFile,
|
||||
deprecatedWithFunctionalRedirects,
|
||||
firstReleaseStoredInBlobStorage,
|
||||
} from '@/versions/lib/enterprise-server-releases.js'
|
||||
import patterns from '@/frame/lib/patterns.js'
|
||||
import versionSatisfiesRange from '@/versions/lib/version-satisfies-range.js'
|
||||
} from '@/versions/lib/enterprise-server-releases'
|
||||
import patterns from '@/frame/lib/patterns'
|
||||
import versionSatisfiesRange from '@/versions/lib/version-satisfies-range'
|
||||
import { isArchivedVersion } from '@/archives/lib/is-archived-version'
|
||||
import {
|
||||
setFastlySurrogateKey,
|
||||
SURROGATE_ENUMS,
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file.js'
|
||||
import { archivedCacheControl, languageCacheControl } from '@/frame/middleware/cache-control.js'
|
||||
import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file'
|
||||
import { archivedCacheControl, languageCacheControl } from '@/frame/middleware/cache-control'
|
||||
import { pathLanguagePrefixed, languagePrefixPathRegex } from '@/languages/lib/languages'
|
||||
import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect.js'
|
||||
import getRemoteJSON from '@/frame/lib/get-remote-json.js'
|
||||
import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect'
|
||||
import getRemoteJSON from '@/frame/lib/get-remote-json'
|
||||
import { ExtendedRequest } from '@/types'
|
||||
|
||||
const OLD_PUBLIC_AZURE_BLOB_URL = 'https://githubdocs.azureedge.net'
|
||||
@@ -75,7 +72,7 @@ const cacheAggressively = (res: Response) => {
|
||||
// 3. ~4000ms
|
||||
//
|
||||
// ...if the limit we set is 3.
|
||||
// Our own timeout, in #src/frame/middleware/timeout.js defaults to 10 seconds.
|
||||
// Our own timeout, in @/frame/middleware/timeout.js defaults to 10 seconds.
|
||||
// So there's no point in trying more attempts than 3 because it would
|
||||
// just timeout on the 10s. (i.e. 1000 + 2000 + 4000 + 8000 > 10,000)
|
||||
const retryConfiguration = { limit: 3 }
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
import { program } from 'commander'
|
||||
import semver, { SemVer } from 'semver'
|
||||
|
||||
import getRemoteJSON from '@/frame/lib/get-remote-json.js'
|
||||
import getRemoteJSON from '@/frame/lib/get-remote-json'
|
||||
import {
|
||||
deprecated,
|
||||
lastVersionWithoutArchivedRedirectsFile,
|
||||
} from '@/versions/lib/enterprise-server-releases.js'
|
||||
} from '@/versions/lib/enterprise-server-releases'
|
||||
|
||||
program
|
||||
.description(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js'
|
||||
import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases'
|
||||
import { get, getDOM } from '@/tests/helpers/e2etest-ts'
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
|
||||
describe('enterprise deprecation', () => {
|
||||
vi.setConfig({ testTimeout: 60 * 1000 })
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Response } from 'express'
|
||||
|
||||
import { Context } from '@/types.js'
|
||||
import { Context } from '@/types'
|
||||
import { ExtendedRequestWithPageInfo } from '../types'
|
||||
import contextualize from '@/frame/middleware/context/context.js'
|
||||
import contextualize from '@/frame/middleware/context/context'
|
||||
|
||||
export async function getArticleBody(req: ExtendedRequestWithPageInfo) {
|
||||
// req.pageinfo is set from pageValidationMiddleware and pathValidationMiddleware
|
||||
|
||||
@@ -2,12 +2,12 @@ import type { Response } from 'express'
|
||||
import type { ExtendedRequestWithPageInfo } from '../types'
|
||||
|
||||
import type { ExtendedRequest, Page, Context, Permalink } from '@/types'
|
||||
import shortVersions from '@/versions/middleware/short-versions.js'
|
||||
import shortVersions from '@/versions/middleware/short-versions'
|
||||
import contextualize from '@/frame/middleware/context/context'
|
||||
import features from '@/versions/middleware/features.js'
|
||||
import breadcrumbs from '@/frame/middleware/context/breadcrumbs.js'
|
||||
import currentProductTree from '@/frame/middleware/context/current-product-tree.js'
|
||||
import { readCompressedJsonFile } from '@/frame/lib/read-json-file.js'
|
||||
import features from '@/versions/middleware/features'
|
||||
import breadcrumbs from '@/frame/middleware/context/breadcrumbs'
|
||||
import currentProductTree from '@/frame/middleware/context/current-product-tree'
|
||||
import { readCompressedJsonFile } from '@/frame/lib/read-json-file'
|
||||
|
||||
// If you have pre-computed page info into a JSON file on disk, this is
|
||||
// where it would be expected to be found.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { RequestHandler, Response } from 'express'
|
||||
import express from 'express'
|
||||
|
||||
import { defaultCacheControl } from '@/frame/middleware/cache-control.js'
|
||||
import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js'
|
||||
import { defaultCacheControl } from '@/frame/middleware/cache-control'
|
||||
import catchMiddlewareError from '@/observability/middleware/catch-middleware-error'
|
||||
import { ExtendedRequestWithPageInfo } from '../types'
|
||||
import { pageValidationMiddleware, pathValidationMiddleware } from './validation'
|
||||
import { getArticleBody } from './article-body'
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
makeLanguageSurrogateKey,
|
||||
setFastlySurrogateKey,
|
||||
SURROGATE_ENUMS,
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import statsd from '@/observability/lib/statsd.js'
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import statsd from '@/observability/lib/statsd'
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ import express from 'express'
|
||||
import type { Response, RequestHandler } from 'express'
|
||||
|
||||
import type { ExtendedRequest } from '@/types'
|
||||
import { defaultCacheControl } from '@/frame/middleware/cache-control.js'
|
||||
import { getProductStringFromPath, getVersionStringFromPath } from '@/frame/lib/path-utils.js'
|
||||
import { getLanguageCodeFromPath } from '@/languages/middleware/detect-language.js'
|
||||
import { defaultCacheControl } from '@/frame/middleware/cache-control'
|
||||
import { getProductStringFromPath, getVersionStringFromPath } from '@/frame/lib/path-utils'
|
||||
import { getLanguageCodeFromPath } from '@/languages/middleware/detect-language'
|
||||
import { pagelistValidationMiddleware } from './validation'
|
||||
import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js'
|
||||
import statsd from '@/observability/lib/statsd.js'
|
||||
import catchMiddlewareError from '@/observability/middleware/catch-middleware-error'
|
||||
import statsd from '@/observability/lib/statsd'
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ExtendedRequestWithPageInfo } from '../types'
|
||||
import type { NextFunction, Response } from 'express'
|
||||
|
||||
import { ExtendedRequest, Page } from '@/types.js'
|
||||
import { ExtendedRequest, Page } from '@/types'
|
||||
import { isArchivedVersionByPath } from '@/archives/lib/is-archived-version'
|
||||
import getRedirect from '@/redirects/lib/get-redirect.js'
|
||||
import { getVersionStringFromPath, getLangFromPath } from '@/frame/lib/path-utils.js'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js'
|
||||
import getRedirect from '@/redirects/lib/get-redirect'
|
||||
import { getVersionStringFromPath, getLangFromPath } from '@/frame/lib/path-utils'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version'
|
||||
|
||||
// validates the path for pagelist endpoint
|
||||
// specifically, defaults to `/en/free-pro-team@latest` when those values are missing
|
||||
|
||||
@@ -31,7 +31,7 @@ import chalk from 'chalk'
|
||||
import { program, Option } from 'commander'
|
||||
|
||||
import { languageKeys } from '@/languages/lib/languages'
|
||||
import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data.js'
|
||||
import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data'
|
||||
import { CACHE_FILE_PATH, getPageInfo } from '../middleware/article-pageinfo'
|
||||
|
||||
program
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { get } from '@/tests/helpers/e2etest.js'
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { latest } from '@/versions/lib/enterprise-server-releases.js'
|
||||
import { get } from '@/tests/helpers/e2etest'
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import { latest } from '@/versions/lib/enterprise-server-releases'
|
||||
|
||||
const makeURL = (pathname: string): string =>
|
||||
`/api/article/meta?${new URLSearchParams({ pathname })}`
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { get } from '@/tests/helpers/e2etest.js'
|
||||
import { get } from '@/tests/helpers/e2etest'
|
||||
|
||||
import { allVersionKeys } from '@/versions/lib/all-versions'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js'
|
||||
import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version'
|
||||
|
||||
describe.each(allVersionKeys)('pagelist api for %s', async (versionKey) => {
|
||||
beforeAll(() => {
|
||||
|
||||
@@ -4,11 +4,8 @@ import type { Response, NextFunction } from 'express'
|
||||
import sharp from 'sharp'
|
||||
|
||||
import type { ExtendedRequest } from '@/types'
|
||||
import { assetCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control.js'
|
||||
import {
|
||||
setFastlySurrogateKey,
|
||||
SURROGATE_ENUMS,
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { assetCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control'
|
||||
import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
|
||||
/**
|
||||
* This is the indicator that is a virtual part of the URL.
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import type { Response, NextFunction } from 'express'
|
||||
|
||||
import type { ExtendedRequest } from '@/types'
|
||||
import {
|
||||
setFastlySurrogateKey,
|
||||
SURROGATE_ENUMS,
|
||||
} from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
|
||||
export default function setStaticAssetCaching(
|
||||
req: ExtendedRequest,
|
||||
|
||||
@@ -3,8 +3,8 @@ import { describe, expect, test, vi } from 'vitest'
|
||||
import sharp from 'sharp'
|
||||
import { fileTypeFromBuffer } from 'file-type'
|
||||
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import { get, head } from '@/tests/helpers/e2etest.js'
|
||||
import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import { get, head } from '@/tests/helpers/e2etest'
|
||||
|
||||
describe('dynamic assets', () => {
|
||||
vi.setConfig({ testTimeout: 3 * 60 * 1000 })
|
||||
|
||||
@@ -4,10 +4,10 @@ import path from 'path'
|
||||
import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest'
|
||||
import nock from 'nock'
|
||||
|
||||
import { get } from '@/tests/helpers/e2etest.js'
|
||||
import { checkCachingHeaders } from '@/tests/helpers/caching-headers.js'
|
||||
import { setDefaultFastlySurrogateKey } from '@/frame/middleware/set-fastly-surrogate-key.js'
|
||||
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets.js'
|
||||
import { get } from '@/tests/helpers/e2etest'
|
||||
import { checkCachingHeaders } from '@/tests/helpers/caching-headers'
|
||||
import { setDefaultFastlySurrogateKey } from '@/frame/middleware/set-fastly-surrogate-key'
|
||||
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets'
|
||||
|
||||
function getNextStaticAsset(directory: string) {
|
||||
const root = path.join('.next', 'static', directory)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from 'path'
|
||||
|
||||
import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file.js'
|
||||
import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file'
|
||||
import { getOpenApiVersion } from '@/versions/lib/all-versions'
|
||||
import type {
|
||||
AuditLogEventT,
|
||||
|
||||
@@ -12,13 +12,9 @@ import { readFile, writeFile } from 'fs/promises'
|
||||
import { mkdirp } from 'mkdirp'
|
||||
import path from 'path'
|
||||
|
||||
import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index.js'
|
||||
import { getContents, getCommitSha } from '@/workflows/git-utils.js'
|
||||
import {
|
||||
latest,
|
||||
latestStable,
|
||||
releaseCandidate,
|
||||
} from '@/versions/lib/enterprise-server-releases.js'
|
||||
import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index'
|
||||
import { getContents, getCommitSha } from '@/workflows/git-utils'
|
||||
import { latest, latestStable, releaseCandidate } from '@/versions/lib/enterprise-server-releases'
|
||||
import type { AuditLogEventT, VersionedAuditLogData } from '../types'
|
||||
|
||||
if (!process.env.GITHUB_TOKEN) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { getDOM } from '@/tests/helpers/e2etest.js'
|
||||
import { getDOM } from '@/tests/helpers/e2etest'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
import { getCategorizedAuditLogEvents } from '../lib'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { mkdirp } from 'mkdirp'
|
||||
import { difference, isEqual } from 'lodash-es'
|
||||
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions.js'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions'
|
||||
import type { MarkdownFrontmatter } from '@/types'
|
||||
|
||||
// Type definitions - extending existing type to add missing fields and make most fields optional
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { supported } from '@/versions/lib/enterprise-server-releases.js'
|
||||
import { supported } from '@/versions/lib/enterprise-server-releases'
|
||||
import { allVersionKeys, allVersions } from '@/versions/lib/all-versions'
|
||||
import { convertVersionsToFrontmatter } from '../lib/update-markdown.js'
|
||||
import { convertVersionsToFrontmatter } from '../lib/update-markdown'
|
||||
|
||||
describe('frontmatter versions are generated correctly from automated data', () => {
|
||||
test('non-continuous enterprise server versions', async () => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { readFileSync } from 'fs'
|
||||
import cheerio from 'cheerio'
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { loadPages } from '@/frame/lib/page-data.js'
|
||||
import { get } from '@/tests/helpers/e2etest.js'
|
||||
import { loadPages } from '@/frame/lib/page-data'
|
||||
import { get } from '@/tests/helpers/e2etest'
|
||||
|
||||
// Type definitions for page objects
|
||||
type Page = {
|
||||
|
||||
@@ -6,9 +6,9 @@ import path from 'path'
|
||||
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
|
||||
import { mkdirp } from 'mkdirp'
|
||||
import matter from 'gray-matter'
|
||||
import type { FrontmatterVersions } from '@/types.js'
|
||||
import type { FrontmatterVersions } from '@/types'
|
||||
|
||||
import { updateContentDirectory } from '../lib/update-markdown.js'
|
||||
import { updateContentDirectory } from '../lib/update-markdown'
|
||||
|
||||
// Type definitions
|
||||
type ContentItem = {
|
||||
|
||||
@@ -53,7 +53,7 @@ import chalk from 'chalk'
|
||||
import { program } from 'commander'
|
||||
// We don't want to introduce a global dependency on @github/cocofix, so we install it by hand
|
||||
// as described above and suppress the import warning.
|
||||
import { getSupportedQueries } from '@github/cocofix/dist/querySuites.js' /* eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved */
|
||||
import { getSupportedQueries } from '@github/cocofix/dist/querySuites' /* eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved */
|
||||
import type { Language } from 'codeql-ts'
|
||||
|
||||
program
|
||||
|
||||
@@ -7,8 +7,8 @@ import { visitParents } from 'unist-util-visit-parents'
|
||||
import { visit, SKIP } from 'unist-util-visit'
|
||||
import { remove } from 'unist-util-remove'
|
||||
|
||||
import { languageKeys } from '#src/languages/lib/languages.ts'
|
||||
import { MARKDOWN_OPTIONS } from '../../content-linter/lib/helpers/unified-formatter-options.js'
|
||||
import { languageKeys } from '@/languages/lib/languages'
|
||||
import { MARKDOWN_OPTIONS } from '../../content-linter/lib/helpers/unified-formatter-options'
|
||||
|
||||
const { targetDirectory, removeKeywords } = JSON.parse(
|
||||
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'),
|
||||
|
||||
@@ -7,8 +7,8 @@ import path from 'path'
|
||||
import matter from 'gray-matter'
|
||||
import { rimraf } from 'rimraf'
|
||||
|
||||
import { updateContentDirectory } from '../../automated-pipelines/lib/update-markdown.js'
|
||||
import { convertContentToDocs } from './convert-markdown-for-docs.js'
|
||||
import { updateContentDirectory } from '../../automated-pipelines/lib/update-markdown'
|
||||
import { convertContentToDocs } from './convert-markdown-for-docs'
|
||||
|
||||
const { targetDirectory, sourceDirectory, frontmatterDefaults, markdownPrefix } = JSON.parse(
|
||||
await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import yaml from 'js-yaml'
|
||||
import fs from 'fs/promises'
|
||||
|
||||
import dataSchemas from '#src/data-directory/lib/data-schemas/index.ts'
|
||||
import ajv from '#src/tests/lib/validate-json-schema.ts'
|
||||
import dataSchemas from '@/data-directory/lib/data-schemas/index'
|
||||
import ajv from '@/tests/lib/validate-json-schema'
|
||||
|
||||
// AJV already has a built-in way to extract out properties
|
||||
// with a specific keyword using a custom validator function.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// get-rules.d.ts
|
||||
// This is a declaration file for get-rules.js
|
||||
|
||||
import type { Rule, RuleConfig } from '../../types.ts'
|
||||
import type { Rule, RuleConfig } from '../../types'
|
||||
|
||||
export const customRules: Rule[]
|
||||
export const allRules: Rule[]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import rules from '../../../../node_modules/markdownlint/lib/rules.js'
|
||||
import { gitHubDocsMarkdownlint } from '../linting-rules/index.js'
|
||||
import { baseConfig } from '../../style/base.js'
|
||||
import { customConfig } from '../../style/github-docs.js'
|
||||
import rules from '../../../../node_modules/markdownlint/lib/rules'
|
||||
import { gitHubDocsMarkdownlint } from '../linting-rules/index'
|
||||
import { baseConfig } from '../../style/base'
|
||||
import { customConfig } from '../../style/github-docs'
|
||||
|
||||
export const customRules = gitHubDocsMarkdownlint.rules
|
||||
export const allRules = [...rules, ...gitHubDocsMarkdownlint.rules]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Tokenizer, TokenKind } from 'liquidjs'
|
||||
|
||||
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
|
||||
import { deprecated } from '@/versions/lib/enterprise-server-releases'
|
||||
|
||||
const liquidTokenCache = new Map()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import markdownlint from 'markdownlint'
|
||||
|
||||
import { defaultConfig } from './default-markdownlint-options.js'
|
||||
import { defaultConfig } from './default-markdownlint-options'
|
||||
|
||||
export async function runRule(module, { strings, files, ruleConfig, markdownlintOptions = {} }) {
|
||||
if ((!strings && !files) || (strings && files))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import frontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
import frontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
export const britishEnglishQuotes = {
|
||||
names: ['GHD048', 'british-english-quotes'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
|
||||
export const codeAnnotations = {
|
||||
names: ['GHD007', 'code-annotations'],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import yaml from 'js-yaml'
|
||||
|
||||
import { getRange, getFrontmatter } from '../helpers/utils.js'
|
||||
import { getRange, getFrontmatter } from '../helpers/utils'
|
||||
|
||||
const ERROR_MESSAGE =
|
||||
'An early access reference appears to be used in a non-early access doc. Remove early access references or disable this rule.'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
|
||||
export const frontmatterHiddenDocs = {
|
||||
names: ['GHD010', 'frontmatter-hidden-docs'],
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import { intersection } from 'lodash-es'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { formatAjvErrors } from '../helpers/schema-utils.js'
|
||||
import { frontmatter, deprecatedProperties } from '#src/frame/lib/frontmatter.js'
|
||||
import readFrontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
import { formatAjvErrors } from '../helpers/schema-utils'
|
||||
import { frontmatter, deprecatedProperties } from '@/frame/lib/frontmatter'
|
||||
import readFrontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
export const frontmatterSchema = {
|
||||
names: ['GHD012', 'frontmatter-schema'],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import path from 'path'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
|
||||
export const frontmatterVideoTranscripts = {
|
||||
names: ['GHD011', 'frontmatter-video-transcripts'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError, ellipsify } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
/*
|
||||
This rule currently only checks for one hardcoded string but
|
||||
can be generalized in the future to check for strings that
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { addError, ellipsify } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import frontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
import frontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
/*
|
||||
This rule currently only checks for one hardcoded string but
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
getRange,
|
||||
isStringQuoted,
|
||||
isStringPunctuated,
|
||||
} from '../helpers/utils.js'
|
||||
} from '../helpers/utils'
|
||||
|
||||
export const imageAltTextEndPunctuation = {
|
||||
names: ['GHD032', 'image-alt-text-end-punctuation'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { forEachInlineChild, getRange } from '../helpers/utils.js'
|
||||
import { forEachInlineChild, getRange } from '../helpers/utils'
|
||||
|
||||
const excludeStartWords = ['image', 'graphic']
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { liquid } from '#src/content-render/index.js'
|
||||
import { allVersions } from '#src/versions/lib/all-versions.ts'
|
||||
import { forEachInlineChild, getRange } from '../helpers/utils.js'
|
||||
import { liquid } from '@/content-render/index'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
import { forEachInlineChild, getRange } from '../helpers/utils'
|
||||
|
||||
export const incorrectAltTextLength = {
|
||||
names: ['GHD033', 'incorrect-alt-text-length'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addFixErrorDetail, forEachInlineChild } from '../helpers/utils.js'
|
||||
import { addFixErrorDetail, forEachInlineChild } from '../helpers/utils'
|
||||
|
||||
export const imageFileKebabCase = {
|
||||
names: ['GHD004', 'image-file-kebab-case'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { forEachInlineChild } from '../helpers/utils.js'
|
||||
import { forEachInlineChild } from '../helpers/utils'
|
||||
|
||||
export const imageNoGif = {
|
||||
names: ['GHD036', 'image-no-gif'],
|
||||
|
||||
@@ -1,45 +1,42 @@
|
||||
import searchReplace from 'markdownlint-rule-search-replace'
|
||||
import markdownlintGitHub from '@github/markdownlint-github'
|
||||
|
||||
import { codeFenceLineLength } from './code-fence-line-length.js'
|
||||
import { imageAltTextEndPunctuation } from './image-alt-text-end-punctuation.js'
|
||||
import { imageFileKebabCase } from './image-file-kebab-case.js'
|
||||
import { incorrectAltTextLength } from './image-alt-text-length.js'
|
||||
import { internalLinksNoLang } from './internal-links-no-lang.js'
|
||||
import { internalLinksSlash } from './internal-links-slash.js'
|
||||
import { imageAltTextExcludeStartWords } from './image-alt-text-exclude-start-words.js'
|
||||
import { listFirstWordCapitalization } from './list-first-word-capitalization.js'
|
||||
import { linkPunctuation } from './link-punctuation.js'
|
||||
import {
|
||||
earlyAccessReferences,
|
||||
frontmatterEarlyAccessReferences,
|
||||
} from './early-access-references.js'
|
||||
import { frontmatterHiddenDocs } from './frontmatter-hidden-docs.js'
|
||||
import { frontmatterVideoTranscripts } from './frontmatter-video-transcripts.js'
|
||||
import { yamlScheduledJobs } from './yaml-scheduled-jobs.js'
|
||||
import { internalLinksOldVersion } from './internal-links-old-version.js'
|
||||
import { hardcodedDataVariable } from './hardcoded-data-variable.js'
|
||||
import { githubOwnedActionReferences } from './github-owned-action-references.js'
|
||||
import { liquidQuotedConditionalArg } from './liquid-quoted-conditional-arg.js'
|
||||
import { liquidDataReferencesDefined, liquidDataTagFormat } from './liquid-data-tags.js'
|
||||
import { frontmatterSchema } from './frontmatter-schema.js'
|
||||
import { codeAnnotations } from './code-annotations.js'
|
||||
import { codeAnnotationCommentSpacing } from './code-annotation-comment-spacing.js'
|
||||
import { frontmatterLiquidSyntax, liquidSyntax } from './liquid-syntax.js'
|
||||
import { liquidIfTags, liquidIfVersionTags } from './liquid-versioning.js'
|
||||
import { raiReusableUsage } from './rai-reusable-usage.js'
|
||||
import { imageNoGif } from './image-no-gif.js'
|
||||
import { expiredContent, expiringSoon } from './expired-content.js'
|
||||
import { tableLiquidVersioning } from './table-liquid-versioning.js'
|
||||
import { tableColumnIntegrity } from './table-column-integrity.js'
|
||||
import { thirdPartyActionPinning } from './third-party-action-pinning.js'
|
||||
import { liquidTagWhitespace } from './liquid-tag-whitespace.js'
|
||||
import { linkQuotation } from './link-quotation.js'
|
||||
import { octiconAriaLabels } from './octicon-aria-labels.js'
|
||||
import { liquidIfversionVersions } from './liquid-ifversion-versions.js'
|
||||
import { britishEnglishQuotes } from './british-english-quotes.js'
|
||||
import { multipleEmphasisPatterns } from './multiple-emphasis-patterns.js'
|
||||
import { noteWarningFormatting } from './note-warning-formatting.js'
|
||||
import { codeFenceLineLength } from './code-fence-line-length'
|
||||
import { imageAltTextEndPunctuation } from './image-alt-text-end-punctuation'
|
||||
import { imageFileKebabCase } from './image-file-kebab-case'
|
||||
import { incorrectAltTextLength } from './image-alt-text-length'
|
||||
import { internalLinksNoLang } from './internal-links-no-lang'
|
||||
import { internalLinksSlash } from './internal-links-slash'
|
||||
import { imageAltTextExcludeStartWords } from './image-alt-text-exclude-start-words'
|
||||
import { listFirstWordCapitalization } from './list-first-word-capitalization'
|
||||
import { linkPunctuation } from './link-punctuation'
|
||||
import { earlyAccessReferences, frontmatterEarlyAccessReferences } from './early-access-references'
|
||||
import { frontmatterHiddenDocs } from './frontmatter-hidden-docs'
|
||||
import { frontmatterVideoTranscripts } from './frontmatter-video-transcripts'
|
||||
import { yamlScheduledJobs } from './yaml-scheduled-jobs'
|
||||
import { internalLinksOldVersion } from './internal-links-old-version'
|
||||
import { hardcodedDataVariable } from './hardcoded-data-variable'
|
||||
import { githubOwnedActionReferences } from './github-owned-action-references'
|
||||
import { liquidQuotedConditionalArg } from './liquid-quoted-conditional-arg'
|
||||
import { liquidDataReferencesDefined, liquidDataTagFormat } from './liquid-data-tags'
|
||||
import { frontmatterSchema } from './frontmatter-schema'
|
||||
import { codeAnnotations } from './code-annotations'
|
||||
import { codeAnnotationCommentSpacing } from './code-annotation-comment-spacing'
|
||||
import { frontmatterLiquidSyntax, liquidSyntax } from './liquid-syntax'
|
||||
import { liquidIfTags, liquidIfVersionTags } from './liquid-versioning'
|
||||
import { raiReusableUsage } from './rai-reusable-usage'
|
||||
import { imageNoGif } from './image-no-gif'
|
||||
import { expiredContent, expiringSoon } from './expired-content'
|
||||
import { tableLiquidVersioning } from './table-liquid-versioning'
|
||||
import { tableColumnIntegrity } from './table-column-integrity'
|
||||
import { thirdPartyActionPinning } from './third-party-action-pinning'
|
||||
import { liquidTagWhitespace } from './liquid-tag-whitespace'
|
||||
import { linkQuotation } from './link-quotation'
|
||||
import { octiconAriaLabels } from './octicon-aria-labels'
|
||||
import { liquidIfversionVersions } from './liquid-ifversion-versions'
|
||||
import { britishEnglishQuotes } from './british-english-quotes'
|
||||
import { multipleEmphasisPatterns } from './multiple-emphasis-patterns'
|
||||
import { noteWarningFormatting } from './note-warning-formatting'
|
||||
|
||||
const noDefaultAltText = markdownlintGitHub.find((elem) =>
|
||||
elem.names.includes('no-default-alt-text'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { addFixErrorDetail, getRange } from '../helpers/utils.js'
|
||||
import { allLanguageKeys } from '#src/languages/lib/languages.ts'
|
||||
import { addFixErrorDetail, getRange } from '../helpers/utils'
|
||||
import { allLanguageKeys } from '@/languages/lib/languages'
|
||||
|
||||
export const internalLinksNoLang = {
|
||||
names: ['GHD002', 'internal-links-no-lang'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
|
||||
export const internalLinksOldVersion = {
|
||||
names: ['GHD006', 'internal-links-old-version'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { addFixErrorDetail, getRange } from '../helpers/utils.js'
|
||||
import { addFixErrorDetail, getRange } from '../helpers/utils'
|
||||
|
||||
export const internalLinksSlash = {
|
||||
names: ['GHD003', 'internal-links-slash'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { doesStringEndWithPeriod, getRange, isStringQuoted } from '../helpers/utils.js'
|
||||
import { doesStringEndWithPeriod, getRange, isStringQuoted } from '../helpers/utils'
|
||||
|
||||
export const linkPunctuation = {
|
||||
names: ['GHD001', 'link-punctuation'],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
import { getRange, quotePrecedesLinkOpen } from '../helpers/utils.js'
|
||||
import { getRange, quotePrecedesLinkOpen } from '../helpers/utils'
|
||||
import { escapeRegExp } from 'lodash-es'
|
||||
|
||||
export const linkQuotation = {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { TokenKind } from 'liquidjs'
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getDataByLanguage } from '#src/data-directory/lib/get-data.js'
|
||||
import { getDataByLanguage } from '@/data-directory/lib/get-data'
|
||||
import {
|
||||
getLiquidTokens,
|
||||
getPositionData,
|
||||
OUTPUT_OPEN,
|
||||
OUTPUT_CLOSE,
|
||||
} from '../helpers/liquid-utils.js'
|
||||
} from '../helpers/liquid-utils'
|
||||
|
||||
/*
|
||||
Checks for instances where a Liquid data or indented_data_reference
|
||||
|
||||
@@ -5,18 +5,18 @@ import {
|
||||
getPositionData,
|
||||
getContentDeleteData,
|
||||
getSimplifiedSemverRange,
|
||||
} from '../helpers/liquid-utils.js'
|
||||
import { getFrontmatter, getFrontmatterLines } from '../helpers/utils.js'
|
||||
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
|
||||
import { allVersions } from '#src/versions/lib/all-versions.ts'
|
||||
} from '../helpers/liquid-utils'
|
||||
import { getFrontmatter, getFrontmatterLines } from '../helpers/utils'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
import { difference } from 'lodash-es'
|
||||
import { convertVersionsToFrontmatter } from '#src/automated-pipelines/lib/update-markdown.js'
|
||||
import { convertVersionsToFrontmatter } from '@/automated-pipelines/lib/update-markdown'
|
||||
import {
|
||||
isAllVersions,
|
||||
getFeatureVersionsObject,
|
||||
isInAllGhes,
|
||||
} from '#src/ghes-releases/scripts/version-utils.js'
|
||||
import { deprecated, oldestSupported } from '#src/versions/lib/enterprise-server-releases.js'
|
||||
} from '@/ghes-releases/scripts/version-utils'
|
||||
import { deprecated, oldestSupported } from '@/versions/lib/enterprise-server-releases'
|
||||
|
||||
export const liquidIfversionVersions = {
|
||||
names: ['GHD022', 'liquid-ifversion-versions'],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { TokenKind } from 'liquidjs'
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getLiquidTokens, conditionalTags, getPositionData } from '../helpers/liquid-utils.js'
|
||||
import { isStringQuoted } from '../helpers/utils.js'
|
||||
import { getLiquidTokens, conditionalTags, getPositionData } from '../helpers/liquid-utils'
|
||||
import { isStringQuoted } from '../helpers/utils'
|
||||
|
||||
/*
|
||||
Checks for instances where a Liquid conditional tag's argument is
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { liquid } from '#src/content-render/index.js'
|
||||
import { isLiquidError } from '#src/languages/lib/render-with-fallback.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
import { liquid } from '@/content-render/index'
|
||||
import { isLiquidError } from '@/languages/lib/render-with-fallback'
|
||||
|
||||
/*
|
||||
Attempts to parse all liquid in the frontmatter of a file
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { TokenKind } from 'liquidjs'
|
||||
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js'
|
||||
import { addFixErrorDetail } from '../helpers/utils.js'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils'
|
||||
import { addFixErrorDetail } from '../helpers/utils'
|
||||
|
||||
/*
|
||||
Liquid tags should start and end with one whitespace. For example:
|
||||
|
||||
@@ -2,18 +2,13 @@ import semver from 'semver'
|
||||
import { TokenKind } from 'liquidjs'
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { getRange, addFixErrorDetail } from '../helpers/utils.js'
|
||||
import { allVersions, allVersionShortnames } from '#src/versions/lib/all-versions.ts'
|
||||
import {
|
||||
supported,
|
||||
next,
|
||||
nextNext,
|
||||
deprecated,
|
||||
} from '#src/versions/lib/enterprise-server-releases.js'
|
||||
import allowedVersionOperators from '#src/content-render/liquid/ifversion-supported-operators.js'
|
||||
import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js'
|
||||
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js'
|
||||
import { getRange, addFixErrorDetail } from '../helpers/utils'
|
||||
import { allVersions, allVersionShortnames } from '@/versions/lib/all-versions'
|
||||
import { supported, next, nextNext, deprecated } from '@/versions/lib/enterprise-server-releases'
|
||||
import allowedVersionOperators from '@/content-render/liquid/ifversion-supported-operators'
|
||||
import { getDeepDataByLanguage } from '@/data-directory/lib/get-data'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils'
|
||||
|
||||
const allShortnames = Object.keys(allVersionShortnames)
|
||||
const getAllPossibleVersionNames = memoize(() => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addFixErrorDetail, getRange, filterTokensByOrder } from '../helpers/utils.js'
|
||||
import { addFixErrorDetail, getRange, filterTokensByOrder } from '../helpers/utils'
|
||||
|
||||
export const listFirstWordCapitalization = {
|
||||
names: ['GHD034', 'list-first-word-capitalization'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import frontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
import frontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
export const multipleEmphasisPatterns = {
|
||||
names: ['GHD050', 'multiple-emphasis-patterns'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import frontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
import frontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
export const noteWarningFormatting = {
|
||||
names: ['GHD049', 'note-warning-formatting'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TokenKind } from 'liquidjs'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js'
|
||||
import { addFixErrorDetail } from '../helpers/utils.js'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils'
|
||||
import { addFixErrorDetail } from '../helpers/utils'
|
||||
/*
|
||||
Octicons should always have an aria-label attribute even if aria hidden. For example:
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { addError } from 'markdownlint-rule-helpers'
|
||||
import { TokenKind } from 'liquidjs'
|
||||
import path from 'path'
|
||||
|
||||
import { getFrontmatter } from '../helpers/utils.js'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js'
|
||||
import { getFrontmatter } from '../helpers/utils'
|
||||
import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils'
|
||||
|
||||
export const raiReusableUsage = {
|
||||
names: ['GHD035', 'rai-reusable-usage'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addError } from 'markdownlint-rule-helpers'
|
||||
import { getRange } from '../helpers/utils.js'
|
||||
import frontmatter from '#src/frame/lib/read-frontmatter.js'
|
||||
import { getRange } from '../helpers/utils'
|
||||
import frontmatter from '@/frame/lib/read-frontmatter'
|
||||
|
||||
// Regex to detect table rows (must start with |, contain at least one more |, and end with optional whitespace)
|
||||
const TABLE_ROW_REGEX = /^\s*\|.*\|\s*$/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import yaml from 'js-yaml'
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { liquid } from '#src/content-render/index.js'
|
||||
import { allVersions } from '#src/versions/lib/all-versions.ts'
|
||||
import { liquid } from '@/content-render/index'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
|
||||
// Detects third-party actions in the format `owner/repo@ref`
|
||||
const actionRegex = /[\w-]+\/[\w-]+@[\w-]+/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import yaml from 'js-yaml'
|
||||
import { addError, filterTokens } from 'markdownlint-rule-helpers'
|
||||
|
||||
import { liquid } from '#src/content-render/index.js'
|
||||
import { allVersions } from '#src/versions/lib/all-versions.ts'
|
||||
import { liquid } from '@/content-render/index'
|
||||
import { allVersions } from '@/versions/lib/all-versions'
|
||||
|
||||
const scheduledYamlJobs = []
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ import yaml from 'js-yaml'
|
||||
|
||||
import { program } from 'commander'
|
||||
|
||||
import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data.js'
|
||||
import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data'
|
||||
import { TokenizationError } from 'liquidjs'
|
||||
|
||||
import readFrontmatter from '@/frame/lib/read-frontmatter.js'
|
||||
import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js'
|
||||
import walkFiles from '@/workflows/walk-files.js'
|
||||
import readFrontmatter from '@/frame/lib/read-frontmatter'
|
||||
import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils'
|
||||
import walkFiles from '@/workflows/walk-files'
|
||||
|
||||
program
|
||||
.description('Finds unused variables in frontmatter, content, and reusables')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { writeFileSync } from 'fs'
|
||||
import type { Rule, Config } from '../types.ts'
|
||||
import { allRules, allConfig } from '../lib/helpers/get-rules.js'
|
||||
import type { Rule, Config } from '../types'
|
||||
import { allRules, allConfig } from '../lib/helpers/get-rules'
|
||||
|
||||
main()
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ import { applyFixes } from 'markdownlint-rule-helpers'
|
||||
import boxen from 'boxen'
|
||||
import ora from 'ora'
|
||||
|
||||
import walkFiles from '#src/workflows/walk-files.ts'
|
||||
import { allConfig, allRules, customRules } from '../lib/helpers/get-rules.js'
|
||||
import { customConfig, githubDocsFrontmatterConfig } from '../style/github-docs.js'
|
||||
import { defaultConfig } from '../lib/default-markdownlint-options.js'
|
||||
import { prettyPrintResults } from './pretty-print-results.js'
|
||||
import { getLintableYml } from '#src/content-linter/lib/helpers/get-lintable-yml.js'
|
||||
import { printAnnotationResults } from '../lib/helpers/print-annotations.js'
|
||||
import languages from '#src/languages/lib/languages.ts'
|
||||
import walkFiles from '@/workflows/walk-files'
|
||||
import { allConfig, allRules, customRules } from '../lib/helpers/get-rules'
|
||||
import { customConfig, githubDocsFrontmatterConfig } from '../style/github-docs'
|
||||
import { defaultConfig } from '../lib/default-markdownlint-options'
|
||||
import { prettyPrintResults } from './pretty-print-results'
|
||||
import { getLintableYml } from '@/content-linter/lib/helpers/get-lintable-yml'
|
||||
import { printAnnotationResults } from '../lib/helpers/print-annotations'
|
||||
import languages from '@/languages/lib/languages'
|
||||
|
||||
program
|
||||
.description('Run GitHub Docs Markdownlint rules.')
|
||||
|
||||
@@ -2,10 +2,10 @@ import { program } from 'commander'
|
||||
import fs from 'fs'
|
||||
import coreLib from '@actions/core'
|
||||
|
||||
import github from '#src/workflows/github.ts'
|
||||
import { getEnvInputs } from '#src/workflows/get-env-inputs.ts'
|
||||
import { createReportIssue, linkReports } from '#src/workflows/issue-report.js'
|
||||
import { reportingConfig } from '#src/content-linter/style/github-docs.js'
|
||||
import github from '@/workflows/github'
|
||||
import { getEnvInputs } from '@/workflows/get-env-inputs'
|
||||
import { createReportIssue, linkReports } from '@/workflows/issue-report'
|
||||
import { reportingConfig } from '@/content-linter/style/github-docs'
|
||||
|
||||
// GitHub issue body size limit is ~65k characters, so we'll use 60k as a safe limit
|
||||
const MAX_ISSUE_BODY_SIZE = 60000
|
||||
|
||||
@@ -8,12 +8,12 @@ import GithubSlugger from 'github-slugger'
|
||||
import { decode } from 'html-entities'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import matter from '@/frame/lib/read-frontmatter.js'
|
||||
import { renderContent } from '@/content-render/index.js'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions.js'
|
||||
import matter from '@/frame/lib/read-frontmatter'
|
||||
import { renderContent } from '@/content-render/index'
|
||||
import getApplicableVersions from '@/versions/lib/get-applicable-versions'
|
||||
import contextualize from '@/frame/middleware/context/context'
|
||||
import shortVersions from '@/versions/middleware/short-versions.js'
|
||||
import { ROOT } from '@/frame/lib/constants.js'
|
||||
import shortVersions from '@/versions/middleware/short-versions'
|
||||
import { ROOT } from '@/frame/lib/constants'
|
||||
import type { Context, ExtendedRequest, MarkdownFrontmatter } from '@/types'
|
||||
|
||||
const slugger = new GithubSlugger()
|
||||
|
||||
@@ -4,7 +4,7 @@ import { readFile } from 'fs/promises'
|
||||
import walk from 'walk-sync'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { liquid } from '#src/content-render/index.js'
|
||||
import { liquid } from '@/content-render/index'
|
||||
|
||||
const learningTrackRootPath = 'data/learning-tracks'
|
||||
const yamlWalkOptions = {
|
||||
|
||||
@@ -8,8 +8,8 @@ import walk from 'walk-sync'
|
||||
import { zip } from 'lodash-es'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import languages from '#src/languages/lib/languages.ts'
|
||||
import { getDiffFiles } from '../lib/diff-files.js'
|
||||
import languages from '@/languages/lib/languages'
|
||||
import { getDiffFiles } from '../lib/diff-files'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { loadPages, loadPageMap } from '#src/frame/lib/page-data.js'
|
||||
import loadRedirects from '#src/redirects/lib/precompile.js'
|
||||
import { checkURL } from '#src/tests/helpers/check-url.js'
|
||||
import { loadPages, loadPageMap } from '@/frame/lib/page-data'
|
||||
import loadRedirects from '@/redirects/lib/precompile'
|
||||
import { checkURL } from '@/tests/helpers/check-url'
|
||||
|
||||
const pageList = await loadPages(undefined, ['en'])
|
||||
const pages = await loadPageMap(pageList)
|
||||
|
||||
@@ -2,8 +2,8 @@ import path from 'path'
|
||||
import { isEqual, uniqWith } from 'lodash-es'
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import patterns from '#src/frame/lib/patterns.js'
|
||||
import { getDataByLanguage, getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js'
|
||||
import patterns from '@/frame/lib/patterns'
|
||||
import { getDataByLanguage, getDeepDataByLanguage } from '@/data-directory/lib/get-data'
|
||||
|
||||
// Given syntax like {% data foo.bar %} or {% indented_data_reference foo.bar spaces=3 %},
|
||||
// the following regex returns just the dotted path: foo.bar
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { britishEnglishQuotes } from '../../lib/linting-rules/british-english-quotes.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { britishEnglishQuotes } from '../../lib/linting-rules/british-english-quotes'
|
||||
|
||||
describe(britishEnglishQuotes.names.join(' - '), () => {
|
||||
test('Correct American English punctuation passes', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { codeAnnotationCommentSpacing } from '../../lib/linting-rules/code-annotation-comment-spacing.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { codeAnnotationCommentSpacing } from '../../lib/linting-rules/code-annotation-comment-spacing'
|
||||
|
||||
describe(codeAnnotationCommentSpacing.names.join(' - '), () => {
|
||||
test('correctly formatted comments pass', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { codeAnnotations } from '../../lib/linting-rules/code-annotations.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { codeAnnotations } from '../../lib/linting-rules/code-annotations'
|
||||
|
||||
describe(codeAnnotations.names.join(' - '), () => {
|
||||
test('No layout property fails', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { codeFenceLineLength } from '../../lib/linting-rules/code-fence-line-length.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { codeFenceLineLength } from '../../lib/linting-rules/code-fence-line-length'
|
||||
|
||||
describe(codeFenceLineLength.names.join(' - '), () => {
|
||||
test('line length of max + 1 fails', async () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import {
|
||||
earlyAccessReferences,
|
||||
frontmatterEarlyAccessReferences,
|
||||
} from '../../lib/linting-rules/early-access-references.js'
|
||||
} from '../../lib/linting-rules/early-access-references'
|
||||
|
||||
const FIXTURE_FILEPATH_NON_EA = 'src/content-linter/tests/fixtures/not-secret.md'
|
||||
const FIXTURE_FILEPATH_EA = 'src/content-linter/tests/fixtures/early-access/secret.md'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import {
|
||||
expiredContent,
|
||||
expiringSoon,
|
||||
DAYS_TO_WARN_BEFORE_EXPIRED,
|
||||
} from '../../lib/linting-rules/expired-content.js'
|
||||
} from '../../lib/linting-rules/expired-content'
|
||||
|
||||
describe(expiredContent.names.join(' - '), () => {
|
||||
test('Date in the past triggers error', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { frontmatterHiddenDocs } from '../../lib/linting-rules/frontmatter-hidden-docs.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { frontmatterHiddenDocs } from '../../lib/linting-rules/frontmatter-hidden-docs'
|
||||
|
||||
const ACTIONS_FIXTURE = 'src/content-linter/tests/fixtures/actions/hidden.md'
|
||||
const EARLY_ACCESS_FIXTURE = 'src/fixtures/fixtures/content/early-access/secrets/early-days.md'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { frontmatterSchema } from '../../lib/linting-rules/frontmatter-schema.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { frontmatterSchema } from '../../lib/linting-rules/frontmatter-schema'
|
||||
|
||||
// Configure the test figure to not split frontmatter and content
|
||||
const fmOptions = { markdownlintOptions: { frontMatter: null } }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { frontmatterVideoTranscripts } from '../../lib/linting-rules/frontmatter-video-transcripts.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { frontmatterVideoTranscripts } from '../../lib/linting-rules/frontmatter-video-transcripts'
|
||||
|
||||
const GOOD_FIXTURE_LANDING = 'src/content-linter/tests/fixtures/actions/index.md'
|
||||
const BAD_FIXTURE_LANDING = 'src/content-linter/tests/fixtures/early-access/index.md'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { githubOwnedActionReferences } from '../../lib/linting-rules/github-owned-action-references.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { githubOwnedActionReferences } from '../../lib/linting-rules/github-owned-action-references'
|
||||
|
||||
describe(githubOwnedActionReferences.names.join(' - '), () => {
|
||||
test('Using hardcoded GitHub-owned actions causes error', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { hardcodedDataVariable } from '../../lib/linting-rules/hardcoded-data-variable.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { hardcodedDataVariable } from '../../lib/linting-rules/hardcoded-data-variable'
|
||||
|
||||
describe(hardcodedDataVariable.names.join(' - '), () => {
|
||||
test('Using hardcoded personal access token string causes error', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { imageAltTextEndPunctuation } from '../../lib/linting-rules/image-alt-text-end-punctuation.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { imageAltTextEndPunctuation } from '../../lib/linting-rules/image-alt-text-end-punctuation'
|
||||
|
||||
describe(imageAltTextEndPunctuation.names.join(' - '), () => {
|
||||
test('image alt text without end punctuation errors', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { imageAltTextExcludeStartWords } from '../../lib/linting-rules/image-alt-text-exclude-start-words.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { imageAltTextExcludeStartWords } from '../../lib/linting-rules/image-alt-text-exclude-start-words'
|
||||
|
||||
describe(imageAltTextExcludeStartWords.names.join(' - '), () => {
|
||||
test('image alt text that starts with exclude words fails', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { incorrectAltTextLength } from '../../lib/linting-rules/image-alt-text-length.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { incorrectAltTextLength } from '../../lib/linting-rules/image-alt-text-length'
|
||||
|
||||
describe(incorrectAltTextLength.names.join(' - '), () => {
|
||||
test('image with incorrect alt text length fails', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { imageFileKebabCase } from '../../lib/linting-rules/image-file-kebab-case.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { imageFileKebabCase } from '../../lib/linting-rules/image-file-kebab-case'
|
||||
|
||||
describe(imageFileKebabCase.names.join(' - '), () => {
|
||||
test('image file not using lowercase kebab case fails', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { imageNoGif } from '../../lib/linting-rules/image-no-gif.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { imageNoGif } from '../../lib/linting-rules/image-no-gif'
|
||||
|
||||
describe(imageNoGif.names.join(' - '), () => {
|
||||
test('image with gifs', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { internalLinksNoLang } from '../../lib/linting-rules/internal-links-no-lang.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { internalLinksNoLang } from '../../lib/linting-rules/internal-links-no-lang'
|
||||
|
||||
describe(internalLinksNoLang.names.join(' - '), () => {
|
||||
test('internal links with hardcoded language codes fail', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { internalLinksOldVersion } from '../../lib/linting-rules/internal-links-old-version.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { internalLinksOldVersion } from '../../lib/linting-rules/internal-links-old-version'
|
||||
|
||||
describe(internalLinksOldVersion.names.join(' - '), () => {
|
||||
test('links with old hardcoded versioning fail', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { internalLinksSlash } from '../../lib/linting-rules/internal-links-slash.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { internalLinksSlash } from '../../lib/linting-rules/internal-links-slash'
|
||||
|
||||
describe(internalLinksSlash.names.join(' - '), () => {
|
||||
test('relative links that do not start with / fail', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { linkPunctuation } from '../../lib/linting-rules/link-punctuation.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { linkPunctuation } from '../../lib/linting-rules/link-punctuation'
|
||||
|
||||
describe(linkPunctuation.names.join(' - '), () => {
|
||||
test('inline links without quotes or a period should not error', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { linkQuotation } from '../../lib/linting-rules/link-quotation.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { linkQuotation } from '../../lib/linting-rules/link-quotation'
|
||||
|
||||
describe(linkQuotation.names.join(' - '), () => {
|
||||
test('links that are formatted correctly should not generate an error', async () => {
|
||||
|
||||
@@ -2,11 +2,11 @@ import path from 'path'
|
||||
|
||||
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import {
|
||||
liquidDataReferencesDefined,
|
||||
liquidDataTagFormat,
|
||||
} from '../../lib/linting-rules/liquid-data-tags.js'
|
||||
} from '../../lib/linting-rules/liquid-data-tags'
|
||||
|
||||
describe(liquidDataReferencesDefined.names.join(' - '), () => {
|
||||
const envVarValueBefore = process.env.ROOT
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { validateIfversionConditionalsVersions } from '../../lib/linting-rules/liquid-versioning.js'
|
||||
import { liquidIfversionVersions } from '../../lib/linting-rules/liquid-ifversion-versions.js'
|
||||
import { supported } from '#src/versions/lib/enterprise-server-releases.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { validateIfversionConditionalsVersions } from '../../lib/linting-rules/liquid-versioning'
|
||||
import { liquidIfversionVersions } from '../../lib/linting-rules/liquid-ifversion-versions'
|
||||
import { supported } from '@/versions/lib/enterprise-server-releases'
|
||||
|
||||
describe(liquidIfversionVersions.names.join(' - '), () => {
|
||||
const envVarValueBefore = process.env.ROOT
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { runRule } from '../../lib/init-test.js'
|
||||
import { liquidQuotedConditionalArg } from '../../lib/linting-rules/liquid-quoted-conditional-arg.js'
|
||||
import { runRule } from '../../lib/init-test'
|
||||
import { liquidQuotedConditionalArg } from '../../lib/linting-rules/liquid-quoted-conditional-arg'
|
||||
|
||||
describe(liquidQuotedConditionalArg.names.join(' - '), () => {
|
||||
test('if conditional with quote args fails', async () => {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user