summaryrefslogtreecommitdiffstats
path: root/.eslintrc.yaml
Commit message (Collapse)AuthorAgeFilesLines
* Fix gitea-origin-url with default ports (#29085) (#29088)Giteabot2024-02-081-1/+1
| | | | | | | | | | | | | | | | | | Backport #29085 by @silverwind When setting `url.host` on a URL object with no port specified (like is the case of default port), the resulting URL's port will not change. Workaround this quirk in the URL standard by explicitely setting port for the http and https protocols. Extracted the logic to a function for the purpose of testing. Initially I wanted to have the function in utils.js, but it turns out esbuild can not treeshake the unused functions which would result in the webcomponents chunk having all 2kB utils.js inlined, so it seemed not worth. Fixes: https://github.com/go-gitea/gitea/issues/29084 Co-authored-by: silverwind <me@silverwind.io>
* Update JS and PY dependencies (#27501) (#27518)silverwind2023-10-081-1/+1
| | | | | | | | | | | | | | | | Backport https://github.com/go-gitea/gitea/pull/27501 to 1.21 - Update all JS and PY dependencies - Enable eslint `prefer-object-has-own` and autofix issue - Fix styling on citation buttons - Tested citation, mermaid, monaco, swagger, katex Citation button issue was that these buttons were not filled: <img width="136" alt="Screenshot 2023-10-07 at 14 05 08" src="https://github.com/go-gitea/gitea/assets/115237/435f0c91-28ac-46b3-bae4-dad768b29c05"> Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Use vitest globals (#27102) (#27311)Giteabot2023-09-271-0/+4
| | | | | | | | Backport #27102 by @silverwind Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing the noise in test files. Co-authored-by: silverwind <me@silverwind.io>
* Update JS and Poetry dependencies and eslint (#27200) (#27201)Giteabot2023-09-221-15/+14
| | | | | | | | | | | Backport #27200 by @silverwind - Update all JS and Poetry dependencies - Remove deprecated `eslint-plugin-custom-elements` and replace it with rules from `eslint-plugin-wc` - Add a convenience `make update` to update both js and py dependencies - Tested markdown toolbar, swagger and citation Co-authored-by: silverwind <me@silverwind.io>
* Use fetch helpers instead of fetch (#27026)silverwind2023-09-191-1/+4
| | | | | | | | | | | | 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.
* Add `yamllint` (#26965)silverwind2023-09-071-1/+1
| | | | | | | | | So that https://github.com/go-gitea/gitea/pull/26964 does not happen again. Merge this after that PR. Config is based on [node's](https://github.com/nodejs/node/blob/main/.yamllint.yaml). --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* Update js and py dependencies (#26243)silverwind2023-07-311-1/+0
| | | | | | | | - Update all JS and PY dependencies minus `eslint-plugin-eslint-comments` (because of https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/89) - Regenerate SVGs - Remove depreacted eslint rule - Tested mermaid and swagger
* Update JS dependencies (#26025)silverwind2023-07-211-2/+1
| | | | | | | | - Update all JS dependencies - Tweak eslint config, disable SequenceExpression aka. [Comma operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator), remove deprecated rule - Add new stylelint rule - Tested Monaco and Swagger
* Update JS dependencies, misc tweaks (#25768)silverwind2023-07-081-3/+3
| | | | | | - Update all JS dependencies minus stylelint because of https://github.com/elirasza/stylelint-stylistic/issues/12 - Misc tweaks to eslint and stylelint configs - Tested Monaco and Mermaid
* Add toasts to UI (#25449)silverwind2023-06-271-3/+4
| | | | | Fixes https://github.com/go-gitea/gitea/issues/24353 In some case like async success/error, it is useful to show toasts in UI.
* Update js dependencies (#25137)silverwind2023-06-081-3/+3
| | | | | | | - Update all JS dependencies - Tweak eslint for more generic globs - Tested mermaid, pdf, monaco Co-authored-by: Giteabot <teabot@gitea.io>
* Add two eslint plugins (#24776)silverwind2023-05-181-0/+9
| | | | | | | | Add these two plugins and autofix issues: - [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native) - [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
* Switch to `@eslint-community/eslint-comments` (#24736)silverwind2023-05-151-13/+13
| | | | | | | | [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments) is unmaintained, switch to the community fork. See https://github.com/mysticatea/eslint-plugin-eslint-comments/issues/72 for discussion.
* Add `eslint-plugin-eslint-comments` (#24690)silverwind2023-05-121-0/+10
| | | | | Add [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments) which prevents some abuse related to eslint comments.
* Add `eslint-plugin-wc` (#24689)silverwind2023-05-121-0/+10
| | | | Add [eslint-plugin-wc](https://github.com/43081j/eslint-plugin-wc), another small set of eslint rules covering web components.
* Update JS dependencies, add new eslint rules (#24597)silverwind2023-05-091-13/+15
| | | | | | | | | | | | - Update all JS dependencies - Enable new eslint rules, fix issue (some via autofix) - Fix some missed eslint rule renames from [unicorn v25](https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v25.0.0) - Tested Monaco, Katex, Swagger UI --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Add eslint-plugin-regexp (#24361)silverwind2023-04-261-0/+75
| | | | | | Add [`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp) and fix discovered issues. Config is mostly the recommended one, but I relaxed a few rules.
* Add all `no-query` rules to eslint config (#24294)silverwind2023-04-231-1/+93
| | | Add rules of the `no-jquery` plugin to the config and enable all non-violating ones.
* Introduce eslint-plugin-no-jquery/no-event-shorthand (#24198)yp053272023-04-201-0/+2
| | | | | | | https://github.com/go-gitea/gitea/pull/24098#issuecomment-1514010690 --------- Co-authored-by: silverwind <me@silverwind.io>
* Update JS dependencies (#24218)silverwind2023-04-191-2/+2
| | | | | | - Update all js dependencies, update playwright image to jammy - Adjust eslint and vitest config - Tested build, monaco, mermaid, katex
* Add eslint-plugin-custom-elements (#23991)silverwind2023-04-081-0/+14
| | | | | Add [eslint-plugin-custom-elements](https://github.com/github/eslint-plugin-custom-elements) and enable all rules that I've found sensible.
* Remove jQuery ready usage (#23858)silverwind2023-04-011-1/+1
| | | | Replace it with equal function of our own and enable the eslint rule to forbid future usage.
* Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, ↵wxiaoguang2023-02-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | remove inline style=display:none (#22950) Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
* Update JS dependencies (#22538)silverwind2023-01-211-0/+2
| | | | | | | | | | - Update all JS dependencies - Add new eslint rules - Rebuild SVGs - Tested citation and build SVG changes are because of https://github.com/primer/octicons/pull/883. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update JS dependencies and eslint (#22190)silverwind2022-12-201-3/+3
| | | | | | | - Update all JS dependencies to latest version - Enable unicorn/prefer-node-protocol and autofix issues - Regenerate SVGs - Add some comments to eslint rules - Tested build, Mermaid and Katex rendering
* Update JS dependencies (#21881)silverwind2022-11-221-0/+5
| | | | | | | | - Update all JS deps - Regenerate SVGs - Add new eslint rules, fix issues - Tested Mermaid, Swagger, Vue, Webpack, Citation Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improvements for Content Copy (#21842)silverwind2022-11-211-1/+1
| | | | | | | | | It now supports copying Markdown, SVG and Images (not in Firefox currently because of lacking [`ClipboardItem`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem) support, but can be enabled in `about:config` and works). It will fetch the data if in a rendered view or when it's an image. Followup to https://github.com/go-gitea/gitea/pull/21629.
* Update JS dependencies and misc tweaks (#21583)silverwind2022-10-281-6/+6
| | | | | | | | | | | - Update all JS dependencies to latest version - Disable two redundant eslint rules - Adapt stylelint config to codebase - Regenerate SVGs - Make file editor spinner "reserve" height so page does not shift - Tested katex, swagger, monaco Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Remove vitest globals (#21505)silverwind2022-10-191-3/+0
| | | | | | | Explicitly import them instead which is cleaner and enables better editor integration. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update JS dependencies and eslint config (#21388)silverwind2022-10-101-3/+6
| | | | | | | | - Update all JS dependencies and playwright image - Add new eslint rules, enable a few more, fix issues - Regenerate SVGs - Tested Vue and Swagger Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update JS dependencies and lint (#21144)silverwind2022-09-111-1/+1
| | | | | - Update all JS dependencies minus vue - Enable one more eslint rule, no new issues with it - Tested build
* Update JS dependencies, adjust eslint (#20659)silverwind2022-08-061-9/+9
| | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies minus vue-* - Improve eslint restricted globals - Tested build, lint and swagger * few more lint improvements Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add eslint-plugin-sonarjs (#20431)silverwind2022-07-221-0/+33
| | | | | | | We had this plugin before but it was removed as it became outdated, now it was updated again, so it's compatible again. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Update JS dependencies (#20423)silverwind2022-07-201-0/+2
| | | | | | - Update all JS dependencies minus vue ones - Remove workaround for case-insensitive attribute selector - Add new linter rules and fix issues - Tested SVG display and swagger
* Fix eslint parsing errors, remove eslint-plugin-html (#20323)silverwind2022-07-151-18/+1
| | | | | | | | | | | Introduce a separate .eslintrc in the Vue components folder to selectively enable vue-eslint-parser there, so that the rest of the files can use eslint's core parser which can deal with hashbangs. The fact that the eslint-disable comments worked in HTML was a unintended side-effect of the files being parsed via vue-eslint-parser, so I had to disable the parsing of these files in .eslintrc.yaml to make it work, and finally decided to remove eslint-plugin-html as it causes more issues than it solves.
* Move eslintrc/stylelintrc to non-deprecated extensions (#20110)silverwind2022-06-241-0/+513