github biomejs/biome @biomejs/biome@2.1.2
Biome CLI v2.1.2

2.1.2

Patch Changes

  • #6865 b35bf64 Thanks @denbezrukov! - Fix #6485: Handle multiple semicolons correctly in blocks (#6485)

    div {
      box-sizing: border-box;
      color: red;
    }
  • #6798 3579ffa Thanks @dyc3! - Fixed #6762, Biome now knows that ~/.config/zed/settings.json and ~/.config/Code/User/settings.json allows comments by default.

  • #6839 4cd62d8 Thanks @ematipico! - Fixed #6838, where the Biome File Watcher incorrectly watched and stored ignored files, causing possible memory leaks when those files were dynamically created (e.g. built files).

  • #6879 0059cd9 Thanks @denbezrukov! - Refactor: remove one level of indirection for CSS declarations with semicolon
    Previously, accessing a declaration from a list required an extra step:

    item
    .as_any_css_declaration_with_semicolon()
    .as_css_declaration_with_semicolon()

    Now, it can be done directly with:

    item.as_css_declaration_with_semicolon()
  • #6839 4cd62d8 Thanks @ematipico! - Fixed a bug where the Biome Language Server didn't correctly ignore specific files when vcs.useIgnoreFile is set to true.

  • #6884 5ff50f8 Thanks @arendjr! - Improved the performance of noImportCycles by ~30%.

  • #6903 241dd9e Thanks @arendjr! - Fixed #6829: Fixed a false positive reported by useImportExtensions when importing a .js file that had a matching .d.ts file in the same folder.

  • #6846 446112e Thanks @darricheng! - Fixed an issue where biome was using the wrong string quotes when the classes string has quotes, resulting in invalid code after applying the fix.

  • #6823 eebc48e Thanks @arendjr! - Improved #6172: Optimised the way function arguments are stored in Biome's type inference. This led to about 10% performance improvement in RedisCommander.d.ts and about 2% on @next/font type definitions.

  • #6878 3402976 Thanks @ematipico! - Fixed a bug where the Biome Language Server would apply an unsafe fix when using the code action quickfix.biome.

    Now Biome no longer applies an unsafe code fix when using the code action quickfix.biome.

  • #6794 4d5fc0e Thanks @vladimir-ivanov! - Fixed #6719: The noInvalidUseBeforeDeclaration rule covers additional use cases.

    Examples:

    type Bar = { [BAR]: true };
    const BAR = "bar";
    interface Bar {
      child: { grandChild: { [BAR]: typeof BAR; enumFoo: EnumFoo } };
    }
    const BAR = "bar";
    enum EnumFoo {
      BAR = "bar",
    }
  • #6863 531e97e Thanks @dyc3! - Biome now considers whether the linter is enabled when figuring out how the project should be scanned. Resolves #6815.

  • #6832 bdbc2b1 Thanks @togami2864! - Fixed #6165: Fixed false negative in noUnusedPrivateClassMembers rule when checking member usage in classes

  • #6839 4cd62d8 Thanks @ematipico! - Fixed a bug where the root ignore file wasn't correctly loaded during the scanning phase, causing false positives and incorrect expectations among users.

    Now, when using vcs.useIgnoreFile, the the globs specified in the ignore file from the project root will have the same semantics as the files.includes setting of the root configuration.

    Refer to the relative web page to understand how they work.

  • #6898 5beb024 Thanks @arendjr! - Fixed #6891: Improved type inference for array indices.

    Example:

    const numbers: number[];
    numbers[42]; // This now infers to `number | undefined`.
  • #6809 8192451 Thanks @arendjr! - Fixed #6796: Fixed a false positive that happened in noFloatingPromises when calling functions that were declared as part of for ... of syntax inside async functions.

    Instead, the variables declared inside for ... of loops are now correctly
    inferred if the expression being iterated evaluates to an Array (support for other iterables will follow later).

    Invalid example

    const txStatements: Array<(tx) => Promise<any>> = [];
    
    db.transaction((tx: any) => {
      for (const stmt of txStatements) {
        // We correctly flag this resolves to a `Promise`:
        stmt(tx);
      }
    });

    Valid example

    async function valid(db) {
      const txStatements: Array<(tx: any) => void> = [(tx) => tx.insert().run()];
    
      db.transaction((tx: any) => {
        for (const stmt of txStatements) {
          // We don't flag a false positive here anymore:
          stmt(tx);
        }
      });
    }
  • #6757 13a0818 Thanks @mdevils! - Added the rule noVueReservedProps, resolves #6309.

    It prevents the use of reserved Vue prop names such as key and ref which can cause conflicts and unexpected behavior in Vue components.

    Invalid example
    import { defineComponent } from "vue";
    
    export default defineComponent({
      props: ["ref", "key", "foo"],
    });
    <script setup>
    defineProps({
      ref: String,
      key: String,
      foo: String,
    });
    </script>
    Valid examples
    import { defineComponent } from "vue";
    
    export default defineComponent({
      props: ["foo"],
    });
    <script setup>
    defineProps({ foo: String });
    </script>
  • #6840 1a57b51 Thanks @denbezrukov! - Allow multiple identifiers in ::part() pseudo-element selector.

    ::part(first second) {
    }
  • #6845 4fd44ec Thanks @arendjr! - Fixed #6510: The scanner no longer shows diagnostics on inaccessible files unless --verbose is used.

  • #6844 b7e2d4d Thanks @sterliakov! - Fixed #6837: Fixed regression with multiple consecutive line suppression comments using instances (like // biome-ignore lint/correctness/useExhaustiveDependencies(depName): reason).

  • #6818 5f3f5a6 Thanks @siketyan! - Fixed an issue where textDocument/codeAction in the LSP could respond with outdated text edits after the workspace watcher observed outdated changes to the file.

  • #6804 3e6ab16 Thanks @arendjr! - noFloatingPromises will no longer suggest to add await keyword inside synchronous callbacks nested inside async functions.

  • #6901 c9e969a Thanks @arendjr! - Fixed #6777: Fixed type inference handling of this to avoid infinite recursion.

    Thanks to @sterliakov for the thorough investigation!

  • #6855 d1581c7 Thanks @vladimir-ivanov! - Fixed #6775: useReadonlyClassProperties now also captures mutations inside function arguments.

    Example:

    class Counter {
      private counter: number;
      count() {
        console.log(this.counter++);
        const counterString = `${this.counter++}`;
      }
    }
  • #6839 4cd62d8 Thanks @ematipico! - Fixed a bug where Biome didn't throw any error when vcs.useIgnoreFile is set to true, and there wasn't any ignore file read. Now Biome correctly throws an error if no ignore files are found.

  • #6911 6d68074 Thanks @arendjr! - Fixed #6838: Reduce resource consumption in the Biome Language Server by using non-recursive filesystem watchers instead of recursive ones.

    Watchers are responsible for notifying Biome of changes to files in the filesystem. We used to set up a single recursive watcher, but that meant that Biome would receive filesystem notifications for all files in your project, even for ignored folders such as build/ or dist/ folders.

    With this patch, we set up non-recursive watchers only for the folders that are relevant to a project.

    Related to this, we also solved an issue where incoming notifications were incorrectly filtered, causing ignored files to be processed and stored in our module graph anyway.

