Hooks

afterAllFilesWrite

Type: String or String[] or Function.

Runs after orval generates client and writes the generated files to the file system. File paths or their directory is passed as arguments to the script. You can run configured linter tasks on files that are generated by orval.

module.exports = {
petstore: {
hooks: {
afterAllFilesWrite: 'prettier --write',
},
},
};

If you don't want to inject the generated files into the command, you can use afterAllFilesWrite with an object:

module.exports = {
petstore: {
hooks: {
afterAllFilesWrite: {
command: 'prettier --write .',
injectGeneratedDirsAndFiles: false,
},
},
},
};
Was this page helpful?

Copyright © 2024 Victor Bury. All Rights Reserved.