fileoverview author import { readdirSync } from 'fs' ; import { resolve , basename } from 'path' ; export type RuleInfo = { id : string ; name : string ; category : string ; description : string ; recommended : boolean ; fixable : boolean ; deprecated : boolean ; replacedBy : string [ ] | null ; } ; const rules = readdirSync ( resolve ( __dirname , '../../lib/rules' ) ) . map ( fileName => basename ( fileName , '.ts' ) ) . map ( name => { const meta = require ( `../../lib/rules/${ name }` ) . meta ; return { id : `@intlify/vue-i18n/${ name }` , name , category : String ( meta . docs . category ) , description : String ( meta . docs . description ) , recommended : Boolean ( meta . docs . recommended ) , fixable : Boolean ( meta . fixable ) , deprecated : Boolean ( meta . deprecated ) , replacedBy : ( meta . docs . replacedBy as string [ ] ) || null } ; } ) ; export default rules ; export const withCategories = [ 'Recommended' , 'Best Practices' , 'Stylistic Issues' ] . map ( category => ( { category , rules : rules . filter ( rule => rule . category === category && ! rule . deprecated ) } ) ) ;