Skip to content

Implement ESLint rule to enforce codelock #1

@taneliang

Description

@taneliang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions