@ faircopy/ astro
Astro 适配器用于公平复制. 摘录出自 .astro 带有精确源图的文件,因此诊断指向原始文件中的确切字符.
安装
npm i -D @faircopy/astro
使用量
// faircopy.config.ts
import { defineConfig } from '@faircopy/config'
import { astro } from '@faircopy/astro'
export default defineConfig({
files: ['src/**/*.astro'],
adapters: [astro()],
rules: { 'no-em-dash': 'error' },
})
被提取的东西
模板文本节点 —— HTML 标记之间的流派,不包括 <script>, (中文(简体) ), <style>, (中文(简体) ), <code>, (中文(简体) ), <pre>,以及 <kbd> 要素.
前题字符串文字 —— 说 const编号 :let 给散文列表中的标识符指派: title, (中文(简体) ), description, (中文(简体) ), subtitle, (中文(简体) ), tagline, (中文(简体) ), lede, (中文(简体) ), metaDescription, (中文(简体) ), ogTitle, (中文(简体) ), ogDescription, (中文(简体) ), heading。 。 。 .
选项
astro({
// Additional frontmatter identifiers to treat as prose.
proseIdentifiers?: string[]
// Lint HTML attribute values (alt, aria-label, etc.). Default false.
lintAttributes?: boolean | { attributes: string[] }
// Lint JSX expression string literals { 'like this' }. Default true.
lintExpressionStrings?: boolean
})
压制节点
添加 data-faircopy-ignore 要跳过它及其所有后人的任何元素:
<div data-faircopy-ignore>
<p>This prose won't be linted.</p>
</div>