Commit graph

13 commits

Author SHA1 Message Date
Dunedan
93ce94655d
Use @stylistic/brace-style for eslint
Up to now `eslint-plugin-brace-rules` was used to enforce a common brace
style for JavaScript code. This plugin was however updated the last time
over 9 years ago and will be incompatible with ESLint v10, as that
[removes `context.getSourceCode()`][1], the plugin relies on.

To keep the eslint config working with ESLint v10, this replaces
`eslint-plugin-brace-rules` with the [`@stylistic/brace-style`][2] rule
from `@stylistic/eslint-plugin`, a package we already use.

While `@stylistic/brace-style` doesn't offer an option to format braces
in exactly the same way as before, the "allman" style seems to be the
one closest to the existing code.

[1]: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#removed-deprecated-rule-context-members
[2]: https://eslint.style/rules/brace-style
2026-01-12 21:33:52 +01:00
phosit
d98a205feb Don't pass report explicitly in ReportDraw
The function declaration binds `report` implicitly.

Ref: #7812
2025-05-30 14:16:32 +02:00
phosit
e0ed2ae0c8 Replace var in inner scopes from ReportDraw
Variables declared with `var` are also accible after accessing the
scope. This lead to shadowing because variables with the same name are
declared in a later scope.

Ref: #7812
2025-05-30 14:16:31 +02:00
phosit
07ed959422 Remove IIFE in ReportDraw
Since variables declared with `var` don't respect all scopes, when used
in a loop it doesn't create a new variable each iteration. The
initializer value is always assigned to the same variable. That makes
problems when the variable is used in a callback. To work around that
the variable is copied in to a IIFE.
When not using `var` the iife isn't required.

Ref: #7812
2025-05-30 14:16:18 +02:00
phosit
61de7ccbfc Don't use this in do_zoom callbacks
Ref: #7812
2025-05-30 13:22:06 +02:00
phosit
0e9d2a8d5e Remove outInterface from ReportDraw
Only return the one function which is actually used.

Ref: #7812
2025-05-30 13:21:59 +02:00
phosit
83f2a34a50 Make canvas local in ReportDraw
Ref: #7812
2025-05-30 13:21:41 +02:00
Ralph Sennhauser
9038b555fe
Eslint auto-fix JS in profiler2 webui
This fixes all issues eslint can safely do automatically. Drastically
reducing the number of open style issues reported.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-02 13:25:23 +02:00
elexis
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
elexis
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
elexis
bcbf25bfbd Fix line endings of all files in source/ except source/third_party/.
This was SVN commit r18558.
2016-07-25 09:07:45 +00:00
wraitii
be1b5a9fa7 Improve Profiler2 JS interface with multiple threads and frameless threads. Add a setting to the analysis graphs. Refs #4056
This was SVN commit r18436.
2016-06-25 10:12:04 +00:00
wraitii
3cbe96d24c Revamp Profiler2 to make it more usable.
Features include new graphs to compare runtime of functions and runtimes
across reports, as well as new profiling functions that only profile
spikes.

This was SVN commit r18423.
2016-06-22 13:38:05 +00:00