Skip to content

Releases: biomejs/biome

CLI v1.6.0

08 Mar 14:31
560628b
Compare
Choose a tag to compare

Analyzer

New features

  • Add partial for .astro files. Biome is able to sort imports inside the frontmatter of the Astro files. Contributed
    by @ematipico

    ---
    - import { getLocale } from "astro:i18n";
    - import { Code } from "astro:components";
    + import { Code } from "astro:components";
    + import { getLocale } from "astro:i18n";
    ---
    
    <div></div>
  • Add partial for .vue files. Biome is able to sort imports inside the script block of Vue files. Contributed by
    @nhedger

    <script setup lang="ts">
    - import Button from "./components/Button.vue";
    - import * as vueUse from "vue-use";
    + import * as vueUse from "vue-use";
    + import Button from "./components/Button.vue";
    </script/>
    
    <template></template>
  • Add partial for .svelte files. Biome is able to sort imports inside the script block of Svelte files. Contributed by
    @ematipico

    <script setup lang="ts">
    - import Button from "./components/Button.svelte";
    - import * as svelteUse from "svelte-use";
    + import * as svelteUse from "svelte-use";
    + import Button from "./components/Button.svelte";
    </script/>
    
    <div></div>
  • Add lint rule useJsxKeyInIterable from Eslint rule react/jsx-key. Contributed by @vohoanglong0107

  • The analyzer now infers the correct quote from javascript.formatter.quoteStyle, if set. This means that code fixes suggested by the analyzer will use the same quote of the formatter. Contributed by @ematipico

Enhancements

  • noUnusedVariables ignores unused rest spread silbings.

    The following code is now valid:

    const { a, ...rest } = { a: 0, b: 1 };
    console.log(rest);

    Contributed by @ah-yu

  • Fix #1931. Built-in React hooks such as
    useEffect() can now be validated by the
    useExhaustiveDependendies, even
    when they're not being imported from the React library. To do so, simply configure them like
    any other user-provided hooks.

    Contributed by @arendjr

  • Implemented #1128. User-provided React hooks can
    now be configured to track stable results. For example:

    "useExhaustiveDependencies": {
        "level": "error",
        "options": {
            "hooks": [{
                "name": "useMyState",
                "stableResult": [
                    1
                ]
            }]
        }
    }

    This will allow the following to be validated:

    const [myState, setMyState] = useMyState();
    const toggleMyState = useCallback(() => {
      setMyState(!myState);
    }, [myState]); // Only `myState` needs to be specified here.

    Contributed by @arendjr

Bug fixes

  • Fix #1748. Now for the following case we won't provide an unsafe fix
    for the noNonNullAssertion rule:

    x[y.z!];

    Contributed by @ah-yu

  • Imports that contain the protocol : are now sorted after the npm: modules, and before the URL modules.
    Contributed by @ematipico

    import express from "npm:express";
    - import Component from "./component.js"
    - import { sortBy } from "virtual:utils";
    + import { sortBy } from "virtual:utils";
    + import Component from "./component.js"
  • Fix #1081. The useAwait rule does not report for await...of.
    Contributed by @unvalley

  • Fix #1827 by properly analyzing nested try-finally statements. Contributed by @ah-yu

  • Fix #1924 Use the correct export name to sort in the import clause. Contributed by @ah-yu

  • Fix #1805 fix formatting arrow function which has conditional expression body Contributed by @mdm317

  • Fix #1781 by avoiding the retrieval of the entire static member expression for the reference if the static member expression does not start with the reference. Contributed by @ah-yu

CLI

