Prepend strings to files.
I made this to add /* eslint-disable */
to files generated by
graphql-code-generator
. @graphql-codegen/add
does not work properly for some
reason.
-
Bun
bun add -g @rencedm112/prepend
-
PNPM
pnpm add -g @rencedm112/prepend
-
Yarn
yarn add -g @rencedm112/prepend
-
NPM
npm install -g @rencedm112/prepend
prepend -c "Content to be prepended\n" -e ts -f file.ts
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
hooks: {
afterOneFileWrite: ["prepend -c '/* eslint-disable */\\n' -e ts -e js -f"],
},
// body
};
export default config;
This will prepend
/* eslint-disable */
to TypeScript or JavaScript files generated bygraphql-code-generator