This commit only fixes the warnings from ESLint that are about
coding style and were automatically fixable by 'eslint --fix'.
The more substantial issues that might require changing meaningful
code will be in a separate commit for easier review.
All the changes in this commit were automated. In addition, I
I also manually made the pseudo-section comments a bit different.
They previously used four slashes (`////`) which violated
the `spaced-comment` rule. The auto fix is to use `// //`, because
ESLint treated it like a normal inline comment. I don't know
ifThey previously used four slashes (`////`) which violated these `spaced-comments are useful long-term` rule. The auto fix is to use `// //`, seems to me like thesebecause
should be grouped in a more formal way (e.g.ESLint treated it like a normal inline comment. I don't know if these comments are useful long-term, different namespaceseems to me like these
should be grouped in a more formal way (e.g. different namespace property or separate file loaded for those), but for now I went
with a Markdown-esque way, using `// ## `.
```name=Before,lines=10
✖ 77 problems (0 errors, 77 warnings)
0 errors and 48 warnings potentially fixable with the `--fix` option.
/0ad-git/binaries/data/mods/public/simulation/components/UnitAI.js
331:4 warning Method 'Order.WalkToTarget' expected no return value consistent-return
766:5 warning Unnecessary 'else' after 'return' no-else-return
917:13 warning Expected to return a value at the end of method 'enter' consistent-return
942:13 warning Expected to return a value at the end of method 'enter' consistent-return
992:6 warning Method 'enter' expected no return value consistent-return
1033:14 warning Missing space before value for key 'GARRISON' key-spacing
1055:14 warning Expected to return a value at the end of method 'enter' consistent-return
1091:13 warning Expected to return a value at the end of method 'enter' consistent-return
1123:14 warning Expected to return a value at the end of method 'enter' consistent-return
1283:12 warning Expected to return a value at the end of method 'enter' consistent-return
1340:13 warning Expected to return a value at the end of method 'enter' consistent-return
1515:13 warning Expected to return a value at the end of method 'enter' consistent-return
1537:13 warning Expected to return a value at the end of method 'enter' consistent-return
1569:13 warning Expected to return a value at the end of method 'enter' consistent-return
1723:13 warning Expected to return a value at the end of method 'enter' consistent-return
1773:14 warning Expected to return a value at the end of method 'enter' consistent-return
1851:14 warning Expected to return a value at the end of method 'enter' consistent-return
1983:9 warning '&&' should be placed at the end of the line operator-linebreak
2028:14 warning Expected to return a value at the end of method 'enter' consistent-return
2144:14 warning Expected to return a value at the end of method 'enter' consistent-return
2419:14 warning Expected to return a value at the end of method 'enter' consistent-return
2452:14 warning Expected to return a value at the end of method 'enter' consistent-return
2558:14 warning Expected to return a value at the end of method 'enter' consistent-return
2624:14 warning Expected to return a value at the end of method 'enter' consistent-return
2663:14 warning Expected to return a value at the end of method 'enter' consistent-return
2710:41 warning A space is required after '{' object-curly-spacing
2710:101 warning A space is required before '}' object-curly-spacing
2874:14 warning Expected to return a value at the end of method 'enter' consistent-return
3055:14 warning Expected to return a value at the end of method 'enter' consistent-return
3223:1 warning Expected indentation of 2 tabs but found 7 indent
3280:43 warning Unnecessary use of boolean literals in conditional expression no-unneeded-ternary
3396:72 warning A space is required after ',' comma-spacing
3452:38 warning A space is required after '{' object-curly-spacing
3452:76 warning A space is required before '}' object-curly-spacing
3536:1 warning Expected space or tab after '//' in comment spaced-comment
3706:33 warning A space is required after '{' object-curly-spacing
3706:60 warning A space is required before '}' object-curly-spacing
3779:19 warning 'type' is already declared in the upper scope no-shadow
3877:36 warning A space is required after '{' object-curly-spacing
3877:88 warning A space is required before '}' object-curly-spacing
3922:36 warning A space is required after '{' object-curly-spacing
3922:80 warning A space is required before '}' object-curly-spacing
3947:36 warning A space is required after '{' object-curly-spacing
3947:68 warning A space is required before '}' object-curly-spacing
3952:36 warning A space is required after '{' object-curly-spacing
3952:80 warning A space is required before '}' object-curly-spacing
3957:36 warning A space is required after '{' object-curly-spacing
3957:92 warning A space is required before '}' object-curly-spacing
3963:37 warning A space is required after '{' object-curly-spacing
3963:75 warning A space is required before '}' object-curly-spacing
3965:37 warning A space is required after '{' object-curly-spacing
3965:79 warning A space is required before '}' object-curly-spacing
3970:36 warning A space is required after '{' object-curly-spacing
3970:81 warning A space is required before '}' object-curly-spacing
3973:1 warning Expected space or tab after '//' in comment spaced-comment
4626:25 warning 'target' is already declared in the upper scope no-shadow
4641:25 warning 'target' is already declared in the upper scope no-shadow
4643:5 warning '&&' should be placed at the end of the line operator-linebreak
4644:5 warning '&&' should be placed at the end of the line operator-linebreak
4687:22 warning 'ent' is already declared in the upper scope no-shadow
4707:20 warning Multiple spaces found before 'Engine' no-multi-spaces
4710:39 warning 'type' is already declared in the upper scope no-shadow
4711:1 warning Expected indentation of 3 tabs but found 4 indent
4749:20 warning Multiple spaces found before 'Engine' no-multi-spaces
4762:1 warning Expected space or tab after '//' in comment spaced-comment
4919:4 warning Unnecessary 'else' after 'return' no-else-return
5250:36 warning Trailing spaces not allowed no-trailing-spaces
5532:9 warning '&&' should be placed at the end of the line operator-linebreak
5535:9 warning '&&' should be placed at the end of the line operator-linebreak
5558:7 warning '&&' should be placed at the end of the line operator-linebreak
5561:7 warning '&&' should be placed at the end of the line operator-linebreak
5717:22 warning A space is required after '{' object-curly-spacing
5717:37 warning A space is required before '}' object-curly-spacing
5744:1 warning Expected space or tab after '//' in comment spaced-comment
5948:1 warning Expected space or tab after '//' in comment spaced-comment
5954:5 warning '&&' should be placed at the end of the line operator-linebreak
5957:1 warning Expected space or tab after '//' in comment spaced-comment
```
```name=After,lines=10
✖ 29 problems (0 errors, 29 warnings)
/0ad-git/binaries/data/mods/public/simulation/components/UnitAI.js
331:4 warning Method 'Order.WalkToTarget' expected no return value consistent-return
916:13 warning Expected to return a value at the end of method 'enter' consistent-return
941:13 warning Expected to return a value at the end of method 'enter' consistent-return
991:6 warning Method 'enter' expected no return value consistent-return
1054:14 warning Expected to return a value at the end of method 'enter' consistent-return
1090:13 warning Expected to return a value at the end of method 'enter' consistent-return
1122:14 warning Expected to return a value at the end of method 'enter' consistent-return
1282:12 warning Expected to return a value at the end of method 'enter' consistent-return
1339:13 warning Expected to return a value at the end of method 'enter' consistent-return
1514:13 warning Expected to return a value at the end of method 'enter' consistent-return
1536:13 warning Expected to return a value at the end of method 'enter' consistent-return
1568:13 warning Expected to return a value at the end of method 'enter' consistent-return
1722:13 warning Expected to return a value at the end of method 'enter' consistent-return
1772:14 warning Expected to return a value at the end of method 'enter' consistent-return
1850:14 warning Expected to return a value at the end of method 'enter' consistent-return
2027:14 warning Expected to return a value at the end of method 'enter' consistent-return
2143:14 warning Expected to return a value at the end of method 'enter' consistent-return
2418:14 warning Expected to return a value at the end of method 'enter' consistent-return
2451:14 warning Expected to return a value at the end of method 'enter' consistent-return
2557:14 warning Expected to return a value at the end of method 'enter' consistent-return
2623:14 warning Expected to return a value at the end of method 'enter' consistent-return
2662:14 warning Expected to return a value at the end of method 'enter' consistent-return
2873:14 warning Expected to return a value at the end of method 'enter' consistent-return
3054:14 warning Expected to return a value at the end of method 'enter' consistent-return
3778:19 warning 'type' is already declared in the upper scope no-shadow
4625:25 warning 'target' is already declared in the upper scope no-shadow
4640:25 warning 'target' is already declared in the upper scope no-shadow
4686:22 warning 'ent' is already declared in the upper scope no-shadow
4709:39 warning 'type' is already declared in the upper scope no-shadow
```