Skip to content

Adding the option to remove certain or all file headers. #2024

Open
@frankdejonge

Description

@frankdejonge

Hi @ferdikoomen,

First of all, thank you for providing this fine utility. It's saved me a bunch of time. As for the feature request itself: I'd like to contribute a configuration option to allow removing all headers from the header.hbs file.

Currently, the output from the library is not usable in an Node.js ESM project due to issues described in #1226. As a workaround, we've resorted to running the output through a cli script to remove the headers. This allows eslint to alter the output to match our project's needs; adding the .js extensions where applicable.

For those interested, we use this script:

cd src
find . -path '**/generated/**.ts' -type f -exec sh -c '
for file; do
     sed -i "" "/tslint:disable/d" ${file}
     sed -i "" "/eslint-disable/d" ${file}
     sed -i "" "/@ts-ignore/d" ${file}
done' sh {} +

Since the .js extension PR is open for quite some time, I figured why not allow for this relatively simple change instead until a more permanent stance is taken on the ESM support front. Are you open to such a PR?

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