What's Changed

  • chore: check milestone before releasing by @arendjr in #6791
  • chore: add tracing span for open_file_internal() by @arendjr in #6803
  • fix(core): correctly identify sync callbacks inside async functions by @arendjr in #6804
  • fix(core): do not update the opened document when change observed by the watcher by @siketyan in #6818
  • feat(html/parser): text expressions by @ematipico in #6802
  • feat(lint): implement noVueReservedProps rule by @mdevils in #6757
  • ci: add a job for linting markdown files by @dyc3 in #6825
  • perf: faster function parameters in inference by @arendjr in #6823
  • fix(core): infer for-of and for-in loop variables by @arendjr in #6809
  • chore: fix typo by @nhedger in #6834
  • fix(noUnusedPrivateClassMembers): improve member usage checks in the class by @togami2864 in #6832
  • fix(core): silence diagnostics in scanner by @arendjr in #6845
  • feat: add global vscode and zed settings file to well known files by @dyc3 in #6798
  • fix(css_parser): support a list of identifiers in ::part() pseudo-element selector by @denbezrukov in #6840
  • fix(biome_js_analyze): fixed noInvalidUseBeforeDeclaration false positives by @vladimir-ivanov in #6794
  • fix: classes with single quotes in functions should use double quotes by @darricheng in #6846
  • chore: fix just new* commands by @mdevils in #6853
  • chore: fix noVueReservedProps changeset by @mdevils in #6858
  • chore: remove platinum sponsor by @ematipico in #6854
  • chore(deps): update github-actions by @renovate[bot] in #6869
  • chore(deps): update dependency eslint to v9.31.0 by @renovate[bot] in #6868
  • chore(deps): update dependency @types/node to v22.16.3 by @renovate[bot] in #6866
  • chore(deps): update dependency @types/node to v22.16.3 by @renovate[bot] in #6867
  • chore(deps): update typescript-eslint monorepo to v8.36.0 by @renovate[bot] in #6873
  • feat(cli): consider configuration when selecting ScanKind by @dyc3 in #6863
  • docs(noImportCycles): add note about computation cost by @dyc3 in #6864
  • fix(css_parser): handle multiple semicolons correctly in blocks (#6485) by @denbezrukov in #6865
  • fix(deps): update dependency prettier to v3.6.2 by @renovate[bot] in #6874
  • chore(deps): update rust crate tokio to 1.46.1 by @renovate[bot] in #6871
  • chore(deps): update rust crate criterion to v3 by @renovate[bot] in #6876
  • fix(deps): update rust crates by @renovate[bot] in #6875
  • fix(lsp): skip unsafe fixes with quick fixes by @ematipico in #6878
  • perf: optimise noImportCycles by @arendjr in #6884
  • refactor(css_parser): flatten AnyCssDeclarationWithSemicolon (#6912) by @denbezrukov in #6879
  • feat(biome_js_analyze): added support for call expressions arguments by @vladimir-ivanov in #6855
  • fix(core): scanner ignores files inside VCS by @ematipico in #6839
  • fix(biome_analyze): restore support for multiple consecutive suppression comments with rule instances. by @sterliakov in #6844
  • refactor: make Watcher aware of ScanKind by @arendjr in #6842
  • fix(core): infer array indices by @arendjr in #6898
  • fix(core): fix type inference of this by @arendjr in #6901
  • fix(linter): fix false positive with .d.ts files in useImportExtensions by @arendjr in #6903
  • ci: release by @github-actions[bot] in #6807
  • Revert "ci: release" by @ematipico in #6908
  • fix(cli): apply --assist-enabled by @ematipico in #6912
  • fix(core): use non-recursive watchers by @arendjr in #6911
  • feat(yaml_parser): parse block sequence by @vohoanglong0107 in #6727
  • feat(linter): add excludedComponents option to useUniqueElementIds by @sterliakov in #6723
  • ci: release by @github-actions[bot] in #6909

New Contributors

Full Changelog: https://github.com/biomejs/biome/compare/@biomejs/js-api@2.0.3...@biomejs/biome@2.1.2

Don't miss a new biome release

NewReleases is sending notifications on new releases.