rehlma / docs-belong-outside-sourcer1
Keep project documentation outside source directories
PublicUse the owning package’s docs directory, outside lib or src.
tests, run by the registry2 passed · slowest 1.0 ms
✓fires1.0 ms
reports source-nested documentation
write package/lib/docs/design.mdfired: line 1
Designwrite src/docs/design.mdfired: line 1
Design✓quiet0.9 ms
allows package documentation and source readmes
write package/docs/architecture/design.mdstayed quiet
Designwrite lib/README.mdno handler of the detector wants this event
Source mapdetector.test.tseach detect() call runs the real detector
import { expect, test } from 'vitest';
import { detect, write, edit, read, command, output, prompt } from '@wellactually/sdk/v3/test';
const flutter = { project: 'fixtures/flutter' };
const dart = { project: 'fixtures/dart' };
test('reports source-nested documentation', () => {
expect(detect(write('package/lib/docs/design.md', '# Design'))).toEqual([{ line: 1 }]);
expect(detect(write('src/docs/design.md', '# Design'))).toEqual([{ line: 1 }]);
});
test('allows package documentation and source readmes', () => {
expect(detect(write('package/docs/architecture/design.md', '# Design'))).toEqual([]);
expect(detect(write('lib/README.md', '# Source map'))).toEqual([]);
});