mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 03:29:43 +02:00
chore: update eslint, enable more rules and fix their findings (#39438)
Update eslint and its plugins, enable more rules and fix their findings: 1. `unicorn/no-unsafe-string-replacement` found that uploading a file whose name contains `$&` inserted a broken markdown link, because `String#replace` expands such patterns in the replacement string 2. `@typescript-eslint/require-await` removes `async` from functions that never await 3. Plugin rules not covered by a preset are now listed explicitly --------- Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
1 parent
a15f032026
commit
857d3d3df3
35 files changed
+299
-197
No files matched your search
+1
-1
@@ -106,7 +106,7 @@ function iifePlugin(sourceFileName: string): Plugin {
|
||||
const result = await build(iifeBuildOpts({sourceFileName, write: false}));
|
||||
const output = (Array.isArray(result) ? result[0] : result) as Rolldown.RolldownOutput;
|
||||
const chunk = output.output[0];
|
||||
iifeCode = chunk.code.replace(/\/\/# sourceMappingURL=.*/, `//# sourceMappingURL=${sourceBaseName}.js.map`);
|
||||
iifeCode = chunk.code.replace(/\/\/# sourceMappingURL=.*/, () => `//# sourceMappingURL=${sourceBaseName}.js.map`);
|
||||
const mapAsset = output.output.find((o) => o.fileName.endsWith('.map'));
|
||||
iifeMap = mapAsset && 'source' in mapAsset ? String(mapAsset.source) : '';
|
||||
iifeModules.clear();
|
||||
|
||||
Reference in new issue
Block a user