/faircopy

Configuration

The shape of faircopy.config.ts.

faircopy reads faircopy.config.ts from the project root. The defineConfig helper from @faircopy/config gives you full type completion on rule names and options.

Shape

import { defineConfig } from '@faircopy/config'
import { astro } from '@faircopy/astro'

export default defineConfig({
  files: ['src/**/*.astro'],
  ignore: ['src/**/*.test.astro'],
  adapters: [astro()],
  rules: {
    'no-em-dash': 'error',
    'no-weasel-words': ['error', { words: ['actually', 'truly', 'just'] }],
    'no-rhetorical-scaffolding': 'error',
  },
  noGitignore: false,
  concurrency: 4,
})

Fields

FieldTypeDescription
filesstring[]Globs of files to lint, relative to the config.
ignorestring[]Globs to skip. Merged with .gitignore.
adaptersAdapter[]Registered adapters in priority order.
rulesRecord<string, RuleConfig>Rule severity and options.
noGitignorebooleanDisable .gitignore integration. Default false.
concurrencynumberMax concurrent files. Defaults to CPU count.

Rule config

Each rule takes a severity ('off' | 'warn' | 'error') or a tuple of [severity, options].

rules: {
  'no-em-dash': 'error',
  'no-weasel-words': ['error', { words: ['actually', 'truly'] }],
  'no-rhetorical-scaffolding': 'off',
}

CLI

npx faircopy lint           # run all rules
npx faircopy fix            # apply auto-fixes where possible
npx faircopy explain <rule> # print the full help for a rule