Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Biome formatter #6248

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[ci] Biome formatter #6248

wants to merge 3 commits into from

Conversation

ganthern
Copy link
Contributor

@ganthern ganthern commented Dec 1, 2023

No description provided.

@ganthern ganthern changed the title Biome formatter [ci] Biome formatter Dec 1, 2023
@charlag
Copy link
Contributor

charlag commented Dec 1, 2023

Cool! Although long lines are really a mixed bag.

My biggest concern is that Prettier is integrated into Webstorm nicely and for Biome we have to install it additionally:
https://plugins.jetbrains.com/plugin/22761-biome

@ganthern
Copy link
Contributor Author

ganthern commented Dec 5, 2023

Cool! Although long lines are really a mixed bag.

My biggest concern is that Prettier is integrated into Webstorm nicely and for Biome we have to install it additionally: https://plugins.jetbrains.com/plugin/22761-biome

that's also only compatible with webstorm >= 2023.2. we're still on 2023.1

@charlag
Copy link
Contributor

charlag commented Dec 5, 2023

Cool! Although long lines are really a mixed bag.
My biggest concern is that Prettier is integrated into Webstorm nicely and for Biome we have to install it additionally: https://plugins.jetbrains.com/plugin/22761-biome

that's also only compatible with webstorm >= 2023.2. we're still on 2023.1

what I hear is that we have finally an excuse to update

@ganthern
Copy link
Contributor Author

ganthern commented Dec 21, 2023

comparison of our error lint rules and biomes available rules

https://eslint.org/docs/latest/rules/
https://biomejs.dev/linter/rules/

not implemented in biome yet afaict:
  "unicorn/prefer-array-some": "",
  "@typescript-eslint/triple-slash-reference": "",
  "@typescript-eslint/adjacent-overload-signatures": "",
  "@typescript-eslint/no-array-constructor": "",
  "no-dupe-else-if": "",
  "no-invalid-regexp": "",
  "no-octal": "",
  "no-useless-backreference": "",

these are available in some other form or may be obsolete:
  // probably unneeded due to no-namespace?
  "@typescript-eslint/prefer-namespace-keyword": "useNamespaceKeyword",
  // there's also the noGlobalIsNan and noGlobalIsFinite rules
  "use-isnan": "useIsNan"
  // probably rather no-var? can't delete what's not defined
  "no-delete-var": "noVar",

these have a direct equivalent in biome:
  "no-global-assign": "noGlobalAssign",
  "unicorn/prefer-node-protocol": "useNodeImportProtocol",
  "unicorn/no-array-for-each": "noForEach",
  "@typescript-eslint/no-empty-interface": "noEmptyInterface",
  "@typescript-eslint/no-extra-non-null-assertion": "noExtraNonNullAssertion",
  "@typescript-eslint/no-loss-of-precision": "noPrecisionLoss",
  "@typescript-eslint/no-misused-new": "noMisleadingInstantiator",
  "@typescript-eslint/no-namespace": "noNamespace",
  "@typescript-eslint/no-unnecessary-type-constraint": "noUselessTypeConstraint",
  "@typescript-eslint/prefer-as-const": "useAsConstAssertion",
  "for-direction": "useValidForDirection",
  "no-class-assign": "noClassAssign",
  "no-compare-neg-zero": "noCompareNegZero",
  "no-cond-assign": "noAssignInExpressions",
  "no-debugger": "noDebugger",
  "no-duplicate-case": "noDuplicateCase",
  "no-empty-character-class": "noEmptyCharacterClassInRegex",
  "no-ex-assign": "noCatchAssign",
  "no-extra-boolean-cast": "noExtraBooleanCast",
  "no-misleading-character-class": "noMisleadingCharacterClass",
  "no-nonoctal-decimal-escape": "noNonoctalDecimalEscape",
  "no-regex-spaces": "noMultipleSpacesInRegularExpressionLiterals",
  "no-self-assign": "noSelfAssign",
  "no-shadow-restricted-names": "noShadowRestrictedNames",
  "no-sparse-arrays": "noSparseArray",
  "no-unsafe-finally": "noUnsafeFinally",
  "no-unsafe-optional-chaining": "noUnsafeOptionalChaining",
  "no-unused-labels": "noUnusedLabels",
  "no-useless-catch": "noUselessCatch",
  "no-with": "noWith",
  "require-yield": "useYield",

@ganthern
Copy link
Contributor Author

ganthern commented Jan 10, 2024

updated for biome 1.5.1.

biome now has one more previously missing lint rule (no-global-assign) and the current intelliJ plugin nightly build supports format-on-save

https://plugins.jetbrains.com/plugin/22761-biome/versions/nightly/461235

it's not a 100% drop-in, but it's like a hundred times faster.
biome has a list of ignored files it will not touch and will be noisy
when explicitly given these files, which is bad for our pre-commit hook.

also doesn't call biome if there's nothing left after filtering out
ignored files.

this is deliberately not sending the error output to /dev/null so we can
see if something really is going wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants