8 Commits

Author SHA1 Message Date
Pablo Zmdl
ad9cbf23fb Make eslint check ECMAscript 2022
This allows using public and private class fields, which are supported in all major browsers since years, (but just made
it into ECMAScript 2022).
See
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields#browser_compatibility>
and <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_elements#browser_compatibility>.
2025-10-27 15:34:19 +01:00
Pablo Zmdl
85094706f9 Docker compose for testing (#9525)
* More ignore-patterns in eslint config

So we don't have to specify them on the command line when we check
codestyle locally.

* Test setup for local and CI using containers

It uses standalone containers for the greenmail IMAP server and the
standalone browser.
A testrunner image is built in the CI (for `linux/amd64` only, because
Github doesn't support multi-platform building on their default
runners and we don't have our own.)

This setup helps to run the tests (reproduceably) also locally.
Previously, on my machine, they produced varying results.
It also reduces the dependencies for running the browser test.
Local execution only depends on `docker compose`, no other tools
(previously it required `sudo`, `java`, and some more.)

The previous solution should still work, if you want it.

The scripts are stored in a directory called `.ci` to hide them a little
and avoid confusion with the container images from the
`roundcubemail-docker` repo.

* Fix UI tests by waiting for element before using it

This only was a flaky problem only occurring sometimes.

* Force a new IMAP connection in plugin tests, too

In other code the initial connection is forced. Doing this here, too,
fixes occasional problems with lost imap connections.

* Make waiting for zipfile's content more robust

* CI: Run tests from script on Windows, too

* CI: Do start local chrome if no connect URL is given

* Move compose.yml to tests/

This way it's less easy mistaken as usable for running Roundcubemail in
production.

* Move compose.yml to .ci/
2024-07-22 11:44:09 +02:00
Pablo Zmdl
cf6f6c8eae Fix Code Spell check by disabling String.raw rule
The eslint package "eslint-plugin-unicorn" introduced a new rule in
version 53.0.0 that suggests to use `String.raw` in order to avoid the
need for escaping backslashes.

While this certainly is a good idea we cannot follow that rule as long
as we support Internet Explorer 11+, which doesn't support template
literals (and thus `String.raw`).
2024-05-14 10:44:03 +02:00
Michael Voříšek
332c165d28 Fix some basic JS CS (#9328)
* fix "nonblock-statement-body-position" (fixed already)

* fix "comma-dangle"

* fix "no-regex-spaces"

* fix "new-parens"

* fix "object-curly-newline"

* fix "object-property-newline"

* fix "spaced-comment" semimanually

* fix "no-constant-condition" manually

* fix "unicorn/no-hex-escape"

* fix "unicorn/escape-case"

* fix "quote-props"

* fix "no-whitespace-before-property" - fix bug/typo

* fix "unicorn/empty-brace-spaces"

* fix "keyword-spacing"

* fix "dot-notation"

* fix "no-return-assign" manually

* fix "padding-line-between-statements"

* fix "key-spacing"

* fix "no-else-return" semimanually

* fix some "no-undef"

* fix case cs

* Revert "fix "padding-line-between-statements""

* improve switch/case format I.

* improve switch/case format II.

regex: (^ *(break|return).*)\n *(\n)

* fix safe "eqeqeq"

* fix "radix"

* fix v3.49.0 CS (static providers)

* fix "string_implicit_backslashes" in php files

* fix comments align

* fix test static providers

* fix stan

* disable "final_internal_class" rule
2024-02-06 08:28:19 +01:00
Michael Voříšek
ecd2796622 Fix JS whitespace CS (#9327)
* fix "no-extra-semi"

* fix "object-curly-spacing"

* fix "block-spacing"

* fix "padded-blocks"

* fix "space-before-blocks"

* fix "space-before-function-paren"

* fix "operator-linebreak"

* fix "space-unary-ops"

* fix "space-infix-ops"

* fix most "brace-style"

* fix "curly"

* fix most "brace-style" II

* fix "no-multi-spaces"

* search regex: (?<=\n)( +)(?! ).*\n(?!\1)( +)(&&|\|\||\()

* search regex: (?<=\n)( +)(?! |\*/).*(?<!;)\n(?!\1)( +)(?! |\}|\]|\)|\.)

* fix mostly "brace-style" /w allowSingleLine: false

* fix cs

* search regex: (//|/\*).*\n\s+\{
2024-01-30 07:50:02 +01:00
Michael Voříšek
6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00
Michael Voříšek
2643be3eaa Fix single quotes CS (#9283)
* Fix "single_quote"

* fix "escape_implicit_backslashes"

* fix typo from f363481c

* fix single quotes in JS

* fix some minor JS CS

* fix CS v3.45.0
2023-12-31 16:36:55 +01:00
Michael Voříšek
740267fac0 Lint JS files using eslint and normalize JS indentation (#9280)
* Lint JS using eslint

* Fix "comma-spacing"

* Fix "semi"

* Fix indent to unified 4 spaces as for PHP

* ignore symlinked public_html/* files
2023-12-23 17:08:32 +01:00