Skip to content

v5.0.0

Compare
Choose a tag to compare
@vercel-release-bot vercel-release-bot released this 29 Aug 07:20
· 37 commits to main since this release

5.0.0 (2023-08-29)

Features

  • eslint: change config for import/no-extraneous-dependencies (b81ebaa), closes #42
  • eslint: enable @typescript-eslint/require-array-sort-compare (c55c6fc), closes #61
  • eslint: enable allowExpressions in @typescript-eslint/explicit-function-return-type (6b4214f), closes #51
  • eslint: enable eslint-comments/require-description (ec761d9), closes #26
  • eslint: enable react/no-unknown-property (2a4bd0e), closes #52
  • eslint: introduce from jest-react config (8f612e0)
  • eslint: introduce rules from playwright/recommended (85f8b18)
  • eslint: update to ESLint 8.48.0 (dac7a98)
  • eslint: upgrade @typescript-eslint/* and recommended configs (8c4c673), closes #66
  • eslint: upgrade dependencies (8850581)
  • prettier: upgrade to 3.x (f1346cd), closes #65

BREAKING CHANGES

  • eslint: A compare function is now required when calling sort on non-string arrays. This change applies to TypeScript only.
  • eslint: Types are no longer required in expressions (callbacks), as the parent will flag unexpected return types.
  • eslint: ESLint disable directives (comments) now require a description. An example migration script is available below.
  • eslint: import/no-extraneous-dependencies now checks internal modules and type-only imports.
  • eslint: react/no-unknown-property has been enabled as it provides a useful auto-fix for SVG properties.
  • eslint: Upgrading to @typescript-eslint/*@6.x may have have enabled additional rules.
  • eslint: Rules for @testing-library/react have been moved to a new jest-react config, which extends the jest config.
  • eslint: Rules were enabled to align with the recommended rules from eslint-plugin-playwright.
  • eslint: ESLint 8.48.0 is now the minimum supported version.
  • prettier: Prettier 3.0 is now the minimum supported version.

Migrations

For eslint-comments/require-description, we've created this example script - which you can modify. It appends a placeholder comment to eslint-disable directives without comments.

#!/bin/bash

# find all .js files in the current directory and all subdirectories
find . -type f \( -name '*.js' -o -name '*.ts' \) ! -path "*/node_modules/*" | while read file
do
    ### Use sed to modify strings
    sed -i '' -E '/--/!s|^( *// eslint-disable.*)$|\1 -- [@vercel/style-guide@5 migration]|' "$file"
done

Co-authored-by: Vu Van Dung me@joulev.dev