Files generated with tscodegen are meant to be generated into a larger project codebase and committed, with some files even being able to be manually edited. As tscodegen will only preserve manual sections with the correct key, any unsanctioned manual edits will be erased upon the next codegen run.
This can be prevented with an ESLint rule that warns if the file has been edited outside any manual sections.
It should be relatively simple to implement this, since generated files already have a Codelock hash in their docblocks, and CodeFile's verify method can verify that this hash matches the file's contents.
Files generated with tscodegen are meant to be generated into a larger project codebase and committed, with some files even being able to be manually edited. As tscodegen will only preserve manual sections with the correct key, any unsanctioned manual edits will be erased upon the next codegen run.
This can be prevented with an ESLint rule that warns if the file has been edited outside any manual sections.
It should be relatively simple to implement this, since generated files already have a
Codelockhash in their docblocks, andCodeFile'sverifymethod can verify that this hash matches the file's contents.