New features

  • Add a new command biome migrate prettier. The command will read the file .prettierrc/prettier.json
    and .prettierignore and map its configuration to Biome's one.
    Due to the different nature of .prettierignore globs and Biome's globs, it's highly advised to make sure that
    those still work under Biome.

  • Now the file name printed in the diagnostics is clickable. If you run the CLI from your editor, you can
    Ctrl
    / + Click on the file name, and the editor will open said file. If row and columns
    are specified e.g. file.js:32:7, the editor will set the cursor right in that position. Contributed by @ematipico

  • Add an option --linter to biome rage. The option needs to check Biome linter configuration. Contributed by
    @seitarof

  • Add an option --formatter to biome rage. The option needs to check Biome formatter configuration. Contributed by
    @seitarof

  • The CLI now consistently reports the number of files tha were changed, out of the total files that were analysed. Contributed by @ematipico

  • The CLI now consistently shows the number of errors and warnings emitted. Contributed by @ematipico

Bug fixes

  • Don't process files under an ignored directory.

    Previously, Biome processed all files in the traversed hierarchy,
    even the files under an ignored directory.
    Now, it completely skips the content of ignored directories.

    For now, directories cannot be ignored using files.include in the configuration file.
    This is a known limitation that we want to address in a future release.

    For instance, if you have a project with a folder src and a folder test,
    the following configuration doesn't completely ignore test.

    {
      "files": {
        "include": ["src"]
      }
    }

    Biome will traverse test,
    however all files of the directory are correctly ignored.
    This can result in file system errors,
    if Biome encounters dangling symbolic links or files with higher permissions.

    To avoid traversing the test directory,
    you should ignore the directory using ignore:

    {
      "files": {
        "include": ["src"],
        "ignore": ["test"]
      }
    }
  • Fix #1508 by excluding deleted files from being processed. Contributed
    by @ematipico

  • Fix #1173. Fix the formatting of a single instruction with commented
    in a control flow body to ensure consistency. Contributed by @mdm317

  • Fix overriding of javascript.globals. Contributed by @arendjr

  • Fix a bug where syntax rules weren't run when pulling the diagnostics. Now Biome will emit more parsing diagnostics,
    e.g.

    check.js:1:17 parse/noDuplicatePrivateClassMembers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      × Duplicate private class member "#foo"
    
      > 1 │ class A { #foo; #foo }
          │                 ^^^^
    
    

    Contributed by @ematipico

  • Fix #1774 by taking into account the option --no-errors-on-unmatched when running the CLI using --changed. Contributed by @antogyn

Enhancements

  • Removed a superfluous diagnostic that was printed during the linting/check phase of a file:

    test.js check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      × The file contains diagnostics that needs to be addressed.
    

    Contributed by @ematipico

  • The command format now emits parsing diagnostics if there are any, and it will terminate with a non-zero exit code. Contributed by @ematipico

Configuration

New features

  • Add the ability to resolve the configuration files defined inside extends from the node_modules/ directory.

    If you want to resolve a configuration file that matches the specifier @org/configs/biome, then your package.json
    file must look this:

    {
      "name": "@org/configs",
      "exports": {
        "./biome": "./biome.json"
      }
    }

    And the biome.json file that "imports" said configuration, will look like this:

    {
      "extends": "@org/configs/biome"
    }

    Read the documentation to better understand how it
    works, expectations and restrictions.

Editors

Bug fixes

  • Fix a regression where ignored files where formatted in the editor. Contributed by @ematipico
  • Fix a bug where syntax rules weren't run when pulling the diagnostics. Now Biome will emit more parsing diagnostics,
    e.g.
    check.js:1:17 parse/noDuplicatePrivateClassMembers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      × Duplicate private class member "#foo"
    
      > 1 │ class A { #foo; #foo }
          │                 ^^^^
    
    
    Contributed by @ematipico

Formatter

New features

  • Biome now allows to format the package.json file. This is now the default behaviour and users can remove their
    workarounds.
    If you rely on other tools to format package.json, you'll have to ignore it via configuration. Contributed by
    @pattrickrice

  • New formatter option attributePosition that have similar behavior as
    Prettier singleAttributePerLine #1706. Contributed by @octoshikari

  • Add partial for .astro files. Biome is able to format the frontmatter of the Astro files. Contributed by @ematipico

    ---
    - statement ( );
    + statement();
    ---
    
    <div></div>
  • Add partial for .vue files. Biome is able to format the script block of Vue files. Contributed by @nhedger

    <script setup lang="ts">
    - statement ( )...
Read more

CLI v1.5.3

22 Jan 11:24
906de83
Compare
Choose a tag to compare

LSP

Bug fixes

  • Fix #1584. Ensure the LSP only registers the formatter once. Contributed by @nhedger

  • Fix #1589. Fix invalid formatting of own line comments when they were at the end of an import/export list. Contributed by @SpanishPear

Configuration

Bug fixes

  • Override correctly the recommended preset (#1349).

    Previously, if unspecified, Biome turned on the recommended preset in overrides.
    This resulted in reporting diagnostics with a severity level set to off.
    This in turn caused Biome to fail.

    Now Biome won't switch on the recommended preset in overrides unless told to do so.

    Contributed by @Conaclos

  • Don't format ignored files that are well-known JSONC files when files.ignoreUnknown is enabled (#1607).

    Previously, Biome always formatted files that are known to be JSONC files (e.g. .eslintrc) when files.ignoreUnknown was enabled.

    Contributed by @Conaclos

Formatter

Bug fixes

  • Fix #1178, where the line ending option wasn't correctly applied. Contributed by @ematipico
  • Fix #1571. Fix invalid formatting of nested multiline comments. Contributed by @ah-yu

Linter

Bug fixes

Parser

Bug fixes

  • Accept the const modifier for type parameter in method type signature (#1624).

    The following code is now correctly parsed:

    type Foo = {
      <const T>();
      method<const T>();
    };

    Contributed by @magic-akari

Website

New

Fixes

New Contributors

Full Changelog: cli/v1.5.2-nightly.91c7730...cli/v1.5.3

CLI v1.5.2

15 Jan 10:12
80bb3d7
Compare
Choose a tag to compare

CLI

Bug fixes

  • Fix #1512 by skipping verbose diagnostics from the count. Contributed by @ematipico

  • Correctly handle cascading include and ignore.

    Previously Biome incorrectly included files that were included at tool level and ignored at global level.
    In the following example, file.js was formatted when it should have been ignored.
    Now, Biome correctly ignores the directory ./src/sub/.

    ❯ tree src
      src
      └── sub
          └── file.js
    
    ❯ cat biome.json
      {
        "files": { "ignore": ["./src/sub/"] },
        "formatter": { "include": ["./src"] }
      }

    Contributed by @Conaclos

  • Don't emit verbose warnings when a protected file is ignored.

    Some files, such as package.json and tsconfig.json, are protected.
    Biome emits a verbose warning when it encounters a protected file.

    Previously, Biome emitted this verbose warning even if the file was ignored by the configuration.
    Now, it doesn't emit verbose warnings for protected files that are ignored.

    Contributed by @Conaclos

  • overrides no longer affect which files are ignored. Contributed by @Conaclos

  • The file biome.json can't be ignored anymore. Contributed by @ematipico

  • Fix #1541 where the content of protected files wasn't returned to stdout. Contributed by @ematipico

  • Don't handle CSS files, the formatter isn't ready yet. Contributed by @ematipico

Configuration

Bug fixes

  • Fix 1440, a case where extends and overrides weren't correctly emitting the final configuration. Contributed by @arendjr

  • Correctly handle include when ignore is set (#1468). Contributed by @Conaclos

    Previously, Biome ignored include if ignore was set.
    Now, Biome check both include and ignore.
    A file is processed if it is included and not ignored.
    If include is not set all files are considered included.

Formatter

Bug fixes

  • Fix placement of comments before * token in generator methods with decorators. #1537 Contributed by @ah-yu

  • Fix #1406. Ensure comments before the async keyword are placed before it. Contributed by @ah-yu

  • Fix #1172. Fix placement of line comment after function expression parentheses, they are now attached to first statement in body. Contributed by @kalleep

  • Fix #1511 that made the JavaScript formatter crash. Contributed @Conaclos

Linter

Enhancements

Bug fixes

  • The fix of useArrowFunction now adds parentheses around the arrow function in more cases where it is needed (#1524).

    A function expression doesn't need parentheses in most expressions where it can appear.
    This is not the case with the arrow function.
    We previously added parentheses when the function appears in a call or member expression.
    We now add parentheses in binary-like expressions and other cases where they are needed, hopefully covering all cases.

    Previously:

    - f = f ?? function() {};
    + f = f ?? () => {};

    Now:

    - f = f ?? function() {};
    + f = f ?? (() => {});

    Contributed by @Conaclos

  • Fix #1514. Fix autofix suggestion to avoid the syntax error in no_useless_fragments. Contributed by @togami2864

What's Changed

Other changes

New Contributors

Full Changelog: cli/v1.5.1...cli/v1.5.2

CLI v1.5.1

10 Jan 13:29
0ed9e3e
Compare
Choose a tag to compare

CLI

Bug fixes

  • The diagnostics files/missingHandler are now shown only when the option --verbose is passed. Contributed by @ematipico
  • The diagnostics for protected files are now shown only when the option --verbose is passed. Contributed by @ematipico
  • Fix #1465, by taking in consideration the workspace folder when matching a pattern. Contributed by @ematipico
  • Fix #1465, by correctly process globs that contain file names. Contributed by @ematipico

Formatter

Bug fixes

  • Fix #1170. Fix placement of comments inside default switch clause. Now all line comments that have a preceding node will keep their position. Contributed by @kalleep

Linter

Bug fixes

  • Fix #1335. noUselessFragments now ignores code action on component props when the fragment is empty. Contributed by @vasucp1207

  • useConsistentArrayType was accidentally placed in the style rule group instead of the nursery group. It is now correctly placed under nursery.

  • Fix #1483. useConsistentArrayType now correctly handles its option. Contributed by @Conaclos

  • Fix #1502. useArrowFunction now correctly handle functions that return a (comma) sequence expression. Contributed by @Conaclos

    Previously the rule made an erroneous suggestion:

    - f(function() { return 0, 1; }, "");
    + f(() => 0, 1, "")

    Now, the rule wraps any comma sequence between parentheses:

    - f(function() { return 0, 1; }, "");
    + f(() => (0, 1), "")

What's Changed

Other changes

New Contributors

Full Changelog: cli/v1.5.0...cli/v1.5.1

CLI v1.5.0

08 Jan 14:47
Compare
Choose a tag to compare

Biome now scores 97% compatibility with Prettier and features more than 190 linter rules.

CLI

New features

  • Biome now shows a diagnostic when it encounters a protected file. Contributed by @ematipico

  • The command biome migrate now updates the $schema if there's an outdated version.

  • The CLI now takes in consideration the .gitignore in the home directory of the user, if it exists. Contributed by @ematipico

  • The biome ci command is now able to print GitHub Workflow Commands when there are diagnostics in our code. Contributed by @nikeee
    This might require setting the proper permissions on your GitHub action:

    permissions:
      pull-requests: write
  • The commands format, lint, check and ci now accept two new arguments: --changed and --since. Use these options with the VCS integration
    is enabled to process only the files that were changed. Contributed by @simonxabris

    biome format --write --changed
  • Introduced a new command called biome explain, which has the capability to display documentation for lint rules. Contributed by @kalleep

  • You can use the command biome explain to print the documentation of lint rules. Contributed by @kalleep

    biome explain noDebugger
    biome explain useAltText
  • You can use the command biome explain to print the directory where daemon logs are stored. Contributed by @ematipico

    biome explain daemon-logs
  • Removed the hard coded limit of 200 printable diagnostics. Contributed by @ematipico

Bug fixes

  • Fix #1247, Biome now prints a warning diagnostic if it encounters files that can't handle. Contributed by @ematipico

    You can ignore unknown file types using the files.ignoreUnknown configuration in biome.json:

    {
      "files": {
        "ignoreUnknown": true
      }
    }

    Or the --files-ignore-unknown CLI option:

    biome format --files-ignore-unknown=true --write .
  • Fix #709 and #805 by correctly parsing .gitignore files. Contributed by @ematipico

  • Fix #1117 by correctly respecting the matching. Contributed by @ematipico

  • Fix #691 and #1190, by correctly apply the configuration when computing overrides configuration. Contributed by @ematipico

Configuration

New features

  • Users can specify git ignore patterns inside ignore and include properties, for example it's possible to allow list globs of files using the ! character:

    {
      "files": {
        "ignore": [
          "node_modules/**",
          "!**/dist/**" // this is now accepted and allow files inside the `dist` folder
        ]
      }
    }

Editors

New features

  • The LSP registers formatting without the need of using dynamic capabilities from the client.

    This brings formatting services to the editors that don't support or have limited support for dynamic capabilities.

Formatter

Bug fixes

  • Fix #1169. Account for escaped strings when computing layout for assignments. Contributed by @kalleep

  • Fix #851. Allow regular function expressions to group and break as call arguments, just like arrow function expressions. #1003 Contributed by @faultyserver

  • Fix #914. Only parenthesize type-casted function expressions as default exports. #1023 Contributed by @faultyserver

  • Fix #1112. Break block bodies in case clauses onto their own lines and preserve trailing fallthrough comments. #1035 Contributed by @faultyserver

  • Fix RemoveSoftLinesBuffer behavior to also removed conditional expanded content, ensuring no accidental, unused line breaks are included #1032 Contributed by @faultyserver

  • Fix #1024. Allow JSX expressions to nestle in arrow chains #1033 Contributed by @faultyserver

  • Fix incorrect breaking on the left side of assignments by always using fluid assignment. #1021 Contributed by @faultyserver

  • Fix breaking strategy for nested object patterns in function parameters #1054 Contributed by @faultyserver

  • Fix over-indention of arrow chain expressions by simplifying the way each chain is grouped #1036, #1136, and #1162 Contributed by @faultyserver.

  • Fix "simple" checks for calls and member expressions to correctly handle array accesses, complex arguments to single-argument function calls, and multiple-argument function calls. #1057 Contributed by @faultyserver

  • Fix text wrapping and empty line handling for JSX Text elements to match Prettier's behavior. #1075 Contributed by @faultyserver

  • Fix leading comments in concisely-printed arrays to prevent unwanted line breaks. #1135 Contributed by @faultyserver

  • Fix best_fitting and interned elements preventing expansion propagation from sibling elements. #1141 Contributed by @faultyserver

  • Fix heuristic for grouping function parameters when type parameters with constraints are present. #1153. Contributed by @faultyserver.

  • Fix binary-ish and type annotation handling for grouping call arguments in function expressions and call signatures. #1152 and #1160 Contributed by @faultyserver

  • Fix handling of nestled JSDoc comments to preserve behavior for overloads. #1195 Contributed by @faultyserver

  • Fix #1208. Fix extraction of inner types when checking for simple type annotations in call arguments. #1195 Contributed by @faultyserver

  • Fix #1220. Avoid duplicating comments in type unions for mapped, empty object, and empty tuple types. #1240 Contributed by @faultyserver

  • Fix #1356. Ensure if_group_fits_on_line content is always written in RemoveSoftLinesBuffers. #1357 Contributed by @faultyserver

  • Fix #1171. Correctly format empty statement with comment inside arrow body when used as single argument in call expression. Contributed by @kalleep

  • Fix #1106. Fix invalid formatting of single bindings when Arrow Parentheses is set to "AsNeeded" and the expression breaks over multiple lines. #1449 Contributed by @faultyserver

Linter

Promoted rules

New rules are incubated in the nursery group.
Once stable, we promote them to a stable group.
The following rules are promoted:

New features

  • Add useExportType that enforces the use of type-only exports for types. Contributed by @Conaclos

      interface A {}
      interface B {}
      class C {}
    
    - export type { A, C }
    + export { type A, C }
    
    - export { type B }
    + export type { B }
  • Add useImportType that enforces the use of type-only imports for types. Contributed by @Conaclos

    - import { A, B } from "./mod.js";
    + import { type A, B } from "mod";
      let a: A;
      const b: B = new B();

    Also, the rule groups type-only imports:

    - import { type A, type B } from "./mod.js";
    + import type { A, B } from "./mod.js";
  • Add useFilenamingConvention, that enforces naming conventions for JavaScript and TypeScript filenames. Contributed by @Conaclos

    By default, the rule requires that a filename be in camelCase, kebab-case, snake_case, or matches the name of an export in the file.
    The rule provides options to restrict the allowed cases.

  • Add useNodejsImportProtocol that enforces the use of the node: protocol when importing...

Read more

Intellij Plugin v0.0.7

07 Dec 18:34
da24940
Compare
Choose a tag to compare

Editors

New features

  • The LSP register formatting without the need of using dynamic capabilities from the client.

Linter

Bug fixes

  • Fix #959. noEmptyInterface no longer reports interface that extends a type and is in an external module. Contributed by @Conaclos

    Empty interface that extends a type are sometimes used to extend an existing interface.
    This is generally used to extend an interface of an external module.

    interface Extension {
      metadata: unknown;
    }
    
    declare module "@external/module" {
      export interface ExistingInterface extends Extension {}
    }
  • Fix #1061. noRedeclare no longer reports overloads of export default function. Contributed by @Conaclos

    The following code is no longer reported:

    export default function(a: boolean): boolean;
    export default function(a: number): number;
    export default function(a: number | boolean): number | boolean {
    	return a;
    }
  • Fix #651, useExhaustiveDependencies no longer reports out of scope dependecies. Contributed by @kalleep

    The following code is no longer reported:

    let outer = false;
    
    const Component = ({}) => {
      useEffect(() => {
        outer = true;
      }, []);
    }
  • Fix #728. useSingleVarDeclarator no longer outputs invalid code. Contributed by @Conaclos

What's Changed

Other changes

New Contributors

Full Changelog: cli/v1.4.1-nightly.bc772a3...lsp-intellij/v0.0.7

CLI v1.4.1

30 Nov 19:48
a887513
Compare
Choose a tag to compare

Biome scores 96% compatibility with Prettier! Read our announcement on our blog.

Editors

  • Fix #933. Some files are properly ignored in the LSP too. E.g. package.json, tsconfig.json, etc.

Formatter

Bug fixes

  • Fix some accidental line breaks when printing array expressions within arrow functions and other long lines #917. Contributed by @faultyserver

  • Match Prettier's breaking strategy for ArrowChain layouts #934. Contributed by @faultyserver

  • Fix double-printing of leading comments in arrow chain expressions #951. Contributed by @faultyserver

Linter

Bug fixes

  • Fix #910, where the rule noSvgWithoutTitle should skip elements that have aria-hidden attributes. Contributed by @vasucp1207

Enhancement

  • Implements #924 and #920. noUselessElse now ignores else clauses that follow at least one if statement that doesn't break early. Contributed by @Conaclos

    For example, the following code is no longer reported by the rule:

    function f(x) {
        if (x < 0) {
          // this `if` doesn't break early.
        } else if (x > 0) {
            return x;
        } else {
            // This `else` block was previously reported as useless.
        }
    }

Bug fixes

Parser

What's Changed

Other changes

  • fix: fix blog list not showing all posts by @Yan-Thomas in #915
  • fix(js_formatter): array printing and grouping in arrows by @faultyserver in #917
  • ci(release_cli): fix homebrew job by @nhedger in #919
  • fix(website): fix title tags by @Yan-Thomas in #925
  • fix: typo by @u-abyss in #929
  • doc(ja): translate How Biome works into Japanese by @Spice-Z in #930
  • doc(ja): translate versioning into Japanese by @yossydev in #906
  • doc(ja): translate Formatter doc into Japanese by @Gumichocopengin8 in #904
  • doc(ja): translate credits into Japanese by @hitohata in #903
  • fix: typo by @gc in #936
  • fix: noSvgWithoutTitle skip on aria-hidden by @vasucp1207 in #928
  • docs(ja): translate Getting Started into Japanese by @Yuiki in #940
  • docs(website): show sponsors on japanese document by @unvalley in #945
  • fix(website): json schema for 1.4.0 by @Conaclos in #948
  • fix(js_formatter): Match Prettier's breaking strategy for ArrowChain layouts by @faultyserver in #934
  • feat(css_parser): CSS Parser pseudo element selector #268 by @denbezrukov in #883
  • fix(js_formatter): Avoid double-printing the first leading comments in arrow chains by @faultyserver in #951
  • fix(package): add ROME MIT license by @Conaclos in #949
  • docs(ja): translate vscode into Japanese by @sakimyto in #938
  • doc(ja): translate continuous-integration into Japanese by @yossydev in #955
  • docs(ja): translate Philosophy into Japanese by @yoshi2no in #944
  • docs(ja): translate Architecture into Japanese by @seo1nk in #912
  • feat(website): Move blog to CC and fix RSS by @Yan-Thomas in #937
  • docs(ja): translate big-projects into Japanese by @u-abyss in #962
  • feat(css_parser): CSS Parser charset #268 by @denbezrukov in #950
  • fix(website): fix fragile blog links by @Yan-Thomas in #965
  • feat(css_parser): CSS Parser color profile at rule #268 by @denbezrukov in #966
  • feat(website): optimize blog images and fix meta/a11y by @Yan-Thomas in #973
  • chore: improve issue templates by @Conaclos in #981

New Contributors

Full Changelog: cli/v1.4.0...cli/v1.4.1

CLI v1.4.0

27 Nov 16:45
889593e
Compare
Choose a tag to compare

Biome scores 96% compatibility with Prettier! Read our announcement on our blog.

CLI

  • Remove the CLI options from the lsp-proxy, as they were never meant to be passed to that command. Contributed by @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 @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 @simonxabris

  • Add option --line-feed to the format command. Contributed by @SuperchupuDev

  • Add option --bracket-same-line to the format command. Contributed by @faultyserve

  • Add option --bracket-spacing to the format command. Contributed by @faultyserve

Bug fixes

  • Fix the command format, now it returns a non-zero exit code when if there pending diffs. Contributed by @ematipico

Configuration

  • Add option formatter.lineFeed. Contributed by @SuperchupuDev
  • Add option javascript.formatter.bracketSameLine. Contributed by @faultyserve
  • Add option javascript.formatter.bracketSpacing. Contributed by @faultyserve

Formatter

New features

  • Add a new option --line-ending. This option allows changing the type of line endings. Contributed by @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. #627. Contributed by @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. #627. Contributed by @faultyserver

Bug fixes

  • Fix #832, the formatter no longer keeps an unnecessary trailing comma in type parameter lists. Contributed by @Conaclos

  • Fix #301, the formatter should not break before the in keyword. Contributed by @ematipico

Linter

Promoted rules

The following rules are now recommended:

The following rules are now deprecated:

New features

Enhancements

Bug fixes

Parser

Bug fixes

  • Fix #846 that erroneously parsed <const T,>() => {} as a JSX tag instead of an arrow function when both TypeScript and JSX are enabled.

VSCode

What's Changed

Other changes

Read more

VSCode Extension v1.7.20231109

09 Nov 06:53
8475169
Compare
Choose a tag to compare
Pre-release

Analyzer

CLI

  • Remove the CLI options from the lsp-proxy, as they were never meant to be passed to that command. Contributed by @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 @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 @simonxabris

Bug fixes

  • Fix the command format, now it returns a non-zero exit code when if there pending diffs. Contributed by @ematipico

Configuration

Editors

Formatter

JavaScript APIs

Linter

Bug fixes

  • Fix #639 by ignoring unused TypeScript's mapped key. Contributed by @Conaclos

  • Fix #565 by handling several infer with the same name in extends clauses of TypeScript's conditional types. Contributed by @Conaclos

  • Fix #653. noUnusedImports now correctly removes the entire line where the unused import is. Contributed by @Conaclos

  • Fix #607 useExhaustiveDependencies, ignore optional chaining, Contributed by @msdlisper

  • Fix #676, by using the correct node for the "noreferrer" when applying the code action. Contributed by @ematipico

Parser

VSCode

What's Changed

Other changes

New Contributors

Full Changelog: cli/v1.3.3...lsp/v1.7.20231109

VSCode Extension v1.6.2

31 Oct 08:24
af24597
Compare
Choose a tag to compare

Analyzer

Bug fixes

CLI

Bug fixes

  • Fix how overrides behave. Now ignore and include apply or not the override pattern, so they override each other.
    Now the options inside overrides override the top-level options.
  • Bootstrap the logger only when needed. Contributed by @ematipico

Editors

Bug fixes

  • Fix #592, by changing binary resolution in the IntelliJ plugin. Contributed by @Joshuabaker2

Formatter

Bug fixes

  • Apply the correct layout when the right hand of an assignment expression is a await expression or a yield expression. Contributed by @ematipico
  • Fix #303, where nested arrow functions didn't break. Contributed by @victor-teles

Linter

Bug fixes

  • Fix #175 which made noRedeclare report index signatures using the name of a variable in the parent scope.

  • Fix #557 which made noUnusedImports report imported types used in typeof expression. Contributed by @Conaclos

  • Fix #576 by removing some erroneous logic in noSelfAssign. Contributed by @ematipico

  • Fix #595 by updating unsafe-apply logic to avoid unexpected errors in noUselessFragments. Contributed by @nissy-dev

  • Fix #591 which made noRedeclare report type parameters with identical names but in different method signatures. Contributed by @Conaclos

  • Support more a11y roles and fix some methods for a11y lint rules Contributed @nissy-dev

  • Fix useExhaustiveDependencies, by removing useContext, useId and useSyncExternalStore from the known hooks. Contributed by @msdlisper

Parser

Enhancements

  • Support RegExp v flag. Contributed by @nissy-dev
  • Improve error messages. Contributed by @ematipico

What's Changed

Other changes

  • ci(release_cli): add homebrew formula bumper by @nhedger in #569
  • docs(website): fix useYield source reference by @unvalley in #583
  • fix: check elseClause inside noUselessLoneBlockStatements by @vasucp1207 in #584
  • docs(lint/useNamingConvention): type prop and method names in camelCase by @Conaclos in #588
  • chore: fix hook linting message grammar by @crutchcorn in #580
  • fix(project): changed structure to correctly emit schema for overrides by @ematipico in #602
  • fix(intellij): binary resolution execution sequence by @Joshuabaker2 in #601
  • refactor(linter-config): remove dead code and deduplicate code by @Conaclos in #612
  • refactor(json_deserialize): improve map_to_* API by @Conaclos in #616
  • refactor(json_deserailize): remove visit_member_name by @Conaclos in #618
  • fix: bug with useContext/useSyncExternalStore (#609) by @msdlisper in #621
  • feat(css_parser): CSS Parser pseudo element selector #268 by @denbezrukov in #600
  • fix(biome_js_parser): report error when using u and v flag at the same time by @nissy-dev in #631
  • ci(release_cli): continue on error when bumping homebrew formula by @nhedger in #637

New Contributors

Full Changelog: cli/v1.3.1...lsp/v1.6.2