github biomejs/biome cli/v1.9.5-nightly.4713c52
CLI v1.9.5-nightly.4713c52

pre-release24 days ago

Analyzer

Bug fixes

  • Fix CSS parser case error, @-moz-document url-prefix(https://example.com) and @-moz-document domain(example.com) are now valid. Contributed by @eryue0220
  • Fix #4258, where fixed css parse error with @-moz-document url-prefix(). Contributed by @eryue0220

CLI

Bug fixes

  • biome migrate eslint now correctly resolves scoped package named eslint-config with a path.
    Contributed by @Conaclos

Linter

New features

  • Add noUselessUndefined. Contributed by @unvalley

  • useFilenamingConvention accepts a new option match (#4105).

    You can now validate filenames with a regular expression.
    For instance, you can allow filenames to start with %:

    {
      "linter": {
        "rules": {
          "style": {
            "useFilenamingConvention": {
              "level": "warn",
              "options": {
                  "match": "%?(.+?)[.](.+)",
                  "filenameCases": ["camelCase"]
              }
            }
          }
        }
      }
    }

    If the regular expression captures strings, the first capture is considered to be the name of the file, and the second one to be the extensions (dot-separated values).
    The name of the file and the extensions are checked against filenameCases.
    Given the previous configuration, the filename %index.d.ts is valid because the first capture index is in camelCase and the second capture d.ts include dot-separated values in lowercase.
    On the other hand, %Index.d.ts is not valid because the first capture Index is in PascalCase.

    Note that specifying match disallows any exceptions that are handled by the rule by default.
    For example, the previous configuration doesn't allow filenames to be prefixed with underscores,
    a period or a plus sign.
    You need to include them in the regular expression if you still want to allow these exceptions.

    Contributed by @Conaclos

  • useFilenamingConvention and useNamingConvention match options now accept case-insensitive and case-sensitive groups.

    By default, the regular expression in match is case-sensitive.
    You can now make it case-insensitive by using a case-insensitive group (?i:).
    For example, the regular expression (?i:a) matches a and A.

    Contributed by @Conaclos

Enhancements

  • useExportType and useImportType now ignore TypeScript declaration files (#4416). Contributed by @Conaclos

  • useArrayLiterals now provides a code fix.

    - const xs = new Array();
    + const xs = [];

    The code fix is currently marked as unsafe.
    We plan to make it safe in a future release of Biome.

    Contributed by @Conaclos

Bug fixes

  • useArrayLiterals now reports all expressions using the Array constructors.

    Previously, the rule reported only use of the Array constructor in expressions statements.

    // This was reported
    new Array();
    // This was not reported
    const xs = new Array();

    Contributed by @Conaclos

  • Fix #4323, where lint/a11y/useSemanticElement accidentally showed recommendations for role="searchbox" instead of role="search"

Parser

Bug fixes

  • Fix #4317, setter parameter can contain a trailing comma, the following example will now parsed correctly:

    export class DummyClass {
      set input(
        value: string,
      ) {}
    }

    Contributed by @fireairforce

  • Fix #3836, css parser allow multiple semicolons after a declaration, the following example will now parsed correctly:

    .foo {
      color: red;;
    }

    Contributed by @fireairforce

  • Fix #342, js parser handle unterminated JSX_STRING_LITERAL properly

    function Comp() {
      return (
          <a rel="
  • Fix #342, js parser is no longer progressing for an invalid object
    member name:

    ({
      params: { [paramName: string]: number } = {}
    })

    Contributed by @denbezrukov

What's Changed

Other changes

New Contributors

Full Changelog: cli/v1.9.5-nightly.92879ae...cli/v1.9.5-nightly.4713c52

Don't miss a new biome release

NewReleases is sending notifications on new releases.