prettier/prettier: the plugin layout, without a build
Each of Prettier's eight language plugins needs two entry files, index and languages; the build fails when one is missing. Two rules check the layout without building, and on the run all eight plugins were complete. This config was written to test alint; Prettier doesn't use alint.
What alint found
- id: prettier-language-plugin-has-index
kind: for_each_dir
select: "src/language-*"
require:
- kind: file_exists
paths: "{path}/index.js"
level: error
- id: prettier-language-plugin-has-languages-evaluate
kind: for_each_dir
select: "src/language-*"
require:
- kind: file_exists
paths: "{path}/languages.evaluate.js"
level: error✓ passed prettier-language-plugin-has-languages-evaluate
All 8 language plugins under src/ have both index and languages.
The config
The config extends oss-baseline, node, ci/, hygiene/ and tooling/. Its own rules cover the plugin layout, most of what lint-changelog checks, the exact version pins check-deps checks in all five package files and the configs the lint scripts read. The lint tools run from command_ rules.
- id: prettier-deps-pinned
kind: file_content_forbidden
paths:
include:
- "package.json"
- "website/package.json"
- "scripts/release/package.json"
- "scripts/tools/bundle-test/package.json"
- "scripts/tools/eslint-plugin-prettier-internal-rules/package.json"
pattern: '(?m)^\s*"[^"]+"\s*:\s*"[\^~][0-9]'
level: errorcheck-deps rejects ^ and ~ ranges in five manifests. As a rule it's one pattern over the same five files.
- id: prettier-changelog-pr-filenames
kind: filename_regex
paths:
include: ["changelog_unreleased/*/*.md" ]
pattern: '^[0-9]{4,}(-[0-9]+)?\.md$'
level: errorA changelog note is named after its pull request. This is one of the checks from lint-changelog; the rules for the #### title heading, the pull request link and leftover template text work the same way.
What stays outside alint
Tools that read code or words stay tools:
- tsc, ESLint's nine internal rules and knip, which analyze code;
- cspell, which checks spelling;
- the rest of the changelog title check, which parses Markdown with remark.