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

JS Config File #752

Open
SStranks opened this issue Feb 6, 2024 · 2 comments
Open

JS Config File #752

SStranks opened this issue Feb 6, 2024 · 2 comments

Comments

@SStranks
Copy link

SStranks commented Feb 6, 2024

The documentation says that the .secretlintrc can be of type {json,yml,js}, but I'm having trouble implementing a configuration of type .js in my project. I can't see or find any examples where a .js configuration has actually been implemented anywhere.

Package manager: PNPM v8
Node: v20
Type: "module".

In the documentation it states that secretlint is ESM, but if I create a .secretlintrc.js file I get warnings about 'export' being an unexpected token when trying to execute the file.

image

It works using the old 'module.exports' syntax, but not the ESM syntax. Could you please provide a working template example or highlight where I might be going wrong? Thanks.

@SStranks
Copy link
Author

SStranks commented Feb 6, 2024

Looking at 'rc-config-loader' I found this post on their repo:
rc-config-loader Issue: Support ESM

"rc-config-loader treat JS as CommonJS." - azu

@azu
Copy link
Member

azu commented Feb 6, 2024

Currently, ESM is not available in the settings file.

Basically, I recommend using JSON format.

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

No branches or pull requests

2 participants