import { Handler , readFile , writeFile , } from "../common" ; export const handler = { name : "fluid-case" , match : /(^|\/)[^\/]+\.([tj]s?|html|md|json)$/i , handler : file => { const content = readFile ( file ) ; if ( content . search ( /[Ff]luid framework/ ) !== - 1 ) { return `'framework' need to be capitalized in prose` ; } if ( content . search ( /[a-z] fluid [a-z]/ ) !== - 1 ) { return `'fluid' needs to be capitalized in prose` ; } } , resolver : file => { const content = readFile ( file ) ; const newContent = content . replace ( /([a-z]) fluid ([a-z])/g , "$1 Fluid $2" ) ; writeFile ( file , newContent . replace ( /[Ff]luid framework/g , "Fluid Framework" ) ) ; return { resolved : true } ; } } ;