You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We now use prettier as a dependency of Stryker. The only reason it is there is to format the js file after stryker init. This is madness. Every release of prettier results in a larger package, as they support more and more languages. This fine for their use case, namely to be used as a dev-tool. This is not fine for production usage.
However, I don't want to drop support for code formatting all together, as it is unprofessional (and an eye sour) to look at raw JSON in a *.js file.
Possible: solutions
Support stryker.conf.json (next to stryker.conf.js). If we support a json file, we can just use JSON.stringify(config, null, 2). The problem with that approach is that JSON doesn't support comments. We could register a json parser that does support it. Needs more investigation.
Create a very simple version of JSON.stringify that outputs respectable JavaScript, or find an NPM package that does exactly that.
The text was updated successfully, but these errors were encountered:
can't it be done using some configurations? I think you can force people via some linter / vsconfig etc. And typescript also should have some option to make indent 2 etc.
@kmdrGroch I don't know exactly what you're talking about here. We don't have a Linter or parser in our core Stryker package and it should have one.
I actually thought of a simple solution. We can just call npx prettier --write stryker.conf.js. if the user has prettier installed, it will use that version, if not it will download, run and remove it again. It will even use the custom prettier configuration of the user (if exists).
@stryker-mutator/contributors what do you think of that approach. Pretty straightforward I think...
After `stryker init` was succesful, run prettier from the command line using `npx prettier --write stryker.conf.js` in order to format the resulting configuration file, rather than having prettier as a dependency directly.
Prettier became pretty expensive, sitting at 1.2 MB.
Fixes#1261
After `stryker init` was succesful, run prettier from the command line using `npx prettier --write stryker.conf.js` in order to format the resulting configuration file, rather than having prettier as a dependency directly.
Prettier became pretty expensive, sitting at 1.2 MB.
Fixes#1261
We now use prettier as a dependency of Stryker. The only reason it is there is to format the js file after
stryker init
. This is madness. Every release of prettier results in a larger package, as they support more and more languages. This fine for their use case, namely to be used as a dev-tool. This is not fine for production usage.However, I don't want to drop support for code formatting all together, as it is unprofessional (and an eye sour) to look at raw JSON in a *.js file.
Possible: solutions
stryker.conf.js
). If we support a json file, we can just useJSON.stringify(config, null, 2)
. The problem with that approach is that JSON doesn't support comments. We could register a json parser that does support it. Needs more investigation.JSON.stringify
that outputs respectable JavaScript, or find an NPM package that does exactly that.The text was updated successfully, but these errors were encountered: