github biomejs/biome cli/v1.4.1-nightly.efc084c
CLI v1.4.1-nightly.efc084c

Analyzer

CLI

New features

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

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

    biome format --write --changed

Bug fixes

  • Fix #709, by correctly parsing allow list patterns in .gitignore files. Contributed by @ematipico
  • Fix #805, by correctly parsing these kind of patterns. Contributed by @ematipico
  • Fix #1117 by correctly respecting the matching. Contributed by @ematipico
  • Fix #1247, Biome now prints a warning diagnostic if it encounters files that can't handle. 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 list files inside the `dist` folder
        ]
      }
    }

Editors

New features

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

Formatter

  • Fix #1169. Account for escaped strings when computing layout for assignments. Contributed by @kalleep
  • Fix #1220. Avoid duplicating comments in type unions for mapped, empty object, and empty tuple types. #1240 Contributed by @faultyserver

JavaScript APIs

Linter

New features

  • Add useExportType that enforces the use of type-only exports for names that are only 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 noNodejsModules, that disallows the use of Node.js modules.

  • Add useNodeImportProtocol that forces the use of the node: protocol when importing Node.js modules. Contributed by @2-NOW

  • Add noInvalidUseBeforeDeclaration that reports variables and function parameters used before their declaration. Contributed by @Conaclos

    function f() {
      console.log(c); // Use of `c` before its declaration.
      const c = 0;
    }

Enhancements

Bug fixes

  • Fix #959. noEmptyInterface no longer reports interface that extends a type and is in an external module or a global declaration. 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 dependencies. Contributed by @kalleep

    The following code is no longer reported:

    let outer = false;
    
    const Component = ({}) => {
      useEffect(() => {
        outer = true;
      }, []);
    }
  • Fix #1191. noUselessElse now preserve comments of the else clause. Contributed by @Conaclos

    For example, the rule suggested the following fix:

      function f(x) {
        if (x <0) {
          return 0;
        }
    -   // Comment
    -   else {
          return x;
    -   }
      }

    Now the rule suggests a fix that preserves the comment of the else clause:

      function f(x) {
        if (x <0) {
          return 0;
        }
        // Comment
    -   else {
          return x;
    -   }
      }
  • Fix #728. useSingleVarDeclarator no longer outputs invalid code. Contributed by @Conaclos

  • Fix #1167. [useValidAriaProps] no longer reports aria-atomic as invalid. Contributed by @unvalley

Parser

  • Fix #1077, fix issues when parsing conditional expression where parenthesized identifier was being parsed as arrow expression. Contributed by @kalleep

These cases are now properly parsed:

javascript:

  a ? (b) : a => {};

typescript:

  a ? (b) : a => {};

jsx:

  bar ? (foo) : (<a>{() => {}}</a>);

What's Changed

Other changes

  • refactor(js_grammar): improve representation of imports by @Conaclos in #1163
  • chore: broken links in credits.mdx by @ElianCodes in #1196
  • docs: translate README.md into Japanese by @K-tecchan in #1174
  • docs(vscode.mdx): translate vscode.mdx to pt-br by @ImBIOS in #1181
  • fix(js_formatter): handle nestling comments to support jsdoc overloads by @faultyserver in #1195
  • fix(js_formatter): fix handling ts references from array types in argument grouping by @faultyserver in #1212
  • chore: governance and philosophy by @ematipico in #1203
  • chore: add documentation issue template by @nhedger in #1217
  • chore: update documentation language labels by @nhedger in #1233
  • chore: label doc issue on reopen by @nhedger in #1235
  • chore: sync documentation language labels by @nhedger in #1236
  • docs: translate README.md to pt-br by @ImBIOS in #1211
  • docs: translate internals/architecture.mdx to pt-br by @ImBIOS in #1209
  • docs: translate formatter/differences-with-prettier.md to pt-br by @ImBIOS in #1210
  • docs: update CONTRIBUTING.md with translations section by @ImBIOS in #1182
  • fix(cli): fix traversal of relative paths as inputs by @faultyserver in #1244
  • feat(parse/noTypeOnlyImportAttributes): report type-only imports/exports with attributes by @Conaclos in #1239
  • feat(css_formatter): Bootstrap the CSS Formatter! by @faultyserver in #1207
  • feat(lint/noNodejsModules): add rule by @anonrig in #1121
  • feat(analyzer): implement useNodeImportProtocol rule by @2-NOW in #1131
  • feat(css_parser): CSS Parse media at rule #1049 by @denbezrukov in #1242
  • website: move netlify badge to home by @ematipico in #1266
  • refcator(linter): don't require rule config to implement Bpaf's Parser trait by @Conaclos in #1267
  • docs(website): fix italic text for ja docs by @MH4GF in #1272

New Contributors

Full Changelog: cli/v1.4.1-nightly.e087146...cli/v1.4.1-nightly.efc084c

Don't miss a new biome release

NewReleases is sending notifications on new releases.