1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
Christopher Kolstad
a3d06bd57f
fix(website): failing build due to failure to import React 2024-03-18 15:24:16 +01:00
Christopher Kolstad
53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00
Alvin Bryan
3ea9496a8b
Apply biome formatting to the docs website (#6523)
The docs were ignored by biome, this fixes it. 
With this change
- The docs are no longer ignored by the formatter and the linter
- Custom components in the docs were updated to satisfy the linter
- All the files in the docs were formatted.

There is no new feature or change.
2024-03-13 11:30:40 +00:00
Christopher Kolstad
5a3bb1ffc3
Biome1.5.1 (#5867)
Lots of work here, mostly because I didn't want to turn off the
`noImplicitAnyLet` lint. This PR tries its best to type all the untyped
lets biome complained about (Don't ask me how many hours that took or
how many lints that was >200...), which in the future will force test
authors to actually type their global variables setup in `beforeAll`.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2024-01-12 09:25:59 +00:00
Nuno Góis
b496990f79
chore: add no unused imports biome rule (#5855)
Adds a Biome rule for "no unused imports", which is something we
sometimes have trouble catching.

We're adding this as a warning for now. It is safely and easily fixable
with `yarn lint:fix`.


![image](https://github.com/Unleash/unleash/assets/14320932/fd84dea8-6b20-4ba5-bfd8-047b9dcf2bff)

![image](https://github.com/Unleash/unleash/assets/14320932/990bb0b0-760a-4c5e-8136-d957e902bf0b)
2024-01-11 12:44:05 +00:00
renovate[bot]
c7498dcac6
chore(deps): update dependency @biomejs/biome to v1.4.0 (#5288)
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@biomejs/biome](https://biomejs.dev)
([source](https://togithub.com/biomejs/biome)) | [`1.3.3` ->
`1.4.0`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/1.3.3/1.4.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@biomejs%2fbiome/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@biomejs%2fbiome/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@biomejs%2fbiome/1.3.3/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@biomejs%2fbiome/1.3.3/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

###
[`v1.4.0`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#140-2023-11-27)

[Compare
Source](af24597c18...889593e3f9)

##### CLI

- Remove the CLI options from the `lsp-proxy`, as they were never meant
to be passed to that command. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Add option `--config-path` to `lsp-proxy` and `start` commands. It's
now possible to tell the Daemon server to load `biome.json` from a
custom path. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Add new `--diagnostic-level` option to let users control the level of
diagnostics printed by the CLI. Possible values are: `"info"`, `"warn"`,
`"hint"`. Contributed by
[@&#8203;simonxabris](https://togithub.com/simonxabris)

- Add option `--line-feed` to the `format` command. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)

- Add option `--bracket-same-line` to the `format` command. Contributed
by [@&#8203;faultyserve](https://togithub.com/faultyserve)

- Add option `--bracket-spacing` to the `format` command. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)

##### Bug fixes

- Fix the command `format`, now it returns a non-zero exit code when if
there pending diffs. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

##### Configuration

- Add option `formatter.lineFeed`. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)
- Add option `javascript.formatter.bracketSameLine`. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)
- Add option `javascript.formatter.bracketSpacing`. Contributed by
[@&#8203;faultyserve](https://togithub.com/faultyserve)

##### Formatter

##### New features

- Add a new option
[`--line-ending`](https://biomejs.dev/reference/configuration/#formatterlineending).
This option allows changing the type of line endings. Contributed by
[@&#8203;SuperchupuDev](https://togithub.com/SuperchupuDev)
- Added a new option called `--bracket-spacing` to the formatter. This
option allows you to control whether spaces are inserted around the
brackets of object literals.
[#&#8203;627](https://togithub.com/biomejs/biome/issues/627).
Contributed by [@&#8203;faultyserver](https://togithub.com/faultyserver)
- Added a new option called `--bracket-same-line` to the formatter. This
option allows you to control whether spaces are inserted around the
brackets of object literals.
[#&#8203;627](https://togithub.com/biomejs/biome/issues/627).
Contributed by [@&#8203;faultyserver](https://togithub.com/faultyserver)

##### Bug fixes

- Fix [#&#8203;832](https://togithub.com/biomejs/biome/issues/832), the
formatter no longer keeps an unnecessary trailing comma in type
parameter lists. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;301](https://togithub.com/biomejs/biome/issues/301), the
formatter should not break before the `in` keyword. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

##### Linter

##### Promoted rules

-
[a11y/noInteractiveElementToNoninteractiveRole](https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role)
-
[complexity/noThisInStatic](https://biomejs.dev/linter/rules/no-this-in-static)
-
[complexity/useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function)
-
[correctness/noEmptyCharacterClassInRegex](https://biomejs.dev/linter/rules/no-empty-character-class-in-regex)
-
[correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin)
-
[style/noUselessElse](https://biomejs.dev/linter/rules/no-useless-else)
-
[style/useAsConstAssertion](https://biomejs.dev/linter/rules/use-as-const-assertion)
-
[style/useShorthandAssign](https://biomejs.dev/linter/rules/use-shorthand-assign)
-
[suspicious/noApproximativeNumericConstant](https://biomejs.dev/linter/rules/no-approximative-numeric-constant)
-
[suspicious/noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-misleading-instantiator)
-
[suspicious/noMisrefactoredShorthandAssign](https://biomejs.dev/linter/rules/no-misrefactored-shorthand-assign)

The following rules are now recommended:

-   [a11y/noAccessKey](https://biomejs.dev/linter/rules/no-access-key)
-
[a11y/useHeadingContent](https://biomejs.dev/linter/rules/use-heading-content)
-
[complexity/useSimpleNumberKeys](https://biomejs.dev/linter/use-simple-number-keys)

The following rules are now deprecated:

-
[correctness/noNewSymbol](https://biomejs.dev/linter/rules/no-new-symbol)
The rule is replaced by
[correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin)

##### New features

- Add
[noDefaultExport](https://biomejs.dev/linter/rules/no-default-export)
which disallows `export default`. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Add
[noAriaHiddenOnFocusable](https://biomejs.dev/linter/rules/no-aria-hidden-on-focusable)
which reports hidden and focusable elements. Contributed by
[@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Add
[noImplicitAnyLet](https://biomejs.dev/linter/rules/no-implicit-any-let)
that reports variables declared with `let` and without initialization
and type annotation. Contributed by
[@&#8203;TaKO8Ki](https://togithub.com/TaKO8Ki) and
[@&#8203;b4s36t4](https://togithub.com/b4s36t4)

- Add [useAwait](https://biomejs.dev/linter/rules/use-await) that
reports `async` functions that don't use an `await` expression.

- Add
[useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role).
Contributed by [@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Add [useRegexLiterals](https://biomejs.dev/linter/use-regex-literals)
that suggests turning call to the regex constructor into regex literals.
COntributed by [@&#8203;Yuiki](https://togithub.com/Yuiki)

##### Enhancements

- Add an unsafe code fix for
[a11y/useAriaActivedescendantWithTabindex](https://biomejs.dev/linter/rules/use-aria-activedescendant-with-tabindex)

##### Bug fixes

- Fix [#&#8203;639](https://togithub.com/biomejs/biome/issues/639) by
ignoring unused TypeScript's mapped key. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;565](https://togithub.com/biomejs/biome/issues/565) by
handling several `infer` with the same name in extends clauses of
TypeScript's conditional types. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;653](https://togithub.com/biomejs/biome/issues/653).
[noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports)
now correctly removes the entire line where the unused `import` is.
Contributed by [@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;607](https://togithub.com/biomejs/biome/issues/609)
`useExhaustiveDependencies`, ignore optional chaining, Contributed by
[@&#8203;msdlisper](https://togithub.com/msdlisper)

- Fix [#&#8203;676](https://togithub.com/biomejs/biome/issues/676), by
using the correct node for the `"noreferrer"` when applying the code
action. Contributed by
[@&#8203;ematipico](https://togithub.com/ematipico)

- Fix [#&#8203;455](https://togithub.com/biomejs/biome/issues/455). The
CLI can now print complex emojis to the console correctly.

- Fix [#&#8203;727](https://togithub.com/biomejs/biome/issues/727).
[noInferrableTypes](https://biomejs.dev/linter/rules/no-inferrable-types)
now correctly keeps type annotations when the initialization expression
is `null`. Contributed by
[@&#8203;Conaclos](https://togithub.com/Conaclos)

- Fix [#&#8203;784](https://togithub.com/biomejs/biome/issues/784),
[noSvgWithoutTitle](https://biomejs.dev/linter/rules/no-svg-without-title)
fixes false-positives to `aria-label` and reports svg's role attribute
is implicit. Contributed by
[@&#8203;unvalley](https://togithub.com/unvalley)

- Fix [#&#8203;834](https://togithub.com/biomejs/biome/issues/834) that
made
[noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements)
reports block statements of switch clauses. Contributed by
[@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Fix [#&#8203;783](https://togithub.com/biomejs/biome/issues/834) that
made
[noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements)
reports block statements of `try-catch` structures. Contributed by
[@&#8203;hougesen](https://togithub.com/hougesen)

- Fix [#&#8203;69](https://togithub.com/biomejs/biome/issues/69) that
made
[correctness/noUnnecessaryContinue](https://biomejs.dev/linter/rules/no-unnecessary-continue)
incorrectly reports a `continue` used to break a switch clause.
Contributed by [@&#8203;TaKO8Ki](https://togithub.com/TaKO8Ki)

- Fix [#&#8203;664](https://togithub.com/biomejs/biome/issues/664) by
improving the diagnostic of
[style/useNamingConvention](https://biomejs.dev/linter/use-naming-convention)
when double capital are detected in strict camel case mode. Contributed
by [@&#8203;vasucp1207](https://togithub.com/vasucp1207)

- Fix [#&#8203;643](https://togithub.com/biomejs/biome/issues/643) that
erroneously parsed the option of
[complexity/useExhaustiveDependencies](https://biomejs.dev/linter/use-naming-convention).
Contributed by [@&#8203;arendjr](https://togithub.com/arendjr)

##### Parser

##### Bug fixes

- Fix [#&#8203;846](https://togithub.com/biomejs/biome/issues/846) that
erroneously parsed `<const T,>() => {}` as a JSX tag instead of an arrow
function when both TypeScript and JSX are enabled.

##### VSCode

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40Ni4wIiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christopher Kolstad <chriswk@getunleash.io>
2023-11-28 09:32:00 +00:00
Christopher Kolstad
c179c8ad5e
chore(update): Updates biome config to 1.3 format (#5421)
Does what it says on the tin, update to 1.3.x format for biome config
2023-11-27 13:42:58 +01:00
Christopher Kolstad
c60bca777f
feat: replace gravatar-url with inline function (#5128)
As #4475 says, MD5 is not available in secure places anymore. This PR
swaps out gravatar-url with an inline function using crypto:sha256 which
is FIPS-140-2 compliant. Since we only used this method for generating
avatar URLs the extra customization wasn't needed and we could hard code
the URL parameters.
 
fixes: Linear
https://linear.app/unleash/issue/SR-112/gh-support-swap-out-gravatar-url-lib
closes: #4475
2023-10-24 10:07:26 +02:00
Christopher Kolstad
b319cec5f0
task: use https://git-cliff.org for changelog (#4907)
### What
Initial effort at automating the task of updating CHANGELOG when doing
releases.

This initial PR sets up the tool https://git-cliff.org/ and adds our
missing updates since 4.2.0

The tool should be explored further, we could have the CHANGELOG linking
linear issues, not just github issues, as well as ideally each commit
displayed with it's short sha. However, rather than not having anything
like this for the last 20+ releases, this will at least have our
conventional commits be included in the CHANGELOG file.
2023-10-03 09:40:36 +02:00
Nuno Góis
4167a60588
feat: biome lint frontend (#4903)
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome
to the frontend as well.


![image](https://github.com/Unleash/unleash/assets/14320932/1906faf1-fc29-4172-a4d4-b2716d72cd65)

Added a few `biome-ignore` to speed up the process but we may want to
check and fix them in the future.
2023-10-02 13:25:46 +01:00
Christopher Kolstad
6673d131fe
feat: biome lint (#4853)
This commit changes our linter/formatter to biome (https://biomejs.dev/)
Causing our prehook to run almost instantly, and our "yarn lint" task to
run in sub 100ms.

Some trade-offs:
* Biome isn't quite as well established as ESLint
* Are we ready to install a different vscode plugin (the biome plugin)
instead of the prettier plugin


The configuration set for biome also has a set of recommended rules,
this is turned on by default, in order to get to something that was
mergeable I have turned off a couple the rules we seemed to violate the
most, that we also explicitly told eslint to ignore.
2023-09-29 14:18:21 +02:00