-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Evaluate code auto-formatting #17288
Comments
I'm not sure I understand your issue. What do you expect here from the |
The project already has an eslint config, so |
I notice #11552 and #15545 and search issue where I can read discussion about using some auto-formatting tools like prettier to do format-on-save in editor. Looks like I find Mr.doob's Code Style™. Is there any config for this style? @donmccurdy, does this tool actually fix/add/remove trailing commas, spaces? Like here https://prettier.io/playground/ |
The ESLint config for this project is defined in the https://github.com/mrdoob/three.js/blob/dev/package.json#L27-L44
Running eslint --fix can auto-fix all those issues. There are also code editor plugins that afford inline linter error highlighting and probably allow for auto-format on save, too (though I don't use that myself). |
For example: // Before
function doTheThing(arg){
var foo = '2389' + arg;
console.log(foo);
}
doTheThing('_yeah');
// After `eslint --fix sample.js`
function doTheThing( arg ) {
var foo = '2389' + arg;
console.log( foo );
}
doTheThing( '_yeah' ); As @gkjohnson mentions, you can set up your editor to do this automatically, but threejs doesn't require any particular editor. |
Even didn't know about this eslint feature.
Thanks. |
The text was updated successfully, but these errors were encountered: