Skip to content

Fix dart analyze and format on 3.7.0 - #2513

Merged
nex3 merged 13 commits into
sass:mainfrom
ntkme:fix-dart-analyze
Feb 13, 2025
Merged

nex3 merged 13 commits into
sass:mainfrom
ntkme:fix-dart-analyze

Conversation

@ntkme

@ntkme ntkme commented Feb 12, 2025 •

Copy link
Copy Markdown
Contributor

This PR fixes the following:

warning • lib/src/deprecation.dart:185:43 • A value for optional parameter 'description' isn't ever given. Try removing the unused parameter. • unused_element_parameter
   info • lib/sass.dart:6:9 • Library names are not necessary. Remove the library name. • unnecessary_library_name
   info • pkg/sass_api/lib/sass_api.dart:6:9 • Library names are not necessary. Remove the library name. • unnecessary_library_name

There are a few deprecated_member_use on dart:js_util, but migrate to dart:js is not a small task so that I'm not touching those for now.


For dart format this PR adds dart pub get before running dart format in CI to make sure the language version is correctly detected and a consistent format is produced.

@ntkme ntkme changed the title Fix dart analyze issues on 3.7.0 Fix dart analyze and format on 3.7.0 Feb 12, 2025
@ntkme
ntkme force-pushed the fix-dart-analyze branch 2 times, most recently from 05c6f80 to 788c916 Compare February 12, 2025 20:47
@ntkme

ntkme commented Feb 12, 2025

Copy link
Copy Markdown
Contributor Author

@nex3 I just found out that with dart 3.7, if you start with a clean clone of the repo (or run git clean -dffx), it formats in one way. Then, after running dart pub get, it formats in another way...

@ntkme

ntkme commented Feb 12, 2025

Copy link
Copy Markdown
Contributor Author

It's mentioned in the changelog: https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md#dart-format

In order to correctly determine the language version of each file it formats, dart format (like other dart commands) looks for a package_config.json file surrounding the files being formatted. This means that you need to run dart pub get before formatting code in your package. If you have format checks in your continuous integration server, you'll want to make sure it runs dart pub get too.

Comment thread tool/grind.dart
@nex3
nex3 merged commit 7ab44ef into sass:main Feb 13, 2025
@ntkme
ntkme deleted the fix-dart-analyze branch February 13, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants