# Upgrading to saropa_lints v7

> **7.x was retracted.** It required analyzer 10 and did not work in Flutter projects (Flutter SDK pins meta 1.17.0). Use **saropa_lints 8.0.0** for Flutter and Dart projects; 8.0.0 includes the same rules and fixes as 7.x while staying on analyzer 9. This guide is for reference only (it describes the retracted 7.x line).

v7 upgrades to the **analyzer 10** API. It is a breaking release for dependency constraints and config key format.

## Requirements

- **Dart SDK:** 3.9 or later.
- **Analyzer:** 10.x only. If your project must stay on analyzer 9.x, use **saropa_lints 6.2.2** (the last release compatible with analyzer &lt; v10).

### Why v7 isn’t available in Flutter projects yet

Analyzer 10 (and therefore saropa_lints 7.x) requires **meta ^1.18.0**. The Flutter SDK pins **meta** to **1.17.0** in its own `pubspec.yaml`, so any Flutter app or package is constrained to that version and the dependency solver will not select analyzer 10+. This is a Flutter SDK constraint, not a limitation of analyzer 10. For Flutter projects, stay on **saropa_lints 6.2.2** until the Flutter SDK bumps its meta constraint to 1.18+.

## Breaking changes

### 1. Dependencies

Update `pubspec.yaml`:

```yaml
dev_dependencies:
  saropa_lints: ^7.0.0
```

The package brings in `analyzer: ^10.0.0`, `analysis_server_plugin: ^0.3.10`, and `analyzer_plugin: ^0.14.0`. Resolve any version conflicts with other dev_dependencies that pin analyzer to 9.x.

### 2. Config keyed by lowerCaseName

Rule names in config and in ignore comments now use the analyzer’s **lowerCaseName** (all-lowercase identifier), not the previous mixed-case `name`.

- In **analysis_options.yaml**: severity overrides, exclude lists, and disabled rules must use the lowercased name.  
  Example: `prefer_debugprint` instead of `prefer_debugPrint`, `avoid_empty_else` (unchanged).
- In **ignore comments**: `// ignore: prefer_debugprint` (not `prefer_debugPrint`).

Search your config and code for rule names that contained uppercase letters and replace them with the lowerCaseName (e.g. run analyze and use any reported “unknown rule” or fix the name to match the new identifier).

### 3. Analyzer 10

This release is built and tested against analyzer 10.x. We do not support analyzer 9.x in v7. For analyzer &lt; v10, remain on **saropa_lints 6.2.2**.

## After upgrading

1. Run `dart pub get`.
2. Run **`dart run saropa_lints:init`** (or `dart run saropa_lints init`) to migrate existing config:
   - Rule names in your `analysis_options.yaml` (USER CUSTOMIZATIONS and tier sections) are normalized to lowerCaseName. Init reports how many were updated.
   - Pre-flight checks warn if Dart SDK &lt; 3.9 when using v7.
3. Run `dart analyze` and fix any new issues (e.g. rule renames in config).
4. Update `// ignore:` comments that reference rule names to use lowerCaseName (e.g. `prefer_debugprint`).
