Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
frankdejonge opened this issue Feb 4, 2024 · 1 comment
Open

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

frankdejonge opened this issue Feb 4, 2024 · 1 comment

Comments

@frankdejonge
Copy link

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?

@mrlubos
Copy link
Collaborator

mrlubos commented Feb 7, 2024

Hi @frankdejonge, how are file headers which are JavaScript comments related to the extension issue you linked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants