import { resolve } from 'path' ; import type { Observable } from 'rxjs' ; import type EsLintRule from '../EsLintRule' ; import saveTextFile from './rx-save-text-file' ; param rules returns export default function genRuleIndexFile ( rules ) { const toc = rules . map ( ( rule ) => rule . name ) . map ( ( name ) => `- [${ name }](./docs/rules/${ name }.md)` ) . join ( '\n' ) ; return saveTextFile ( resolve ( __dirname , '../../build/rule-index.md' ) , toc ) ; }