Excalibur
Excalibur copied to clipboard
Enforcing prettier & eslint
There is a prettier config file but it is not enforced. Running npm run pretty
right now affects 230~ files and also causes some lint errors:
➜ Excalibur git:(fix/2376) ✗ npm run lint
> [email protected] lint
> npm run eslint && npm run eslint:spec
> [email protected] eslint
> eslint "src/engine/**/*.ts"
/Users/mattjennings/dev/Excalibur/src/engine/Engine.ts
771:15 error Strings must use singlequote quotes
785:17 error Strings must use singlequote quotes
/Users/mattjennings/dev/Excalibur/src/engine/EntityComponentSystem/System.ts
36:1 error Expected indentation of 0 spaces but found 2 @typescript-eslint/indent
37:1 error Opening curly brace does not appear on the same line as controlling statement brace-style
/Users/mattjennings/dev/Excalibur/src/engine/Graphics/Context/shader.ts
30:1 error Expected indentation of 4 spaces but found 2 @typescript-eslint/indent
31:1 error Expected indentation of 4 spaces but found 2 @typescript-eslint/indent
/Users/mattjennings/dev/Excalibur/src/engine/Graphics/Font.ts
69:1 error Expected indentation of 10 spaces but found 12 @typescript-eslint/indent
70:1 error Expected indentation of 10 spaces but found 12 @typescript-eslint/indent
71:1 error Expected indentation of 10 spaces but found 12 @typescript-eslint/indent
72:1 error Expected indentation of 8 spaces but found 10 @typescript-eslint/indent
@eonarheim suggested removing it altogether. I can make a PR to do that if that's the desire, but I'm a fan of prettier for formatting and linting should be enforced in some way too (which as far as I can tell is currently not the case, but correct me if I'm wrong).
What are your thoughts on setting up something like husky to enforce linting (and prettier if desired) with precommit hooks?
This issue hasn't had any recent activity lately and is being marked as stale automatically.
@mattjennings Implemented! #3015