diff options
author | silverwind <me@silverwind.io> | 2023-09-19 02:50:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-19 00:50:30 +0000 |
commit | ae8e8f055e9edfe258e641df8752a070ffdd6823 (patch) | |
tree | 1181f5dec6a7e9cfff020aa08d073582cfcc5e43 /.eslintrc.yaml | |
parent | 8099238618f6573f1eb5cfeeb0902b641e7121ab (diff) | |
download | gitea-ae8e8f055e9edfe258e641df8752a070ffdd6823.tar.gz gitea-ae8e8f055e9edfe258e641df8752a070ffdd6823.zip |
Use fetch helpers instead of fetch (#27026)
WIP because:
- [x] Some calls set a `content-type` but send no body, can likely
remove the header
- [x] Need to check whether `charset=utf-8` has any significance on the
webauthn calls, I assume not as it is the default for json content.
- [x] Maybe `no-restricted-globals` is better for eslint, but will
require a lot of duplication in the yaml or moving eslint config to a
`.js` extension.
- [x] Maybe export `request` as `fetch`, shadowing the global.
Diffstat (limited to '.eslintrc.yaml')
-rw-r--r-- | .eslintrc.yaml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 846823abc7..c9ea481af4 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -46,6 +46,9 @@ overrides: - files: ["*.config.*"] rules: import/no-unused-modules: [0] + - files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"] + rules: + no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression] rules: "@eslint-community/eslint-comments/disable-enable-pair": [2] @@ -420,7 +423,7 @@ rules: no-restricted-exports: [0] no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename] no-restricted-imports: [0] - no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression] + no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}] no-return-assign: [0] no-script-url: [2] no-self-assign: [2, {props: true}] |