From 87c2a6601f07995eb2d1bc1e0121e837a2ee4090 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 25 Sep 2024 11:40:14 -0500
Subject: [PATCH 01/15] Bump github/codeql-action from 3.26.8 to 3.26.9 (#6107)
Bumps [github/codeql-action](https://github.com/github/codeql-action)
from 3.26.8 to 3.26.9.
Changelog
Sourced from github/codeql-action's
changelog.
CodeQL Action Changelog
See the releases
page for the relevant changes to the CodeQL CLI and language
packs.
Note that the only difference between v2
and
v3
of the CodeQL Action is the node version they support,
with v3
running on node 20 while we continue to release
v2
to support running on node 16. For example
3.22.11
was the first v3
release and is
functionally identical to 2.22.11
. This approach ensures an
easy way to track exactly which features are included in different
versions, indicated by the minor and patch version numbers.
[UNRELEASED]
No user facing changes.
3.26.9 - 24 Sep 2024
No user facing changes.
3.26.8 - 19 Sep 2024
- Update default CodeQL bundle version to 2.19.0. #2483
3.26.7 - 13 Sep 2024
- Update default CodeQL bundle version to 2.18.4. #2471
3.26.6 - 29 Aug 2024
- Update default CodeQL bundle version to 2.18.3. #2449
3.26.5 - 23 Aug 2024
- Fix an issue where the
csrutil
system call used for
telemetry would fail on MacOS ARM machines with System Integrity
Protection disabled. #2441
3.26.4 - 21 Aug 2024
- Deprecation: The
add-snippets
input on the
analyze
Action is deprecated and will be removed in the
first release in August 2025. #2436
- Fix an issue where the disk usage system call used for telemetry
would fail on MacOS ARM machines with System Integrity Protection
disabled, and then surface a warning. The system call is now disabled
for these machines. #2434
3.26.3 - 19 Aug 2024
- Fix an issue where the CodeQL Action could not write diagnostic
messages on Windows. This issue did not impact analysis quality. #2430
3.26.2 - 14 Aug 2024
- Update default CodeQL bundle version to 2.18.2. #2417
3.26.1 - 13 Aug 2024
No user facing changes.
3.26.0 - 06 Aug 2024
- Deprecation: Swift analysis on Ubuntu runner images is no
longer supported. Please migrate to a macOS runner if this affects you.
#2403
... (truncated)
Commits
461ef6c
Merge pull request #2503
from github/update-v3.26.9-f861efb2b
00b1146
Update changelog for v3.26.9
f861efb
Merge pull request #2498
from github/dependabot/npm_and_yarn/npm-9874b37b58
426821d
Merge pull request #2485
from github/dependabot/github_actions/actions-a88a8c...
07e8133
Merge pull request #2501
from github/henrymercer/missing-autobuild-config-error
e0a151e
Fix inconsistency in autobuild error tracking
6b0ce4e
revert eslint-plugin-import to 2.29.1
07fd497
Merge branch 'main' into
dependabot/github_actions/actions-a88a8c5a24
2cddcb1
Merge pull request #2499
from github/aeisenberg/no-upload-sarif
6225a95
Don't upload during cancelled jobs
- Additional commits viewable in compare
view
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=3.26.8&new-version=3.26.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 704d3bcfec..64077a64f2 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -33,7 +33,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3
+ uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@294a9d92911152fe08befb9ec03e240add280cb3
+ uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3
+ uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index ab10453f91..c6b769ca8b 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -49,6 +49,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3
+ uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628
with:
sarif_file: results.sarif
From 88131c92836621a4049fd34496b9f6ae1a18c76a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 26 Sep 2024 06:23:41 -0500
Subject: [PATCH 02/15] Bump actions/checkout from 4.1.7 to 4.2.0 (#6109)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7
to 4.2.0.
Release notes
Sourced from actions/checkout's
releases.
v4.2.0
What's Changed
New Contributors
Full Changelog: https://github.com/actions/checkout/compare/v4.1.7...v4.2.0
Changelog
Sourced from actions/checkout's
changelog.
Changelog
v4.2.0
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.0
v3.6.0
... (truncated)
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.7&new-version=4.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 2 +-
.github/workflows/scorecards-analysis.yml | 2 +-
.github/workflows/test.yml | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 64077a64f2..b0b21e4474 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index c6b769ca8b..6871c870c5 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -21,7 +21,7 @@ jobs:
steps:
- name: "Checkout code"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
persist-credentials: false
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 777603a230..3e5ed51cd4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -37,7 +37,7 @@ jobs:
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
submodules: recursive
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
@@ -56,7 +56,7 @@ jobs:
name: Check if code excerpts are up to date
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
submodules: recursive
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
@@ -71,7 +71,7 @@ jobs:
name: Build site and check links
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
submodules: recursive
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
@@ -97,7 +97,7 @@ jobs:
name: Check if text can be replaced with site variables
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
submodules: recursive
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
@@ -112,7 +112,7 @@ jobs:
name: Validate Firebase configuration
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
with:
submodules: recursive
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
From f3783dcd6bb40685f108e4a2a88ccd79b60fb6c8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 26 Sep 2024 06:26:33 -0500
Subject: [PATCH 03/15] Bump shiki from 1.18.0 to 1.19.0 (#6110)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki)
from 1.18.0 to 1.19.0.
Release notes
Sourced from shiki's
releases.
v1.19.0
🚀 Features
Commits
9444b61
chore: release v1.19.0
4e59b65
feat: introduce warning system for deprecated API (#788)
85a4ff9
feat(core): support object style htmlStyle
in themed token,
support new `ht...
- See full diff in compare
view
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shiki&package-manager=npm_and_yarn&previous-version=1.18.0&new-version=1.19.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 52 +++++++++++++++++++++++++-------------------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/package.json b/package.json
index a2267298f3..e6459c384c 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,6 @@
"markdown-it-container": "^4.0.0",
"markdown-it-deflist": "^3.0.0",
"sass": "^1.79.3",
- "shiki": "^1.18.0"
+ "shiki": "^1.19.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 061d8f616f..67cb9b0407 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,8 +55,8 @@ importers:
specifier: ^1.79.3
version: 1.79.3
shiki:
- specifier: ^1.18.0
- version: 1.18.0
+ specifier: ^1.19.0
+ version: 1.19.0
packages:
@@ -251,17 +251,17 @@ packages:
'@protobufjs/utf8@1.1.0':
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
- '@shikijs/core@1.18.0':
- resolution: {integrity: sha512-VK4BNVCd2leY62Nm2JjyxtRLkyrZT/tv104O81eyaCjHq4Adceq2uJVFJJAIof6lT1mBwZrEo2qT/T+grv3MQQ==}
+ '@shikijs/core@1.19.0':
+ resolution: {integrity: sha512-314J5MPdS1wzfjuD856MXvbAI2wN03ofMnUGkZ5ZDBOza/d38paLwd+YVyuKrrjxJ4hfPMjc4tRmPkXd6UDMPQ==}
- '@shikijs/engine-javascript@1.18.0':
- resolution: {integrity: sha512-qoP/aO/ATNwYAUw1YMdaip/YVEstMZEgrwhePm83Ll9OeQPuxDZd48szZR8oSQNQBT8m8UlWxZv8EA3lFuyI5A==}
+ '@shikijs/engine-javascript@1.19.0':
+ resolution: {integrity: sha512-D1sioU61n7fLWfDzTC9JNS19zEYZMr7qxkSVzv6ziEWDxnwzy2PvYoKPedJV4qUf+2VnrYPSaArDz2W0XgGB7A==}
- '@shikijs/engine-oniguruma@1.18.0':
- resolution: {integrity: sha512-B9u0ZKI/cud+TcmF8Chyh+R4V5qQVvyDOqXC2l2a4x73PBSBc6sZ0JRAX3eqyJswqir6ktwApUUGBYePdKnMJg==}
+ '@shikijs/engine-oniguruma@1.19.0':
+ resolution: {integrity: sha512-/JxwIefNVLGB4EmpB8i6P4JB/oVYRuzSixbqvx7m6iPW0lQ1T97c/0wmA+JlKbngEiExckSuPwa48fajlShB7A==}
- '@shikijs/types@1.18.0':
- resolution: {integrity: sha512-O9N36UEaGGrxv1yUrN2nye7gDLG5Uq0/c1LyfmxsvzNPqlHzWo9DI0A4+fhW2y3bGKuQu/fwS7EPdKJJCowcVA==}
+ '@shikijs/types@1.19.0':
+ resolution: {integrity: sha512-NZvVp3k1bP4MTRUbmnkGhYzPdoNMjNLSAwczMRUbtUl4oj2LlNRNbwERyeIyJt56Ac9fvPVZ2nn13OXk86E5UQ==}
'@shikijs/vscode-textmate@9.2.2':
resolution: {integrity: sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==}
@@ -2462,8 +2462,8 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
- shiki@1.18.0:
- resolution: {integrity: sha512-8jo7tOXr96h9PBQmOHVrltnETn1honZZY76YA79MHheGQg55jBvbm9dtU+MI5pjC5NJCFuA6rvVTLVeSW5cE4A==}
+ shiki@1.19.0:
+ resolution: {integrity: sha512-Ng7Gd6XgWFLsv4Z3so65hOyXjV78qz1M117MuZHwdPQD6fgb5wR2IoLMvSlM/Ml14EXH7n+/YxIpTD74i7kDdw==}
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
@@ -3220,27 +3220,27 @@ snapshots:
'@protobufjs/utf8@1.1.0': {}
- '@shikijs/core@1.18.0':
+ '@shikijs/core@1.19.0':
dependencies:
- '@shikijs/engine-javascript': 1.18.0
- '@shikijs/engine-oniguruma': 1.18.0
- '@shikijs/types': 1.18.0
+ '@shikijs/engine-javascript': 1.19.0
+ '@shikijs/engine-oniguruma': 1.19.0
+ '@shikijs/types': 1.19.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
hast-util-to-html: 9.0.3
- '@shikijs/engine-javascript@1.18.0':
+ '@shikijs/engine-javascript@1.19.0':
dependencies:
- '@shikijs/types': 1.18.0
+ '@shikijs/types': 1.19.0
'@shikijs/vscode-textmate': 9.2.2
oniguruma-to-js: 0.4.3
- '@shikijs/engine-oniguruma@1.18.0':
+ '@shikijs/engine-oniguruma@1.19.0':
dependencies:
- '@shikijs/types': 1.18.0
+ '@shikijs/types': 1.19.0
'@shikijs/vscode-textmate': 9.2.2
- '@shikijs/types@1.18.0':
+ '@shikijs/types@1.19.0':
dependencies:
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
@@ -5733,12 +5733,12 @@ snapshots:
shebang-regex@3.0.0: {}
- shiki@1.18.0:
+ shiki@1.19.0:
dependencies:
- '@shikijs/core': 1.18.0
- '@shikijs/engine-javascript': 1.18.0
- '@shikijs/engine-oniguruma': 1.18.0
- '@shikijs/types': 1.18.0
+ '@shikijs/core': 1.19.0
+ '@shikijs/engine-javascript': 1.19.0
+ '@shikijs/engine-oniguruma': 1.19.0
+ '@shikijs/types': 1.19.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
From 4a052ffe0cdb8c36b43e248f1807e2a18abf277b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 27 Sep 2024 11:40:06 -0500
Subject: [PATCH 04/15] Bump shiki from 1.19.0 to 1.20.0 (#6112)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki)
from 1.19.0 to 1.20.0.
Release notes
Sourced from shiki's
releases.
v1.20.0
🚀 Features
🐞 Bug Fixes
Commits
6aa7e08
chore: release v1.20.0
d5ec824
chore: update deps
989afdb
feat: move createCssVariablesTheme
to core
50c8e4a
fix: improve deprecation warnings
2335dda
feat: rename createWasmOnigEngine
to
createOnigurumaEngine
- See full diff in compare
view
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shiki&package-manager=npm_and_yarn&previous-version=1.19.0&new-version=1.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 52 +++++++++++++++++++++++++-------------------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/package.json b/package.json
index e6459c384c..01be1a8456 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,6 @@
"markdown-it-container": "^4.0.0",
"markdown-it-deflist": "^3.0.0",
"sass": "^1.79.3",
- "shiki": "^1.19.0"
+ "shiki": "^1.20.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 67cb9b0407..73eee5358d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,8 +55,8 @@ importers:
specifier: ^1.79.3
version: 1.79.3
shiki:
- specifier: ^1.19.0
- version: 1.19.0
+ specifier: ^1.20.0
+ version: 1.20.0
packages:
@@ -251,17 +251,17 @@ packages:
'@protobufjs/utf8@1.1.0':
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
- '@shikijs/core@1.19.0':
- resolution: {integrity: sha512-314J5MPdS1wzfjuD856MXvbAI2wN03ofMnUGkZ5ZDBOza/d38paLwd+YVyuKrrjxJ4hfPMjc4tRmPkXd6UDMPQ==}
+ '@shikijs/core@1.20.0':
+ resolution: {integrity: sha512-KlO3iE0THzSdYkzDFugt8SHe6FR3qNYTkmpbdW1d6xo8juQkMjybxAw/cBi2npL2eb2F4PbbnSs5Z9tDusfvyg==}
- '@shikijs/engine-javascript@1.19.0':
- resolution: {integrity: sha512-D1sioU61n7fLWfDzTC9JNS19zEYZMr7qxkSVzv6ziEWDxnwzy2PvYoKPedJV4qUf+2VnrYPSaArDz2W0XgGB7A==}
+ '@shikijs/engine-javascript@1.20.0':
+ resolution: {integrity: sha512-ZUMo758uduM0Tfgzi/kd+0IKMbNdumCxxWjY36uf1DIs2Qyg9HIq3vA1Wfa/vc6HE7tHWFpANRi3mv7UzJ68MQ==}
- '@shikijs/engine-oniguruma@1.19.0':
- resolution: {integrity: sha512-/JxwIefNVLGB4EmpB8i6P4JB/oVYRuzSixbqvx7m6iPW0lQ1T97c/0wmA+JlKbngEiExckSuPwa48fajlShB7A==}
+ '@shikijs/engine-oniguruma@1.20.0':
+ resolution: {integrity: sha512-MQ40WkVTZk7by33ces4PGK6XNFSo6PYvKTSAr2kTWdRNhFmOcnaX+1XzvFwB26eySXR7U74t91czZ1qJkEgxTA==}
- '@shikijs/types@1.19.0':
- resolution: {integrity: sha512-NZvVp3k1bP4MTRUbmnkGhYzPdoNMjNLSAwczMRUbtUl4oj2LlNRNbwERyeIyJt56Ac9fvPVZ2nn13OXk86E5UQ==}
+ '@shikijs/types@1.20.0':
+ resolution: {integrity: sha512-y+EaDvU2K6/GaXOKXxJaGnr1XtmZMF7MfS0pSEDdxEq66gCtKsLwQvVwoQFdp7R7dLlNAro3ijEE19sMZ0pzqg==}
'@shikijs/vscode-textmate@9.2.2':
resolution: {integrity: sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==}
@@ -2462,8 +2462,8 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
- shiki@1.19.0:
- resolution: {integrity: sha512-Ng7Gd6XgWFLsv4Z3so65hOyXjV78qz1M117MuZHwdPQD6fgb5wR2IoLMvSlM/Ml14EXH7n+/YxIpTD74i7kDdw==}
+ shiki@1.20.0:
+ resolution: {integrity: sha512-MZJJ1PCFsQB1Piq+25wiz0a75yUv8Q3/fzy7SzRx5ONdjdtGdyiKwYn8vb/FnK5kjS0voWGnPpjG16POauUR+g==}
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
@@ -3220,27 +3220,27 @@ snapshots:
'@protobufjs/utf8@1.1.0': {}
- '@shikijs/core@1.19.0':
+ '@shikijs/core@1.20.0':
dependencies:
- '@shikijs/engine-javascript': 1.19.0
- '@shikijs/engine-oniguruma': 1.19.0
- '@shikijs/types': 1.19.0
+ '@shikijs/engine-javascript': 1.20.0
+ '@shikijs/engine-oniguruma': 1.20.0
+ '@shikijs/types': 1.20.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
hast-util-to-html: 9.0.3
- '@shikijs/engine-javascript@1.19.0':
+ '@shikijs/engine-javascript@1.20.0':
dependencies:
- '@shikijs/types': 1.19.0
+ '@shikijs/types': 1.20.0
'@shikijs/vscode-textmate': 9.2.2
oniguruma-to-js: 0.4.3
- '@shikijs/engine-oniguruma@1.19.0':
+ '@shikijs/engine-oniguruma@1.20.0':
dependencies:
- '@shikijs/types': 1.19.0
+ '@shikijs/types': 1.20.0
'@shikijs/vscode-textmate': 9.2.2
- '@shikijs/types@1.19.0':
+ '@shikijs/types@1.20.0':
dependencies:
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
@@ -5733,12 +5733,12 @@ snapshots:
shebang-regex@3.0.0: {}
- shiki@1.19.0:
+ shiki@1.20.0:
dependencies:
- '@shikijs/core': 1.19.0
- '@shikijs/engine-javascript': 1.19.0
- '@shikijs/engine-oniguruma': 1.19.0
- '@shikijs/types': 1.19.0
+ '@shikijs/core': 1.20.0
+ '@shikijs/engine-javascript': 1.20.0
+ '@shikijs/engine-oniguruma': 1.20.0
+ '@shikijs/types': 1.20.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
From bc8e548d4d2add82383ee418a8717d9508659347 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 27 Sep 2024 11:40:15 -0500
Subject: [PATCH 05/15] Bump firebase-tools from 13.19.0 to 13.20.0 (#6113)
Bumps [firebase-tools](https://github.com/firebase/firebase-tools) from
13.19.0 to 13.20.0.
Release notes
Sourced from firebase-tools's
releases.
v13.20.0
- Switched Data Connect emulator to use an in memory PGLite database
instead of requiring a separate Postgres installation. Deprecated
'dataconnectEmulator
in
.firebaserc`.
- Released version 1.4.2 of the Data Connect emulator, which includes
SDK support for
Any
scalar type and
OrderDirection
, support for first
to lookup
operations, and breaking changes for iOS generated SDKs. PLease see
documentation for more details (#7744).
- Revert the minimum Functions SDK version and add logging for
extensions features using v5.1.0 (#7731).
- Added compatibility mode support for Firebase Data Connect schema
migrations, where application schema updates are allowed if the database
schema is in a compatible state. (#7746)
- Improved
firebase init dataconnect
to better support
local-first onboarding. (#7733)
- Added support for the
--watch
option in firebase
dataconnect:sdk:generate
. (#7719)
- Minor fix in the Firebase Data Connect GraphQL query template. (#7736)
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=firebase-tools&package-manager=npm_and_yarn&previous-version=13.19.0&new-version=13.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 01be1a8456..aef2d69d9f 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
},
"devDependencies": {
"@11ty/eleventy": "3.0.0-beta.1",
- "firebase-tools": "^13.19.0",
+ "firebase-tools": "^13.20.0",
"hast-util-from-html": "^2.0.3",
"hast-util-select": "^6.0.2",
"hast-util-to-text": "^4.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 73eee5358d..b8a6f0faeb 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -16,8 +16,8 @@ importers:
specifier: 3.0.0-beta.1
version: 3.0.0-beta.1
firebase-tools:
- specifier: ^13.19.0
- version: 13.19.0(encoding@0.1.13)
+ specifier: ^13.20.0
+ version: 13.20.0(encoding@0.1.13)
hast-util-from-html:
specifier: ^2.0.3
version: 2.0.3
@@ -109,6 +109,9 @@ packages:
'@dabh/diagnostics@2.0.3':
resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==}
+ '@electric-sql/pglite@0.2.8':
+ resolution: {integrity: sha512-0wSmQu22euBRzR5ghqyIHnBH4MfwlkL5WstOrrA3KOsjEWEglvoL/gH92JajEUA6Ufei/+qbkB2hVloC/K/RxQ==}
+
'@google-cloud/cloud-sql-connector@1.3.4':
resolution: {integrity: sha512-Lw05ME/W9mDzJuQwGwzHl9dqJtN1zBpyK6A3NbjhBi/V1WZpsIk1RgqR6+5LIbMurcNRia9ITOlCjsgJY+H92A==}
engines: {node: '>=14'}
@@ -1141,8 +1144,8 @@ packages:
resolution: {integrity: sha512-bmwQPHFq/qiWp9CbNbCQU73klT+i5qwP/0tah3MGHp26vUt2YV4WkdtXRqOZo+H+4m38k8epFHOvO4BRuAuohw==}
engines: {node: '>= 0.8'}
- firebase-tools@13.19.0:
- resolution: {integrity: sha512-NgzXJFhHz8EPDyoEKA8QXzUEcD05z+NJ3sSNmgCsPlmLa93jNzdFqpboS6fqXcnNYKFqwxnqGWE6d02wushPXg==}
+ firebase-tools@13.20.0:
+ resolution: {integrity: sha512-MzNGYdJxoo2qeI19jB1ByZGRnGHyjM3555MwnqcVTA/nyhFZTqKJu5zMGGM/YjIIJp9k/ESbq75HQ+IuJQc+QQ==}
engines: {node: '>=18.0.0 || >=20.0.0'}
hasBin: true
@@ -1444,6 +1447,9 @@ packages:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
+ is-buffer@1.1.6:
+ resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==}
+
is-ci@2.0.0:
resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==}
hasBin: true
@@ -1485,6 +1491,10 @@ packages:
resolution: {integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==}
engines: {node: '>=10'}
+ is-number@2.1.0:
+ resolution: {integrity: sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==}
+ engines: {node: '>=0.10.0'}
+
is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
@@ -1603,6 +1613,10 @@ packages:
jws@4.0.0:
resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==}
+ kind-of@3.2.2:
+ resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==}
+ engines: {node: '>=0.10.0'}
+
kind-of@6.0.3:
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
engines: {node: '>=0.10.0'}
@@ -1699,6 +1713,9 @@ packages:
resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==}
engines: {node: '>=12'}
+ lsofi@1.0.0:
+ resolution: {integrity: sha512-MKr9vM1MSm+TSKfI05IYxpKV1NCxpJaBLnELyIf784zYJ5KV9lGCE1EvpA2DtXDNM3fCuFeCwXUzim/fyQRi+A==}
+
luxon@3.5.0:
resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==}
engines: {node: '>=12'}
@@ -2649,6 +2666,9 @@ packages:
thenify@3.3.1:
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
+ through2@2.0.5:
+ resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==}
+
through@2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
@@ -3055,6 +3075,8 @@ snapshots:
enabled: 2.0.0
kuler: 2.0.0
+ '@electric-sql/pglite@0.2.8': {}
+
'@google-cloud/cloud-sql-connector@1.3.4(encoding@0.1.13)':
dependencies:
'@googleapis/sqladmin': 19.0.0(encoding@0.1.13)
@@ -4175,8 +4197,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
- firebase-tools@13.19.0(encoding@0.1.13):
+ firebase-tools@13.20.0(encoding@0.1.13):
dependencies:
+ '@electric-sql/pglite': 0.2.8
'@google-cloud/cloud-sql-connector': 1.3.4(encoding@0.1.13)
'@google-cloud/pubsub': 4.7.1(encoding@0.1.13)
abort-controller: 3.0.0
@@ -4211,6 +4234,7 @@ snapshots:
leven: 3.1.0
libsodium-wrappers: 0.7.15
lodash: 4.17.21
+ lsofi: 1.0.0
marked: 13.0.3
marked-terminal: 7.1.0(marked@13.0.3)
mime: 2.6.0
@@ -4678,6 +4702,8 @@ snapshots:
dependencies:
binary-extensions: 2.3.0
+ is-buffer@1.1.6: {}
+
is-ci@2.0.0:
dependencies:
ci-info: 2.0.0
@@ -4708,6 +4734,10 @@ snapshots:
is-npm@5.0.0: {}
+ is-number@2.1.0:
+ dependencies:
+ kind-of: 3.2.2
+
is-number@7.0.0: {}
is-obj@2.0.0: {}
@@ -4834,6 +4864,10 @@ snapshots:
jwa: 2.0.0
safe-buffer: 5.2.1
+ kind-of@3.2.2:
+ dependencies:
+ is-buffer: 1.1.6
+
kind-of@6.0.3: {}
kleur@4.1.5: {}
@@ -4914,6 +4948,11 @@ snapshots:
lru-cache@7.18.3: {}
+ lsofi@1.0.0:
+ dependencies:
+ is-number: 2.1.0
+ through2: 2.0.5
+
luxon@3.5.0: {}
make-dir@3.1.0:
@@ -5970,6 +6009,11 @@ snapshots:
dependencies:
any-promise: 1.3.0
+ through2@2.0.5:
+ dependencies:
+ readable-stream: 2.3.8
+ xtend: 4.0.2
+
through@2.3.8: {}
tmp@0.0.33:
From 1dddbac4dabb06c3166c3188ddccedd4aa93dd9d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Sep 2024 10:23:46 -0500
Subject: [PATCH 06/15] Bump sass from 1.79.3 to 1.79.4 (#6115)
Bumps [sass](https://github.com/sass/dart-sass) from 1.79.3 to 1.79.4.
Release notes
Sourced from sass's
releases.
Dart Sass 1.79.4
To install Sass 1.79.4, download one of the packages below and add it to your PATH, or
see the Sass website for
full installation instructions.
Changes
JS API
- Fix a bug where passing
green
or blue
to
color.change()
for legacy colors would fail.
See the full
changelog for changes in earlier releases.
Changelog
Sourced from sass's
changelog.
1.79.4
JS API
- Fix a bug where passing
green
or blue
to
color.change()
for legacy
colors would fail.
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sass&package-manager=npm_and_yarn&previous-version=1.79.3&new-version=1.79.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index aef2d69d9f..641e8f50f8 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"markdown-it-attrs": "^4.2.0",
"markdown-it-container": "^4.0.0",
"markdown-it-deflist": "^3.0.0",
- "sass": "^1.79.3",
+ "sass": "^1.79.4",
"shiki": "^1.20.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b8a6f0faeb..27bc87cf22 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -52,8 +52,8 @@ importers:
specifier: ^3.0.0
version: 3.0.0
sass:
- specifier: ^1.79.3
- version: 1.79.3
+ specifier: ^1.79.4
+ version: 1.79.4
shiki:
specifier: ^1.20.0
version: 1.20.0
@@ -2419,8 +2419,8 @@ packages:
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
- sass@1.79.3:
- resolution: {integrity: sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==}
+ sass@1.79.4:
+ resolution: {integrity: sha512-K0QDSNPXgyqO4GZq2HO5Q70TLxTH6cIT59RdoCHMivrC8rqzaTw5ab9prjz9KUN1El4FLXrBXJhik61JR4HcGg==}
engines: {node: '>=14.0.0'}
hasBin: true
@@ -5699,7 +5699,7 @@ snapshots:
safer-buffer@2.1.2: {}
- sass@1.79.3:
+ sass@1.79.4:
dependencies:
chokidar: 4.0.0
immutable: 4.3.7
From d109cc736b57d6bfb406d82d343b79dad0e3deb4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Sep 2024 10:24:11 -0500
Subject: [PATCH 07/15] Bump firebase-tools from 13.20.0 to 13.20.1 (#6114)
Bumps [firebase-tools](https://github.com/firebase/firebase-tools) from
13.20.0 to 13.20.1.
Release notes
Sourced from firebase-tools's
releases.
v13.20.1
- Updated the Firebase Data Connect local toolkit to v1.4.3, which
includes a fix for URL redirects in the generated docsite. (#7763)
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=firebase-tools&package-manager=npm_and_yarn&previous-version=13.20.0&new-version=13.20.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 641e8f50f8..24eec45674 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
},
"devDependencies": {
"@11ty/eleventy": "3.0.0-beta.1",
- "firebase-tools": "^13.20.0",
+ "firebase-tools": "^13.20.1",
"hast-util-from-html": "^2.0.3",
"hast-util-select": "^6.0.2",
"hast-util-to-text": "^4.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 27bc87cf22..f0acb7d2cd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -16,8 +16,8 @@ importers:
specifier: 3.0.0-beta.1
version: 3.0.0-beta.1
firebase-tools:
- specifier: ^13.20.0
- version: 13.20.0(encoding@0.1.13)
+ specifier: ^13.20.1
+ version: 13.20.1(encoding@0.1.13)
hast-util-from-html:
specifier: ^2.0.3
version: 2.0.3
@@ -1144,8 +1144,8 @@ packages:
resolution: {integrity: sha512-bmwQPHFq/qiWp9CbNbCQU73klT+i5qwP/0tah3MGHp26vUt2YV4WkdtXRqOZo+H+4m38k8epFHOvO4BRuAuohw==}
engines: {node: '>= 0.8'}
- firebase-tools@13.20.0:
- resolution: {integrity: sha512-MzNGYdJxoo2qeI19jB1ByZGRnGHyjM3555MwnqcVTA/nyhFZTqKJu5zMGGM/YjIIJp9k/ESbq75HQ+IuJQc+QQ==}
+ firebase-tools@13.20.1:
+ resolution: {integrity: sha512-P4g71LkFiDzxoMvUqjsF6MWVTpKQ7g0Rcfj9hQQesM4w2FeNAImirAf55mzXewIEYQLTeWwRQm552Jg8r4MkNA==}
engines: {node: '>=18.0.0 || >=20.0.0'}
hasBin: true
@@ -4197,7 +4197,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- firebase-tools@13.20.0(encoding@0.1.13):
+ firebase-tools@13.20.1(encoding@0.1.13):
dependencies:
'@electric-sql/pglite': 0.2.8
'@google-cloud/cloud-sql-connector': 1.3.4(encoding@0.1.13)
From 309045ea6af6bad37d8d0c2e06490fd6c74cbaa1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Sep 2024 10:35:56 -0500
Subject: [PATCH 08/15] Bump shiki from 1.20.0 to 1.21.0 (#6116)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki)
from 1.20.0 to 1.21.0.
Release notes
Sourced from shiki's
releases.
v1.21.0
🚀 Features
🐞 Bug Fixes
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shiki&package-manager=npm_and_yarn&previous-version=1.20.0&new-version=1.21.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 52 +++++++++++++++++++++++++-------------------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/package.json b/package.json
index 24eec45674..1482ae7de9 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,6 @@
"markdown-it-container": "^4.0.0",
"markdown-it-deflist": "^3.0.0",
"sass": "^1.79.4",
- "shiki": "^1.20.0"
+ "shiki": "^1.21.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f0acb7d2cd..3ed63b2944 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,8 +55,8 @@ importers:
specifier: ^1.79.4
version: 1.79.4
shiki:
- specifier: ^1.20.0
- version: 1.20.0
+ specifier: ^1.21.0
+ version: 1.21.0
packages:
@@ -254,17 +254,17 @@ packages:
'@protobufjs/utf8@1.1.0':
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
- '@shikijs/core@1.20.0':
- resolution: {integrity: sha512-KlO3iE0THzSdYkzDFugt8SHe6FR3qNYTkmpbdW1d6xo8juQkMjybxAw/cBi2npL2eb2F4PbbnSs5Z9tDusfvyg==}
+ '@shikijs/core@1.21.0':
+ resolution: {integrity: sha512-zAPMJdiGuqXpZQ+pWNezQAk5xhzRXBNiECFPcJLtUdsFM3f//G95Z15EHTnHchYycU8kIIysqGgxp8OVSj1SPQ==}
- '@shikijs/engine-javascript@1.20.0':
- resolution: {integrity: sha512-ZUMo758uduM0Tfgzi/kd+0IKMbNdumCxxWjY36uf1DIs2Qyg9HIq3vA1Wfa/vc6HE7tHWFpANRi3mv7UzJ68MQ==}
+ '@shikijs/engine-javascript@1.21.0':
+ resolution: {integrity: sha512-jxQHNtVP17edFW4/0vICqAVLDAxmyV31MQJL4U/Kg+heQALeKYVOWo0sMmEZ18FqBt+9UCdyqGKYE7bLRtk9mg==}
- '@shikijs/engine-oniguruma@1.20.0':
- resolution: {integrity: sha512-MQ40WkVTZk7by33ces4PGK6XNFSo6PYvKTSAr2kTWdRNhFmOcnaX+1XzvFwB26eySXR7U74t91czZ1qJkEgxTA==}
+ '@shikijs/engine-oniguruma@1.21.0':
+ resolution: {integrity: sha512-AIZ76XocENCrtYzVU7S4GY/HL+tgHGbVU+qhiDyNw1qgCA5OSi4B4+HY4BtAoJSMGuD/L5hfTzoRVbzEm2WTvg==}
- '@shikijs/types@1.20.0':
- resolution: {integrity: sha512-y+EaDvU2K6/GaXOKXxJaGnr1XtmZMF7MfS0pSEDdxEq66gCtKsLwQvVwoQFdp7R7dLlNAro3ijEE19sMZ0pzqg==}
+ '@shikijs/types@1.21.0':
+ resolution: {integrity: sha512-tzndANDhi5DUndBtpojEq/42+dpUF2wS7wdCDQaFtIXm3Rd1QkrcVgSSRLOvEwexekihOXfbYJINW37g96tJRw==}
'@shikijs/vscode-textmate@9.2.2':
resolution: {integrity: sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==}
@@ -2479,8 +2479,8 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
- shiki@1.20.0:
- resolution: {integrity: sha512-MZJJ1PCFsQB1Piq+25wiz0a75yUv8Q3/fzy7SzRx5ONdjdtGdyiKwYn8vb/FnK5kjS0voWGnPpjG16POauUR+g==}
+ shiki@1.21.0:
+ resolution: {integrity: sha512-apCH5BoWTrmHDPGgg3RF8+HAAbEL/CdbYr8rMw7eIrdhCkZHdVGat5mMNlRtd1erNG01VPMIKHNQ0Pj2HMAiog==}
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
@@ -3242,27 +3242,27 @@ snapshots:
'@protobufjs/utf8@1.1.0': {}
- '@shikijs/core@1.20.0':
+ '@shikijs/core@1.21.0':
dependencies:
- '@shikijs/engine-javascript': 1.20.0
- '@shikijs/engine-oniguruma': 1.20.0
- '@shikijs/types': 1.20.0
+ '@shikijs/engine-javascript': 1.21.0
+ '@shikijs/engine-oniguruma': 1.21.0
+ '@shikijs/types': 1.21.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
hast-util-to-html: 9.0.3
- '@shikijs/engine-javascript@1.20.0':
+ '@shikijs/engine-javascript@1.21.0':
dependencies:
- '@shikijs/types': 1.20.0
+ '@shikijs/types': 1.21.0
'@shikijs/vscode-textmate': 9.2.2
oniguruma-to-js: 0.4.3
- '@shikijs/engine-oniguruma@1.20.0':
+ '@shikijs/engine-oniguruma@1.21.0':
dependencies:
- '@shikijs/types': 1.20.0
+ '@shikijs/types': 1.21.0
'@shikijs/vscode-textmate': 9.2.2
- '@shikijs/types@1.20.0':
+ '@shikijs/types@1.21.0':
dependencies:
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
@@ -5772,12 +5772,12 @@ snapshots:
shebang-regex@3.0.0: {}
- shiki@1.20.0:
+ shiki@1.21.0:
dependencies:
- '@shikijs/core': 1.20.0
- '@shikijs/engine-javascript': 1.20.0
- '@shikijs/engine-oniguruma': 1.20.0
- '@shikijs/types': 1.20.0
+ '@shikijs/core': 1.21.0
+ '@shikijs/engine-javascript': 1.21.0
+ '@shikijs/engine-oniguruma': 1.21.0
+ '@shikijs/types': 1.21.0
'@shikijs/vscode-textmate': 9.2.2
'@types/hast': 3.0.4
From 8a17f000934e9d6fb588d8ba3ec7a9ad80e252bd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Oct 2024 09:33:42 -0500
Subject: [PATCH 09/15] Bump github/codeql-action from 3.26.9 to 3.26.10
(#6119)
Bumps [github/codeql-action](https://github.com/github/codeql-action)
from 3.26.9 to 3.26.10.
Changelog
Sourced from github/codeql-action's
changelog.
CodeQL Action Changelog
See the releases
page for the relevant changes to the CodeQL CLI and language
packs.
Note that the only difference between v2
and
v3
of the CodeQL Action is the node version they support,
with v3
running on node 20 while we continue to release
v2
to support running on node 16. For example
3.22.11
was the first v3
release and is
functionally identical to 2.22.11
. This approach ensures an
easy way to track exactly which features are included in different
versions, indicated by the minor and patch version numbers.
[UNRELEASED]
No user facing changes.
3.26.10 - 30 Sep 2024
- We are rolling out a feature in September/October 2024 that sets up
CodeQL using a bundle compressed with Zstandard. Our aim is to
improve the performance of setting up CodeQL. #2502
3.26.9 - 24 Sep 2024
No user facing changes.
3.26.8 - 19 Sep 2024
- Update default CodeQL bundle version to 2.19.0. #2483
3.26.7 - 13 Sep 2024
- Update default CodeQL bundle version to 2.18.4. #2471
3.26.6 - 29 Aug 2024
- Update default CodeQL bundle version to 2.18.3. #2449
3.26.5 - 23 Aug 2024
- Fix an issue where the
csrutil
system call used for
telemetry would fail on MacOS ARM machines with System Integrity
Protection disabled. #2441
3.26.4 - 21 Aug 2024
- Deprecation: The
add-snippets
input on the
analyze
Action is deprecated and will be removed in the
first release in August 2025. #2436
- Fix an issue where the disk usage system call used for telemetry
would fail on MacOS ARM machines with System Integrity Protection
disabled, and then surface a warning. The system call is now disabled
for these machines. #2434
3.26.3 - 19 Aug 2024
- Fix an issue where the CodeQL Action could not write diagnostic
messages on Windows. This issue did not impact analysis quality. #2430
3.26.2 - 14 Aug 2024
- Update default CodeQL bundle version to 2.18.2. #2417
3.26.1 - 13 Aug 2024
No user facing changes.
... (truncated)
Commits
e2b3eaf
Merge pull request #2507
from github/update-v3.26.10-2617ff2d3
7dbbf6d
Update changelog for v3.26.10
2617ff2
Merge pull request #2502
from github/henrymercer/zstd-experiment
46e0c78
Merge pull request #2504
from github/mergeback/v3.26.9-to-main-461ef6c7
da7be78
Update checked-in dependencies
ae1c6a2
Update changelog and version after v3.26.9
6b2f7e7
Run PR checks using JS only
af8e2bc
Use Node script to remove CodeQL cross-platform
bc68dc9
Extract constant for first std-compressed version
67b30f7
Tweak description
- Additional commits viewable in compare
view
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=3.26.9&new-version=3.26.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index b0b21e4474..3c326e6b16 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -33,7 +33,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628
+ uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628
+ uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628
+ uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 6871c870c5..07d01d7dda 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -49,6 +49,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628
+ uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13
with:
sarif_file: results.sarif
From 9f850930f5275b5846250b0e2e18fa928718ebdc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Oct 2024 09:38:08 -0500
Subject: [PATCH 10/15] Bump @11ty/eleventy from 3.0.0-beta.1 to 3.0.0-beta.2
(#6121)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [@11ty/eleventy](https://github.com/11ty/eleventy) from
3.0.0-beta.1 to 3.0.0-beta.2.
Release notes
Sourced from @11ty/eleventy
's
releases.
Eleventy v3.0.0-beta.2: The Final Countdown
Minutiae
Full Changelog: https://github.com/11ty/eleventy/compare/v3.0.0-beta.1...v3.0.0-beta.2
Full Eleventy v3 Milestone (176 closed): https://github.com/11ty/eleventy/milestone/40?closed=1
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@11ty/eleventy&package-manager=npm_and_yarn&previous-version=3.0.0-beta.1&new-version=3.0.0-beta.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 59 ++++++++++++++++++++++++++++++++++++++------------
2 files changed, 46 insertions(+), 15 deletions(-)
diff --git a/package.json b/package.json
index 1482ae7de9..502506dc75 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
"bootstrap-scss": "^4.6.2"
},
"devDependencies": {
- "@11ty/eleventy": "3.0.0-beta.1",
+ "@11ty/eleventy": "3.0.0-beta.2",
"firebase-tools": "^13.20.1",
"hast-util-from-html": "^2.0.3",
"hast-util-select": "^6.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3ed63b2944..4b40b18fd8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,8 +13,8 @@ importers:
version: 4.6.2
devDependencies:
'@11ty/eleventy':
- specifier: 3.0.0-beta.1
- version: 3.0.0-beta.1
+ specifier: 3.0.0-beta.2
+ version: 3.0.0-beta.2
firebase-tools:
specifier: ^13.20.1
version: 13.20.1(encoding@0.1.13)
@@ -66,21 +66,21 @@ packages:
'@11ty/dependency-tree@3.0.1':
resolution: {integrity: sha512-aZizxcL4Z/clm3KPRx8i9ohW9R2gLssXfUSy7qQmQRXb4CUOyvmqk2gKeJqRmXIfMi2bB9w03SgtN5v1YwqpiA==}
- '@11ty/eleventy-dev-server@2.0.3':
- resolution: {integrity: sha512-sJ7ZExlsyjNqOMMxJPi7ilcP7qQZdQgVYqRNnx888WINANJy/0dYQk3eGKrA6dv3ErsbncIxyWDdpwVeZjscBg==}
+ '@11ty/eleventy-dev-server@2.0.4':
+ resolution: {integrity: sha512-d0CuufX6yPtVz+RW0oJZg1pVoxo1jOrPmpXYacoiKLJm0MMC9MkPQOCXlimguHVaceHejFo5+aZB9/aGB2RR0A==}
engines: {node: '>=18'}
hasBin: true
- '@11ty/eleventy-plugin-bundle@2.0.2':
- resolution: {integrity: sha512-zGyPp1g6bi+VC2I5ylwj4w29nivDmx4Uki5gWY6v3MT/1muK0JTtnc1KOMC7yUurv6YwtwdiLYyFK2eFyKv2wg==}
+ '@11ty/eleventy-plugin-bundle@3.0.0':
+ resolution: {integrity: sha512-JSnqehT+sWSPi6e44jTXUW+KiV9284YF9fzPQvfGB4cXlk/m/SJk17CavHCleIvKXDN+jrUw9TZkwAwr85ONWQ==}
engines: {node: '>=18'}
'@11ty/eleventy-utils@1.0.3':
resolution: {integrity: sha512-nULO91om7vQw4Y/UBjM8i7nJ1xl+/nyK4rImZ41lFxiY2d+XUz7ChAj1CDYFjrLZeu0utAYJTZ45LlcHTkUG4g==}
engines: {node: '>=12'}
- '@11ty/eleventy@3.0.0-beta.1':
- resolution: {integrity: sha512-iJT7vekH11l8PAUPBfUAcb5oWbYK0w4ijgwDTutUsk6tX9rp4ZRL1jdhVWvZq04/rkc55mczNFPPhHB/XO1/qw==}
+ '@11ty/eleventy@3.0.0-beta.2':
+ resolution: {integrity: sha512-N3sKp79gj1D8JjFK1CMHl9JehaM886sLAB8xc75Lv9daXgTqYHTvoeMGwZ5jrlRvatYD54tpWZESiyDyLzM1mw==}
engines: {node: '>=18'}
hasBin: true
@@ -979,6 +979,10 @@ packages:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
+ entities@5.0.0:
+ resolution: {integrity: sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==}
+ engines: {node: '>=0.12'}
+
env-paths@2.2.1:
resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
engines: {node: '>=6'}
@@ -2452,6 +2456,10 @@ packages:
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
engines: {node: '>= 0.8.0'}
+ send@0.19.0:
+ resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==}
+ engines: {node: '>= 0.8.0'}
+
serve-static@1.15.0:
resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==}
engines: {node: '>= 0.8.0'}
@@ -2961,7 +2969,7 @@ snapshots:
dependencies:
'@11ty/eleventy-utils': 1.0.3
- '@11ty/eleventy-dev-server@2.0.3':
+ '@11ty/eleventy-dev-server@2.0.4':
dependencies:
'@11ty/eleventy-utils': 1.0.3
chokidar: 3.6.0
@@ -2972,7 +2980,7 @@ snapshots:
minimist: 1.2.8
morphdom: 2.7.4
please-upgrade-node: 3.2.0
- send: 0.18.0
+ send: 0.19.0
ssri: 11.0.0
urlpattern-polyfill: 10.0.0
ws: 8.18.0
@@ -2981,22 +2989,24 @@ snapshots:
- supports-color
- utf-8-validate
- '@11ty/eleventy-plugin-bundle@2.0.2':
+ '@11ty/eleventy-plugin-bundle@3.0.0(posthtml@0.16.6)':
dependencies:
debug: 4.3.7
+ posthtml-match-helper: 2.0.2(posthtml@0.16.6)
transitivePeerDependencies:
+ - posthtml
- supports-color
'@11ty/eleventy-utils@1.0.3':
dependencies:
normalize-path: 3.0.0
- '@11ty/eleventy@3.0.0-beta.1':
+ '@11ty/eleventy@3.0.0-beta.2':
dependencies:
'@11ty/dependency-tree': 3.0.1
'@11ty/dependency-tree-esm': 1.0.0
- '@11ty/eleventy-dev-server': 2.0.3
- '@11ty/eleventy-plugin-bundle': 2.0.2
+ '@11ty/eleventy-dev-server': 2.0.4
+ '@11ty/eleventy-plugin-bundle': 3.0.0(posthtml@0.16.6)
'@11ty/eleventy-utils': 1.0.3
'@11ty/lodash-custom': 4.17.21
'@11ty/posthtml-urls': 1.0.0
@@ -3008,6 +3018,7 @@ snapshots:
cross-spawn: 7.0.3
debug: 4.3.7
dependency-graph: 1.0.0
+ entities: 5.0.0
fast-glob: 3.3.2
filesize: 10.1.6
graceful-fs: 4.2.11
@@ -3984,6 +3995,8 @@ snapshots:
entities@4.5.0: {}
+ entities@5.0.0: {}
+
env-paths@2.2.1:
optional: true
@@ -5740,6 +5753,24 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ send@0.19.0:
+ dependencies:
+ debug: 2.6.9
+ depd: 2.0.0
+ destroy: 1.2.0
+ encodeurl: 1.0.2
+ escape-html: 1.0.3
+ etag: 1.8.1
+ fresh: 0.5.2
+ http-errors: 2.0.0
+ mime: 1.6.0
+ ms: 2.1.3
+ on-finished: 2.4.1
+ range-parser: 1.2.1
+ statuses: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+
serve-static@1.15.0:
dependencies:
encodeurl: 1.0.2
From 55960412535b743eb55fcd075bef8e4f34842d45 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Oct 2024 09:44:10 -0500
Subject: [PATCH 11/15] Bump firebase-tools from 13.20.1 to 13.20.2 (#6120)
Bumps [firebase-tools](https://github.com/firebase/firebase-tools) from
13.20.1 to 13.20.2.
Release notes
Sourced from firebase-tools's
releases.
v13.20.2
- Released version 1.4.4 of the Data Connect emulator, which includes
a change in node engine requirements from v20 to v18, and an update to
the peer dependency for the web SDK.
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=firebase-tools&package-manager=npm_and_yarn&previous-version=13.20.1&new-version=13.20.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 502506dc75..d9b3d32728 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
},
"devDependencies": {
"@11ty/eleventy": "3.0.0-beta.2",
- "firebase-tools": "^13.20.1",
+ "firebase-tools": "^13.20.2",
"hast-util-from-html": "^2.0.3",
"hast-util-select": "^6.0.2",
"hast-util-to-text": "^4.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4b40b18fd8..5e7ddd7073 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -16,8 +16,8 @@ importers:
specifier: 3.0.0-beta.2
version: 3.0.0-beta.2
firebase-tools:
- specifier: ^13.20.1
- version: 13.20.1(encoding@0.1.13)
+ specifier: ^13.20.2
+ version: 13.20.2(encoding@0.1.13)
hast-util-from-html:
specifier: ^2.0.3
version: 2.0.3
@@ -1148,8 +1148,8 @@ packages:
resolution: {integrity: sha512-bmwQPHFq/qiWp9CbNbCQU73klT+i5qwP/0tah3MGHp26vUt2YV4WkdtXRqOZo+H+4m38k8epFHOvO4BRuAuohw==}
engines: {node: '>= 0.8'}
- firebase-tools@13.20.1:
- resolution: {integrity: sha512-P4g71LkFiDzxoMvUqjsF6MWVTpKQ7g0Rcfj9hQQesM4w2FeNAImirAf55mzXewIEYQLTeWwRQm552Jg8r4MkNA==}
+ firebase-tools@13.20.2:
+ resolution: {integrity: sha512-lhJ8C/hNtNyG57IIWZ+j+0JaiB3A/wo7c/LFouRigE+/IRo13le2uotBAFI7XjTOgxelxs8wGA6u/4fgQAz8Zw==}
engines: {node: '>=18.0.0 || >=20.0.0'}
hasBin: true
@@ -4210,7 +4210,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- firebase-tools@13.20.1(encoding@0.1.13):
+ firebase-tools@13.20.2(encoding@0.1.13):
dependencies:
'@electric-sql/pglite': 0.2.8
'@google-cloud/cloud-sql-connector': 1.3.4(encoding@0.1.13)
From 77f3ebc7904d23973523d7a9bdaa3183b80b385e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 2 Oct 2024 12:49:10 -0500
Subject: [PATCH 12/15] Bump @11ty/eleventy from 3.0.0-beta.2 to 3.0.0 (#6122)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps [@11ty/eleventy](https://github.com/11ty/eleventy) from
3.0.0-beta.2 to 3.0.0.
Release notes
Sourced from @11ty/eleventy
's
releases.
Eleventy v3.0.0: Possums ❤️ ESM
We did it. After 22 pre-releases and over a year of work, Eleventy
3.0.0 is now available. You can try it out now on your project
using:
npm install @11ty/eleventy@latest
If you’re upgrading from a previous version of
Eleventy, use the Upgrade Help
plugin for automated checks and help with your upgrade!
Why should you
use Eleventy? Eleventy is a flexible and production-ready
site generator known for its zero-client JavaScript footprint, speedy sites, speedy
builds, and full control over the
output.
A few numbers on the best version of Eleventy yet:
Stats |
v2.0.1 |
v3.0.0 |
20% smaller |
35.2 MB |
28.1 MB |
11% fewer dependencies |
213 |
189 |
9% faster npm install |
4.511s* |
4.103s* |
*fastest time of 3 runs (bypassing local cache)
Flagship 3.0 features
- Eleventy is now written in ESM with full support
for ESM in your projects: configuration, data files, 11ty.js templates,
etc. For many projects this won’t be a breaking change and we’ll
continue to support CommonJS too. Every example on the docs now includes
both a CommonJS and ESM version. Docs: https://v3.11ty.dev/docs/cjs-esm/
// ESM
export default function(eleventyConfig) {}
// We’ll keep supporting CommonJS:
module.exports = function(eleventyConfig) {}
- Supporting more package managers and runtimes: pnpm, yarn, Deno.
More examples on the docs! https://v3.11ty.dev/docs/
- Asynchronous configuration #614
Docs: https://v3.11ty.dev/docs/config/
// ESM
export default async function(eleventyConfig) {}
// CommonJS
module.exports = async function(eleventyConfig) {}
- For-free performance improvement to built-in
slugify
,
inputPathToUrl
universal filters (via memoization) #840
Docs: https://v3.11ty.dev/docs/memoize/
- Named
config
export improves consistency for plugins #3246
and set*Directory
configuration API methods #1503
Docs: https://v3.11ty.dev/docs/config-shapes/#optional-export-config-object
and https://v3.11ty.dev/docs/config/#configuration-options
export default function(eleventyConfig) {
eleventyConfig.setInputDirectory(".");
</tr></table>
... (truncated)
Commits
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@11ty/eleventy&package-manager=npm_and_yarn&previous-version=3.0.0-beta.2&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index d9b3d32728..a7b5834146 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
"bootstrap-scss": "^4.6.2"
},
"devDependencies": {
- "@11ty/eleventy": "3.0.0-beta.2",
+ "@11ty/eleventy": "3.0.0",
"firebase-tools": "^13.20.2",
"hast-util-from-html": "^2.0.3",
"hast-util-select": "^6.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5e7ddd7073..518bef6d1b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,8 +13,8 @@ importers:
version: 4.6.2
devDependencies:
'@11ty/eleventy':
- specifier: 3.0.0-beta.2
- version: 3.0.0-beta.2
+ specifier: 3.0.0
+ version: 3.0.0
firebase-tools:
specifier: ^13.20.2
version: 13.20.2(encoding@0.1.13)
@@ -79,8 +79,8 @@ packages:
resolution: {integrity: sha512-nULO91om7vQw4Y/UBjM8i7nJ1xl+/nyK4rImZ41lFxiY2d+XUz7ChAj1CDYFjrLZeu0utAYJTZ45LlcHTkUG4g==}
engines: {node: '>=12'}
- '@11ty/eleventy@3.0.0-beta.2':
- resolution: {integrity: sha512-N3sKp79gj1D8JjFK1CMHl9JehaM886sLAB8xc75Lv9daXgTqYHTvoeMGwZ5jrlRvatYD54tpWZESiyDyLzM1mw==}
+ '@11ty/eleventy@3.0.0':
+ resolution: {integrity: sha512-0P0ZsJXVW2QiNdhd7z+GYy6n+ivh0enx1DRdua5ta6NlzY2AhbkeWBY6U+FKA8lPS3H4+XsTpfLLfIScpPZLaQ==}
engines: {node: '>=18'}
hasBin: true
@@ -3001,7 +3001,7 @@ snapshots:
dependencies:
normalize-path: 3.0.0
- '@11ty/eleventy@3.0.0-beta.2':
+ '@11ty/eleventy@3.0.0':
dependencies:
'@11ty/dependency-tree': 3.0.1
'@11ty/dependency-tree-esm': 1.0.0
From 35c7a25dd680061b78ae5587a0113e06571c475a Mon Sep 17 00:00:00 2001
From: Parker Lougheed
Date: Thu, 3 Oct 2024 14:58:07 -0500
Subject: [PATCH 13/15] Add stable tooling redirect to debug extension (#6123)
---
firebase.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/firebase.json b/firebase.json
index a75525614c..65e9b3eaef 100644
--- a/firebase.json
+++ b/firebase.json
@@ -285,6 +285,7 @@
{ "source": "/support{,/**}", "destination": "/community", "type": 301 },
{ "source": "/to/main-function", "destination": "/language/functions#main", "type": 301 },
+ { "source": "/to/web-debug-extension", "destination": "https://chromewebstore.google.com/detail/dart-debug-extension/eljbmlghnomdjgdjmbdekegdkbabckhm", "type": 301 },
{ "source": "/tools/**/download{,.html,/**}", "destination": "/get-dart", "type": 301 },
{ "source": "/tools/**/private-files", "destination": "/guides/libraries/private-files", "type": 301 },
From 6f11311a12ccf651d0174e954f0a8dc07caf833f Mon Sep 17 00:00:00 2001
From: Sigurd Meldgaard
Date: Thu, 3 Oct 2024 22:00:43 +0200
Subject: [PATCH 14/15] Explain when to use `dart pub get --enforce-lockfile`
(#6108)
Contributes https://github.com/dart-lang/pub/issues/4093
---------
Co-authored-by: Jonas Finnemann Jensen
Co-authored-by: Parker Lougheed
---
firebase.json | 2 +-
src/content/guides/packages.md | 83 ++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/firebase.json b/firebase.json
index 65e9b3eaef..1b682dc5a7 100644
--- a/firebase.json
+++ b/firebase.json
@@ -182,7 +182,6 @@
{ "source": "/go/flutter-upper-bound-deprecation", "destination": "https://github.com/flutter/flutter/issues/68143", "type": 301 },
{ "source": "/go/macros", "destination": "/language/macros", "type": 301 },
{ "source": "/go/pub-workspaces", "destination": "https://flutter.dev/go/pub-workspace", "type": 301 },
-
{ "source": "/go/non-promo-conflicting-getter", "destination": "/tools/non-promotion-reasons#getter-name", "type": 301 },
{ "source": "/go/non-promo-conflicting-non-promotable-field", "destination": "/tools/non-promotion-reasons#field-name", "type": 301 },
{ "source": "/go/non-promo-conflicting-noSuchMethod-forwarder", "destination": "/tools/non-promotion-reasons#nosuchmethod", "type": 301 },
@@ -284,6 +283,7 @@
{ "source": "/support/faq", "destination": "/resources/faq", "type": 301 },
{ "source": "/support{,/**}", "destination": "/community", "type": 301 },
+ { "source": "/to/enforce-lockfile", "destination": "/guides/packages#get-dependencies-for-production", "type": 301 },
{ "source": "/to/main-function", "destination": "/language/functions#main", "type": 301 },
{ "source": "/to/web-debug-extension", "destination": "https://chromewebstore.google.com/detail/dart-debug-extension/eljbmlghnomdjgdjmbdekegdkbabckhm", "type": 301 },
diff --git a/src/content/guides/packages.md b/src/content/guides/packages.md
index 62839b98a1..55481448cd 100644
--- a/src/content/guides/packages.md
+++ b/src/content/guides/packages.md
@@ -178,6 +178,89 @@ due to conflicting version constraints in the pubspec.
To identify out-of-date packages that require editing the pubspec,
use [`dart pub outdated`][outdated].
+## Get dependencies for production
+
+In some situations, `dart pub get` does not retrieve
+the exact package versions locked in the `pubspec.lock` file:
+
+* If new dependencies are added to or removed from `pubspec.yaml` after
+ the `pubspec.lock` file was last updated.
+* If the locked version no longer exists in the package repository.
+* If you changed to a different version of the Dart SDK,
+ and some packages are no longer compatible with that new version.
+
+In these cases `dart pub get` will:
+
+* Unlock enough of the locked dependency versions that
+ a resolution becomes possible.
+* Notify you about any dependency changes relative to
+ the existing `pubspec.lock`.
+
+For example, after adding `retry: ^3.0.0` to your dependencies:
+
+```console
+$ dart pub get
+Resolving dependencies... (1.0s)
+Downloading packages...
++ retry 3.1.2
+```
+
+Also, if the [content hash][] of a published package version
+differs from the hash in the `pubspec.lock` file, pub will
+warn you and update the lockfile to reflect the published version.
+
+For example, if you manually change the hash of `retry` in `pubspec.lock`:
+
+```console
+$ dart pub get
+Resolving dependencies...
+Downloading packages...
+~ retry 3.1.2 (was 3.1.2)
+The existing content-hash from pubspec.lock doesn't match contents for:
+ * retry-3.1.2 from "https://pub.dev"
+
+This indicates one of:
+ * The content has changed on the server since you created the pubspec.lock.
+ * The pubspec.lock has been corrupted.
+
+The content-hashes in pubspec.lock has been updated.
+
+For more information see:
+https://dart.dev/go/content-hashes
+Changed 1 dependency!
+```
+
+When deploying your project to production,
+use `dart pub get --enforce-lockfile` to retrieve dependencies.
+
+If your project's dependency constraints can't be
+satisfied with the exact versions and content hashes in `pubspec.lock`,
+package retrieval and the command will fail.
+This helps avoid deploying untested
+dependencies and dependency versions to production.
+
+```console
+$ dart pub get --enforce-lockfile
+Resolving dependencies...
+Downloading packages...
+~ retry 3.1.2 (was 3.1.2)
+The existing content-hash from pubspec.lock doesn't match contents for:
+ * retry-3.1.2 from "https://pub.dev"
+
+This indicates one of:
+ * The content has changed on the server since you created the pubspec.lock.
+ * The pubspec.lock has been corrupted.
+
+For more information see:
+https://dart.dev/go/content-hashes
+Would change 1 dependency.
+Unable to satisfy `pubspec.yaml` using `pubspec.lock`.
+
+To update `pubspec.lock` run `dart pub get` without `--enforce-lockfile`.
+```
+
+[content hash]: /tools/pub/glossary#content-hashes
+
## More information
The following pages have more information about packages and
From 5e7b135194a10619aadbbd018f1c22596aed7ba1 Mon Sep 17 00:00:00 2001
From: Parker Lougheed
Date: Thu, 3 Oct 2024 17:49:43 -0500
Subject: [PATCH 15/15] Upstream new lint rule docs and diagnostic message
changes (#6126)
These changes have been reviewed within the SDK already :)
---
src/_data/linter_rules.json | 981 ++++++++++++-----------
src/content/tools/diagnostic-messages.md | 63 +-
2 files changed, 526 insertions(+), 518 deletions(-)
diff --git a/src/_data/linter_rules.json b/src/_data/linter_rules.json
index a3a88df4fc..0233c8aac5 100644
--- a/src/_data/linter_rules.json
+++ b/src/_data/linter_rules.json
@@ -9,8 +9,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** declare method return types.\n\nWhen declaring a method or function *always* specify a return type.\nDeclaring return types for functions helps improve your codebase by allowing the\nanalyzer to more adequately check your code for errors that could occur during\nruntime.\n\n**BAD:**\n```dart\nmain() { }\n\n_bar() => _Foo();\n\nclass _Foo {\n _foo() => 42;\n}\n```\n\n**GOOD:**\n```dart\nvoid main() { }\n\n_Foo _bar() => _Foo();\n\nclass _Foo {\n int _foo() => 42;\n}\n\ntypedef predicate = bool Function(Object o);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** declare method return types.\n\nWhen declaring a method or function *always* specify a return type.\nDeclaring return types for functions helps improve your codebase by allowing the\nanalyzer to more adequately check your code for errors that could occur during\nruntime.\n\n**BAD:**\n```dart\nmain() { }\n\n_bar() => _Foo();\n\nclass _Foo {\n _foo() => 42;\n}\n```\n\n**GOOD:**\n```dart\nvoid main() { }\n\n_Foo _bar() => _Foo();\n\nclass _Foo {\n int _foo() => 42;\n}\n\ntypedef predicate = bool Function(Object o);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "always_put_control_body_on_new_line",
@@ -23,8 +23,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "From the [style guide for the flutter repo](https://flutter.dev/style-guide/):\n\n**DO** separate the control structure expression from its statement.\n\nDon't put the statement part of an `if`, `for`, `while`, `do` on the same line\nas the expression, even if it is short. Doing so makes it unclear that there\nis relevant code there. This is especially important for early returns.\n\n**BAD:**\n```dart\nif (notReady) return;\n\nif (notReady)\n return;\nelse print('ok')\n\nwhile (condition) i += 1;\n```\n\n**GOOD:**\n```dart\nif (notReady)\n return;\n\nif (notReady)\n return;\nelse\n print('ok')\n\nwhile (condition)\n i += 1;\n```\n\nNote that this rule can conflict with the\n[Dart formatter](https://dart.dev/tools/dart-format), and should not be enabled\nwhen the Dart formatter is used.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From the [style guide for the flutter repo](https://flutter.dev/style-guide/):\n\n**DO** separate the control structure expression from its statement.\n\nDon't put the statement part of an `if`, `for`, `while`, `do` on the same line\nas the expression, even if it is short. Doing so makes it unclear that there\nis relevant code there. This is especially important for early returns.\n\n**BAD:**\n```dart\nif (notReady) return;\n\nif (notReady)\n return;\nelse print('ok')\n\nwhile (condition) i += 1;\n```\n\n**GOOD:**\n```dart\nif (notReady)\n return;\n\nif (notReady)\n return;\nelse\n print('ok')\n\nwhile (condition)\n i += 1;\n```\n\nNote that this rule can conflict with the\n[Dart formatter](https://dart.dev/tools/dart-format), and should not be enabled\nwhen the Dart formatter is used.",
+ "sinceDartSdk": "2.0"
},
{
"name": "always_put_required_named_parameters_first",
@@ -36,8 +36,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** specify `required` on named parameter before other named parameters.\n\n**BAD:**\n```dart\nm({b, c, required a}) ;\n```\n\n**GOOD:**\n```dart\nm({required a, b, c}) ;\n```\n\n**BAD:**\n```dart\nm({b, c, @required a}) ;\n```\n\n**GOOD:**\n```dart\nm({@required a, b, c}) ;\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** specify `required` on named parameter before other named parameters.\n\n**BAD:**\n```dart\nm({b, c, required a}) ;\n```\n\n**GOOD:**\n```dart\nm({required a, b, c}) ;\n```\n\n**BAD:**\n```dart\nm({b, c, @required a}) ;\n```\n\n**GOOD:**\n```dart\nm({@required a, b, c}) ;\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "always_require_non_null_named_parameters",
@@ -47,8 +47,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DO** specify `@required` on named parameters without a default value on which \nan `assert(param != null)` is done.\n\n**BAD:**\n```dart\nm1({a}) {\n assert(a != null);\n}\n```\n\n**GOOD:**\n```dart\nm1({@required a}) {\n assert(a != null);\n}\n\nm2({a: 1}) {\n assert(a != null);\n}\n```\n\nNOTE: Only asserts at the start of the bodies will be taken into account.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DO** specify `@required` on named parameters without a default value on which\nan `assert(param != null)` is done.\n\n**BAD:**\n```dart\nm1({a}) {\n assert(a != null);\n}\n```\n\n**GOOD:**\n```dart\nm1({@required a}) {\n assert(a != null);\n}\n\nm2({a: 1}) {\n assert(a != null);\n}\n```\n\nNOTE: Only asserts at the start of the bodies will be taken into account.",
+ "sinceDartSdk": "2.0"
},
{
"name": "always_specify_types",
@@ -64,8 +64,8 @@
],
"sets": [],
"fixStatus": "hasFix",
- "details": "From the [style guide for the flutter repo](https://flutter.dev/style-guide/):\n\n**DO** specify type annotations.\n\nAvoid `var` when specifying that a type is unknown and short-hands that elide\ntype annotations. Use `dynamic` if you are being explicit that the type is\nunknown. Use `Object` if you are being explicit that you want an object that\nimplements `==` and `hashCode`.\n\n**BAD:**\n```dart\nvar foo = 10;\nfinal bar = Bar();\nconst quux = 20;\n```\n\n**GOOD:**\n```dart\nint foo = 10;\nfinal Bar bar = Bar();\nString baz = 'hello';\nconst int quux = 20;\n```\n\nNOTE: Using the the `@optionalTypeArgs` annotation in the `meta` package, API\nauthors can special-case type variables whose type needs to be dynamic but whose\ndeclaration should be treated as optional. For example, suppose you have a\n`Key` object whose type parameter you'd like to treat as optional. Using the\n`@optionalTypeArgs` would look like this:\n\n```dart\nimport 'package:meta/meta.dart';\n\n@optionalTypeArgs\nclass Key {\n ...\n}\n\nmain() {\n Key s = Key(); // OK!\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From the [style guide for the flutter repo](https://flutter.dev/style-guide/):\n\n**DO** specify type annotations.\n\nAvoid `var` when specifying that a type is unknown and short-hands that elide\ntype annotations. Use `dynamic` if you are being explicit that the type is\nunknown. Use `Object` if you are being explicit that you want an object that\nimplements `==` and `hashCode`.\n\n**BAD:**\n```dart\nvar foo = 10;\nfinal bar = Bar();\nconst quux = 20;\n```\n\n**GOOD:**\n```dart\nint foo = 10;\nfinal Bar bar = Bar();\nString baz = 'hello';\nconst int quux = 20;\n```\n\nNOTE: Using the the `@optionalTypeArgs` annotation in the `meta` package, API\nauthors can special-case type parameters whose type needs to be dynamic but whose\ndeclaration should be treated as optional. For example, suppose you have a\n`Key` object whose type parameter you'd like to treat as optional. Using the\n`@optionalTypeArgs` would look like this:\n\n```dart\nimport 'package:meta/meta.dart';\n\n@optionalTypeArgs\nclass Key {\n ...\n}\n\nvoid main() {\n Key s = Key(); // OK!\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "always_use_package_imports",
@@ -79,8 +79,8 @@
],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** avoid relative imports for files in `lib/`.\n\nWhen mixing relative and absolute imports it's possible to create confusion\nwhere the same member gets imported in two different ways. One way to avoid\nthat is to ensure you consistently use absolute imports for files within the\n`lib/` directory.\n\nThis is the opposite of 'prefer_relative_imports'.\n\nYou can also use 'avoid_relative_lib_imports' to disallow relative imports of\nfiles within `lib/` directory outside of it (for example `test/`).\n\n**BAD:**\n```dart\nimport 'baz.dart';\n\nimport 'src/bag.dart'\n\nimport '../lib/baz.dart';\n\n...\n```\n\n**GOOD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport 'package:foo/baz.dart';\n\nimport 'package:foo/src/baz.dart';\n...\n```\n\n",
- "sinceDartSdk": "2.10.0"
+ "details": "**DO** avoid relative imports for files in `lib/`.\n\nWhen mixing relative and absolute imports it's possible to create confusion\nwhere the same member gets imported in two different ways. One way to avoid\nthat is to ensure you consistently use absolute imports for files within the\n`lib/` directory.\n\nThis is the opposite of 'prefer_relative_imports'.\n\nYou can also use 'avoid_relative_lib_imports' to disallow relative imports of\nfiles within `lib/` directory outside of it (for example `test/`).\n\n**BAD:**\n```dart\nimport 'baz.dart';\n\nimport 'src/bag.dart'\n\nimport '../lib/baz.dart';\n\n...\n```\n\n**GOOD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport 'package:foo/baz.dart';\n\nimport 'package:foo/src/baz.dart';\n...\n```",
+ "sinceDartSdk": "2.10"
},
{
"name": "annotate_overrides",
@@ -95,8 +95,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** annotate overridden methods and fields.\n\nThis practice improves code readability and helps protect against\nunintentionally overriding superclass members.\n\n**BAD:**\n```dart\nclass Cat {\n int get lives => 9;\n}\n\nclass Lucky extends Cat {\n final int lives = 14;\n}\n```\n\n**GOOD:**\n```dart\nabstract class Dog {\n String get breed;\n void bark() {}\n}\n\nclass Husky extends Dog {\n @override\n final String breed = 'Husky';\n @override\n void bark() {}\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** annotate overridden methods and fields.\n\nThis practice improves code readability and helps protect against\nunintentionally overriding superclass members.\n\n**BAD:**\n```dart\nclass Cat {\n int get lives => 9;\n}\n\nclass Lucky extends Cat {\n final int lives = 14;\n}\n```\n\n**GOOD:**\n```dart\nabstract class Dog {\n String get breed;\n void bark() {}\n}\n\nclass Husky extends Dog {\n @override\n final String breed = 'Husky';\n @override\n void bark() {}\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "annotate_redeclares",
@@ -108,8 +108,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** annotate redeclared members.\n\nThis practice improves code readability and helps protect against\nunintentionally redeclaring members or being surprised when a member ceases to\nredeclare (due for example to a rename refactoring).\n\n**BAD:**\n```dart\nclass C {\n void f() { }\n}\n\nextension type E(C c) implements C {\n void f() {\n ...\n }\n}\n```\n\n**GOOD:**\n```dart\nimport 'package:meta/meta.dart';\n\nclass C {\n void f() { }\n}\n\nextension type E(C c) implements C {\n @redeclare\n void f() {\n ...\n }\n}\n```\n",
- "sinceDartSdk": "3.2.0"
+ "details": "**DO** annotate redeclared members.\n\nThis practice improves code readability and helps protect against\nunintentionally redeclaring members or being surprised when a member ceases to\nredeclare (due for example to a rename refactoring).\n\n**BAD:**\n```dart\nclass C {\n void f() { }\n}\n\nextension type E(C c) implements C {\n void f() {\n ...\n }\n}\n```\n\n**GOOD:**\n```dart\nimport 'package:meta/meta.dart';\n\nclass C {\n void f() { }\n}\n\nextension type E(C c) implements C {\n @redeclare\n void f() {\n ...\n }\n}\n```",
+ "sinceDartSdk": "3.2"
},
{
"name": "avoid_annotating_with_dynamic",
@@ -122,8 +122,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**AVOID** annotating with `dynamic` when not required.\n\nAs `dynamic` is the assumed return value of a function or method, it is usually\nnot necessary to annotate it.\n\n**BAD:**\n```dart\ndynamic lookUpOrDefault(String name, Map map, dynamic defaultValue) {\n var value = map[name];\n if (value != null) return value;\n return defaultValue;\n}\n```\n\n**GOOD:**\n```dart\nlookUpOrDefault(String name, Map map, defaultValue) {\n var value = map[name];\n if (value != null) return value;\n return defaultValue;\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** annotating with `dynamic` when not required.\n\nAs `dynamic` is the assumed return value of a function or method, it is usually\nnot necessary to annotate it.\n\n**BAD:**\n```dart\ndynamic lookUpOrDefault(String name, Map map, dynamic defaultValue) {\n var value = map[name];\n if (value != null) return value;\n return defaultValue;\n}\n```\n\n**GOOD:**\n```dart\nlookUpOrDefault(String name, Map map, defaultValue) {\n var value = map[name];\n if (value != null) return value;\n return defaultValue;\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_as",
@@ -133,8 +133,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule was removed from the SDK in Dart 3; it is no longer functional.\nIts advice is compiler-specific and mostly obsolete with null safety.\n\n**AVOID** using `as`.\n\nIf you know the type is correct, use an assertion or assign to a more\nnarrowly-typed variable (this avoids the type check in release mode; `as` is not\ncompiled out in release mode). If you don't know whether the type is\ncorrect, check using `is` (this avoids the exception that `as` raises).\n\n**BAD:**\n```dart\n(pm as Person).firstName = 'Seth';\n```\n\n**GOOD:**\n```dart\nif (pm is Person)\n pm.firstName = 'Seth';\n```\n\nbut certainly not\n\n**BAD:**\n```dart\ntry {\n (pm as Person).firstName = 'Seth';\n} on CastError { }\n```\n\nNote that an exception is made in the case of `dynamic` since the cast has no\nperformance impact.\n\n**OK:**\n```dart\nHasScrollDirection scrollable = renderObject as dynamic;\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule was removed from the SDK in Dart 3; it is no longer functional.\nIts advice is compiler-specific and mostly obsolete with null safety.\n\n**AVOID** using `as`.\n\nIf you know the type is correct, use an assertion or assign to a more\nnarrowly-typed variable (this avoids the type check in release mode; `as` is not\ncompiled out in release mode). If you don't know whether the type is\ncorrect, check using `is` (this avoids the exception that `as` raises).\n\n**BAD:**\n```dart\n(pm as Person).firstName = 'Seth';\n```\n\n**GOOD:**\n```dart\nif (pm is Person)\n pm.firstName = 'Seth';\n```\n\nbut certainly not\n\n**BAD:**\n```dart\ntry {\n (pm as Person).firstName = 'Seth';\n} on CastError { }\n```\n\nNote that an exception is made in the case of `dynamic` since the cast has no\nperformance impact.\n\n**OK:**\n```dart\nHasScrollDirection scrollable = renderObject as dynamic;\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_bool_literals_in_conditional_expressions",
@@ -146,8 +146,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**AVOID** `bool` literals in conditional expressions.\n\n**BAD:**\n```dart\ncondition ? true : boolExpression\ncondition ? false : boolExpression\ncondition ? boolExpression : true\ncondition ? boolExpression : false\n```\n\n**GOOD:**\n```dart\ncondition || boolExpression\n!condition && boolExpression\n!condition || boolExpression\ncondition && boolExpression\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** `bool` literals in conditional expressions.\n\n**BAD:**\n```dart\ncondition ? true : boolExpression\ncondition ? false : boolExpression\ncondition ? boolExpression : true\ncondition ? boolExpression : false\n```\n\n**GOOD:**\n```dart\ncondition || boolExpression\n!condition && boolExpression\n!condition || boolExpression\ncondition && boolExpression\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_catches_without_on_clauses",
@@ -160,8 +160,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#avoid-catches-without-on-clauses):\n\n**AVOID** catches without on clauses.\n\nUsing catch clauses without on clauses make your code prone to encountering\nunexpected errors that won't be thrown (and thus will go unnoticed).\n\n**BAD:**\n```dart\ntry {\n somethingRisky()\n} catch(e) {\n doSomething(e);\n}\n```\n\n**GOOD:**\n```dart\ntry {\n somethingRisky()\n} on Exception catch(e) {\n doSomething(e);\n}\n```\n\nA few exceptional cases are allowed:\n\n* If the body of the catch rethrows the exception.\n* If the caught exception is \"directly used\" in an argument to `Future.error`,\n `Completer.completeError`, or `FlutterError.reportError`, or any function with\n a return type of `Never`.\n* If the caught exception is \"directly used\" in a new throw-expression.\n\nIn these cases, \"directly used\" means that the exception is referenced within\nthe relevant code (like within an argument). If the exception variable is\nreferenced _before_ the relevant code, for example to instantiate a wrapper\nexception, the variable is not \"directly used.\"\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#avoid-catches-without-on-clauses):\n\n**AVOID** catches without on clauses.\n\nUsing catch clauses without on clauses make your code prone to encountering\nunexpected errors that won't be thrown (and thus will go unnoticed).\n\n**BAD:**\n```dart\ntry {\n somethingRisky()\n} catch(e) {\n doSomething(e);\n}\n```\n\n**GOOD:**\n```dart\ntry {\n somethingRisky()\n} on Exception catch(e) {\n doSomething(e);\n}\n```\n\nA few exceptional cases are allowed:\n\n* If the body of the catch rethrows the exception.\n* If the caught exception is \"directly used\" in an argument to `Future.error`,\n `Completer.completeError`, or `FlutterError.reportError`, or any function with\n a return type of `Never`.\n* If the caught exception is \"directly used\" in a new throw-expression.\n\nIn these cases, \"directly used\" means that the exception is referenced within\nthe relevant code (like within an argument). If the exception variable is\nreferenced _before_ the relevant code, for example to instantiate a wrapper\nexception, the variable is not \"directly used.\"",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_catching_errors",
@@ -173,8 +173,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DON'T** explicitly catch `Error` or types that implement it.\n\nErrors differ from Exceptions in that Errors can be analyzed and prevented prior\nto runtime. It should almost never be necessary to catch an error at runtime.\n\n**BAD:**\n```dart\ntry {\n somethingRisky();\n} on Error catch(e) {\n doSomething(e);\n}\n```\n\n**GOOD:**\n```dart\ntry {\n somethingRisky();\n} on Exception catch(e) {\n doSomething(e);\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** explicitly catch `Error` or types that implement it.\n\nErrors differ from Exceptions in that Errors can be analyzed and prevented prior\nto runtime. It should almost never be necessary to catch an error at runtime.\n\n**BAD:**\n```dart\ntry {\n somethingRisky();\n} on Error catch(e) {\n doSomething(e);\n}\n```\n\n**GOOD:**\n```dart\ntry {\n somethingRisky();\n} on Exception catch(e) {\n doSomething(e);\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_classes_with_only_static_members",
@@ -188,8 +188,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-defining-a-class-that-contains-only-static-members):\n\n**AVOID** defining a class that contains only static members.\n\nCreating classes with the sole purpose of providing utility or otherwise static\nmethods is discouraged. Dart allows functions to exist outside of classes for\nthis very reason.\n\n**BAD:**\n```dart\nclass DateUtils {\n static DateTime mostRecent(List dates) {\n return dates.reduce((a, b) => a.isAfter(b) ? a : b);\n }\n}\n\nclass _Favorites {\n static const mammal = 'weasel';\n}\n```\n\n**GOOD:**\n```dart\nDateTime mostRecent(List dates) {\n return dates.reduce((a, b) => a.isAfter(b) ? a : b);\n}\n\nconst _favoriteMammal = 'weasel';\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-defining-a-class-that-contains-only-static-members):\n\n**AVOID** defining a class that contains only static members.\n\nCreating classes with the sole purpose of providing utility or otherwise static\nmethods is discouraged. Dart allows functions to exist outside of classes for\nthis very reason.\n\n**BAD:**\n```dart\nclass DateUtils {\n static DateTime mostRecent(List dates) {\n return dates.reduce((a, b) => a.isAfter(b) ? a : b);\n }\n}\n\nclass _Favorites {\n static const mammal = 'weasel';\n}\n```\n\n**GOOD:**\n```dart\nDateTime mostRecent(List dates) {\n return dates.reduce((a, b) => a.isAfter(b) ? a : b);\n}\n\nconst _favoriteMammal = 'weasel';\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_double_and_int_checks",
@@ -202,8 +202,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**AVOID** to check if type is `double` or `int`.\n\nWhen compiled to JS, integer values are represented as floats. That can lead to\nsome unexpected behavior when using either `is` or `is!` where the type is\neither `int` or `double`.\n\n**BAD:**\n```dart\nf(num x) {\n if (x is double) {\n ...\n } else if (x is int) {\n ...\n }\n}\n```\n\n**GOOD:**\n```dart\nf(dynamic x) {\n if (x is num) {\n ...\n } else {\n ...\n }\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** to check if type is `double` or `int`.\n\nWhen compiled to JS, integer values are represented as floats. That can lead to\nsome unexpected behavior when using either `is` or `is!` where the type is\neither `int` or `double`.\n\n**BAD:**\n```dart\nf(num x) {\n if (x is double) {\n ...\n } else if (x is int) {\n ...\n }\n}\n```\n\n**GOOD:**\n```dart\nf(dynamic x) {\n if (x is num) {\n ...\n } else {\n ...\n }\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_dynamic_calls",
@@ -216,8 +216,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DO** avoid method calls or accessing properties on an object that is either\nexplicitly or implicitly statically typed `dynamic`. Dynamic calls are treated\nslightly different in every runtime environment and compiler, but most\nproduction modes (and even some development modes) have both compile size and\nruntime performance penalties associated with dynamic calls.\n\nAdditionally, targets typed `dynamic` disables most static analysis, meaning it\nis easier to lead to a runtime `NoSuchMethodError` or `TypeError` than properly\nstatically typed Dart code.\n\nThere is an exception to methods and properties that exist on `Object?`:\n- `a.hashCode`\n- `a.runtimeType`\n- `a.noSuchMethod(someInvocation)`\n- `a.toString()`\n\n... these members are dynamically dispatched in the web-based runtimes, but not\nin the VM-based ones. Additionally, they are so common that it would be very\npunishing to disallow `any.toString()` or `any == true`, for example.\n\nNote that despite `Function` being a type, the semantics are close to identical\nto `dynamic`, and calls to an object that is typed `Function` will also trigger\nthis lint.\n\nDynamic calls are allowed on cast expressions (`as dynamic` or `as Function`).\n\n**BAD:**\n```dart\nvoid explicitDynamicType(dynamic object) {\n print(object.foo());\n}\n\nvoid implicitDynamicType(object) {\n print(object.foo());\n}\n\nabstract class SomeWrapper {\n T doSomething();\n}\n\nvoid inferredDynamicType(SomeWrapper wrapper) {\n var object = wrapper.doSomething();\n print(object.foo());\n}\n\nvoid callDynamic(dynamic function) {\n function();\n}\n\nvoid functionType(Function function) {\n function();\n}\n```\n\n**GOOD:**\n```dart\nvoid explicitType(Fooable object) {\n object.foo();\n}\n\nvoid castedType(dynamic object) {\n (object as Fooable).foo();\n}\n\nabstract class SomeWrapper {\n T doSomething();\n}\n\nvoid inferredType(SomeWrapper wrapper) {\n var object = wrapper.doSomething();\n object.foo();\n}\n\nvoid functionTypeWithParameters(Function() function) {\n function();\n}\n```\n\n",
- "sinceDartSdk": "2.12.0"
+ "details": "**DO** avoid method calls or accessing properties on an object that is either\nexplicitly or implicitly statically typed `dynamic`. Dynamic calls are treated\nslightly different in every runtime environment and compiler, but most\nproduction modes (and even some development modes) have both compile size and\nruntime performance penalties associated with dynamic calls.\n\nAdditionally, targets typed `dynamic` disables most static analysis, meaning it\nis easier to lead to a runtime `NoSuchMethodError` or `TypeError` than properly\nstatically typed Dart code.\n\nThere is an exception to methods and properties that exist on `Object?`:\n- `a.hashCode`\n- `a.runtimeType`\n- `a.noSuchMethod(someInvocation)`\n- `a.toString()`\n\n... these members are dynamically dispatched in the web-based runtimes, but not\nin the VM-based ones. Additionally, they are so common that it would be very\npunishing to disallow `any.toString()` or `any == true`, for example.\n\nNote that despite `Function` being a type, the semantics are close to identical\nto `dynamic`, and calls to an object that is typed `Function` will also trigger\nthis lint.\n\nDynamic calls are allowed on cast expressions (`as dynamic` or `as Function`).\n\n**BAD:**\n```dart\nvoid explicitDynamicType(dynamic object) {\n print(object.foo());\n}\n\nvoid implicitDynamicType(object) {\n print(object.foo());\n}\n\nabstract class SomeWrapper {\n T doSomething();\n}\n\nvoid inferredDynamicType(SomeWrapper wrapper) {\n var object = wrapper.doSomething();\n print(object.foo());\n}\n\nvoid callDynamic(dynamic function) {\n function();\n}\n\nvoid functionType(Function function) {\n function();\n}\n```\n\n**GOOD:**\n```dart\nvoid explicitType(Fooable object) {\n object.foo();\n}\n\nvoid castedType(dynamic object) {\n (object as Fooable).foo();\n}\n\nabstract class SomeWrapper {\n T doSomething();\n}\n\nvoid inferredType(SomeWrapper wrapper) {\n var object = wrapper.doSomething();\n object.foo();\n}\n\nvoid functionTypeWithParameters(Function() function) {\n function();\n}\n```",
+ "sinceDartSdk": "2.12"
},
{
"name": "avoid_empty_else",
@@ -234,8 +234,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** empty statements in the `else` clause of `if` statements.\n\n**BAD:**\n```dart\nif (x > y)\n print('1');\nelse ;\n print('2');\n```\n\nIf you want a statement that follows the empty clause to _conditionally_ run,\nremove the dangling semicolon to include it in the `else` clause.\nOptionally, also enclose the else's statement in a block.\n\n**GOOD:**\n```dart\nif (x > y)\n print('1');\nelse\n print('2');\n```\n\n**GOOD:**\n```dart\nif (x > y) {\n print('1');\n} else {\n print('2');\n}\n```\n\nIf you want a statement that follows the empty clause to _unconditionally_ run,\nremove the `else` clause.\n\n**GOOD:**\n```dart\nif (x > y) print('1');\n\nprint('2');\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** empty statements in the `else` clause of `if` statements.\n\n**BAD:**\n```dart\nif (x > y)\n print('1');\nelse ;\n print('2');\n```\n\nIf you want a statement that follows the empty clause to _conditionally_ run,\nremove the dangling semicolon to include it in the `else` clause.\nOptionally, also enclose the else's statement in a block.\n\n**GOOD:**\n```dart\nif (x > y)\n print('1');\nelse\n print('2');\n```\n\n**GOOD:**\n```dart\nif (x > y) {\n print('1');\n} else {\n print('2');\n}\n```\n\nIf you want a statement that follows the empty clause to _unconditionally_ run,\nremove the `else` clause.\n\n**GOOD:**\n```dart\nif (x > y) print('1');\n\nprint('2');\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_equals_and_hash_code_on_mutable_classes",
@@ -248,8 +248,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-defining-custom-equality-for-mutable-classes):\n\n**AVOID** overloading operator == and hashCode on classes not marked `@immutable`.\n\nIf a class is not immutable, overloading `operator ==` and `hashCode` can\nlead to unpredictable and undesirable behavior when used in collections.\n\n**BAD:**\n```dart\nclass B {\n String key;\n const B(this.key);\n @override\n operator ==(other) => other is B && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```\n\n**GOOD:**\n```dart\n@immutable\nclass A {\n final String key;\n const A(this.key);\n @override\n operator ==(other) => other is A && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```\n\nNOTE: The lint checks the use of the `@immutable` annotation, and will trigger\neven if the class is otherwise not mutable. Thus:\n\n**BAD:**\n```dart\nclass C {\n final String key;\n const C(this.key);\n @override\n operator ==(other) => other is C && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```\n\n",
- "sinceDartSdk": "2.6.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-defining-custom-equality-for-mutable-classes):\n\n**AVOID** overloading operator == and hashCode on classes not marked `@immutable`.\n\nIf a class is not immutable, overloading `operator ==` and `hashCode` can\nlead to unpredictable and undesirable behavior when used in collections.\n\n**BAD:**\n```dart\nclass B {\n String key;\n const B(this.key);\n @override\n operator ==(other) => other is B && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```\n\n**GOOD:**\n```dart\n@immutable\nclass A {\n final String key;\n const A(this.key);\n @override\n operator ==(other) => other is A && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```\n\nNOTE: The lint checks the use of the `@immutable` annotation, and will trigger\neven if the class is otherwise not mutable. Thus:\n\n**BAD:**\n```dart\nclass C {\n final String key;\n const C(this.key);\n @override\n operator ==(other) => other is C && other.key == key;\n @override\n int get hashCode => key.hashCode;\n}\n```",
+ "sinceDartSdk": "2.6"
},
{
"name": "avoid_escaping_inner_quotes",
@@ -261,8 +261,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Avoid escaping inner quotes by converting surrounding quotes.\n\n**BAD:**\n```dart\nvar s = 'It\\'s not fun';\n```\n\n**GOOD:**\n```dart\nvar s = \"It's not fun\";\n```\n\n",
- "sinceDartSdk": "2.8.1"
+ "details": "Avoid escaping inner quotes by converting surrounding quotes.\n\n**BAD:**\n```dart\nvar s = 'It\\'s not fun';\n```\n\n**GOOD:**\n```dart\nvar s = \"It's not fun\";\n```",
+ "sinceDartSdk": "2.8"
},
{
"name": "avoid_field_initializers_in_const_classes",
@@ -274,8 +274,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**AVOID** field initializers in const classes.\n\nInstead of `final x = const expr;`, you should write `get x => const expr;` and\nnot allocate a useless field. As of April 2018 this is true for the VM, but not\nfor code that will be compiled to JS.\n\n**BAD:**\n```dart\nclass A {\n final a = const [];\n const A();\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n get a => const [];\n const A();\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** field initializers in const classes.\n\nInstead of `final x = const expr;`, you should write `get x => const expr;` and\nnot allocate a useless field. As of April 2018 this is true for the VM, but not\nfor code that will be compiled to JS.\n\n**BAD:**\n```dart\nclass A {\n final a = const [];\n const A();\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n get a => const [];\n const A();\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_final_parameters",
@@ -289,8 +289,8 @@
],
"sets": [],
"fixStatus": "needsFix",
- "details": "**AVOID** declaring parameters as `final`.\n\nDeclaring parameters as `final` can lead to unnecessarily verbose code,\nespecially when using the \"parameter_assignments\" rule.\n\n**BAD:**\n```dart\nvoid goodParameter(final String label) { // LINT\n print(label);\n}\n```\n\n**GOOD:**\n```dart\nvoid badParameter(String label) { // OK\n print(label);\n}\n```\n\n**BAD:**\n```dart\nvoid goodExpression(final int value) => print(value); // LINT\n```\n\n**GOOD:**\n```dart\nvoid badExpression(int value) => print(value); // OK\n```\n\n**BAD:**\n```dart\n[1, 4, 6, 8].forEach((final value) => print(value + 2)); // LINT\n```\n\n**GOOD:**\n```dart\n[1, 4, 6, 8].forEach((value) => print(value + 2)); // OK\n```\n\n",
- "sinceDartSdk": "2.16.0"
+ "details": "**AVOID** declaring parameters as `final`.\n\nDeclaring parameters as `final` can lead to unnecessarily verbose code,\nespecially when using the \"parameter_assignments\" rule.\n\n**BAD:**\n```dart\nvoid goodParameter(final String label) { // LINT\n print(label);\n}\n```\n\n**GOOD:**\n```dart\nvoid badParameter(String label) { // OK\n print(label);\n}\n```\n\n**BAD:**\n```dart\nvoid goodExpression(final int value) => print(value); // LINT\n```\n\n**GOOD:**\n```dart\nvoid badExpression(int value) => print(value); // OK\n```\n\n**BAD:**\n```dart\n[1, 4, 6, 8].forEach((final value) => print(value + 2)); // LINT\n```\n\n**GOOD:**\n```dart\n[1, 4, 6, 8].forEach((value) => print(value + 2)); // OK\n```",
+ "sinceDartSdk": "2.16"
},
{
"name": "avoid_function_literals_in_foreach_calls",
@@ -305,8 +305,21 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** using `forEach` with a function literal.\n\nThe `for` loop enables a developer to be clear and explicit as to their intent.\nA return in the body of the `for` loop returns from the body of the function,\nwhere as a return in the body of the `forEach` closure only returns a value\nfor that iteration of the `forEach`. The body of a `for` loop can contain\n`await`s, while the closure body of a `forEach` cannot.\n\n**BAD:**\n```dart\npeople.forEach((person) {\n ...\n});\n```\n\n**GOOD:**\n```dart\nfor (var person in people) {\n ...\n}\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** using `forEach` with a function literal.\n\nThe `for` loop enables a developer to be clear and explicit as to their intent.\nA return in the body of the `for` loop returns from the body of the function,\nwhere as a return in the body of the `forEach` closure only returns a value\nfor that iteration of the `forEach`. The body of a `for` loop can contain\n`await`s, while the closure body of a `forEach` cannot.\n\n**BAD:**\n```dart\npeople.forEach((person) {\n ...\n});\n```\n\n**GOOD:**\n```dart\nfor (var person in people) {\n ...\n}\n```",
+ "sinceDartSdk": "2.0"
+ },
+ {
+ "name": "avoid_futureor_void",
+ "description": "Avoid using 'FutureOr' as the type of a result.",
+ "categories": [
+ "errorProne"
+ ],
+ "state": "experimental",
+ "incompatible": [],
+ "sets": [],
+ "fixStatus": "noFix",
+ "details": "**AVOID** using `FutureOr` as the type of a result. This type is\nproblematic because it may appear to encode that a result is either a\n`Future`, or the result should be discarded (when it is `void`).\nHowever, there is no safe way to detect whether we have one or the other\ncase (because an expression of type `void` can evaluate to any object\nwhatsoever, including a future of any type).\n\nIt is also conceptually unsound to have a type whose meaning is something\nlike \"ignore this object; also, take a look because it might be a future\".\n\nAn exception is made for contravariant occurrences of the type\n`FutureOr` (e.g., for the type of a formal parameter), and no\nwarning is emitted for these occurrences. The reason for this exception\nis that the type does not describe a result, it describes a constraint\non a value provided by others. Similarly, an exception is made for type\nalias declarations, because they may well be used in a contravariant\nposition (e.g., as the type of a formal parameter). Hence, in type alias\ndeclarations, only the type parameter bounds are checked.\n\nA replacement for the type `FutureOr` which is often useful is\n`Future?`. This type encodes that the result is either a\n`Future` or it is null, and there is no ambiguity at run time\nsince no object can have both types.\n\nIt may not always be possible to use the type `Future?` as a\nreplacement for the type `FutureOr`, because the latter is a\nsupertype of all types, and the former is not. In this case it may be a\nuseful remedy to replace `FutureOr` by the type `void`.\n\n**BAD:**\n```dart\nFutureOr m() {...}\n```\n\n**GOOD:**\n```dart\nFuture? m() {...}\n```\n\n**This rule is experimental.** It is being evaluated, and it may be changed\nor removed. Feedback on its behavior is welcome! The main issue is here:\nhttps://github.com/dart-lang/linter/issues/4622",
+ "sinceDartSdk": "3.6-wip"
},
{
"name": "avoid_implementing_value_types",
@@ -318,8 +331,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DON'T** implement classes that override `==`.\n\nThe `==` operator is contractually required to be an equivalence relation;\nthat is, symmetrically for all objects `o1` and `o2`, `o1 == o2` and `o2 == o1`\nmust either both be true, or both be false.\n\n> _NOTE_: Dart does not have true _value types_, so instead we consider a class\n> that implements `==` as a _proxy_ for identifying value types.\n\nWhen using `implements`, you do not inherit the method body of `==`, making it\nnearly impossible to follow the contract of `==`. Classes that override `==`\ntypically are usable directly in tests _without_ creating mocks or fakes as\nwell. For example, for a given class `Size`:\n\n```dart\nclass Size {\n final int inBytes;\n const Size(this.inBytes);\n\n @override\n bool operator ==(Object other) => other is Size && other.inBytes == inBytes;\n\n @override\n int get hashCode => inBytes.hashCode;\n}\n```\n\n**BAD:**\n```dart\nclass CustomSize implements Size {\n final int inBytes;\n const CustomSize(this.inBytes);\n\n int get inKilobytes => inBytes ~/ 1000;\n}\n```\n\n**BAD:**\n```dart\nimport 'package:test/test.dart';\nimport 'size.dart';\n\nclass FakeSize implements Size {\n int inBytes = 0;\n}\n\nvoid main() {\n test('should not throw on a size >1Kb', () {\n expect(() => someFunction(FakeSize()..inBytes = 1001), returnsNormally);\n });\n}\n```\n\n**GOOD:**\n```dart\nclass ExtendedSize extends Size {\n ExtendedSize(int inBytes) : super(inBytes);\n\n int get inKilobytes => inBytes ~/ 1000;\n}\n```\n\n**GOOD:**\n```dart\nimport 'package:test/test.dart';\nimport 'size.dart';\n\nvoid main() {\n test('should not throw on a size >1Kb', () {\n expect(() => someFunction(Size(1001)), returnsNormally);\n });\n}\n```\n\n",
- "sinceDartSdk": "2.1.0"
+ "details": "**DON'T** implement classes that override `==`.\n\nThe `==` operator is contractually required to be an equivalence relation;\nthat is, symmetrically for all objects `o1` and `o2`, `o1 == o2` and `o2 == o1`\nmust either both be true, or both be false.\n\n> _NOTE_: Dart does not have true _value types_, so instead we consider a class\n> that implements `==` as a _proxy_ for identifying value types.\n\nWhen using `implements`, you do not inherit the method body of `==`, making it\nnearly impossible to follow the contract of `==`. Classes that override `==`\ntypically are usable directly in tests _without_ creating mocks or fakes as\nwell. For example, for a given class `Size`:\n\n```dart\nclass Size {\n final int inBytes;\n const Size(this.inBytes);\n\n @override\n bool operator ==(Object other) => other is Size && other.inBytes == inBytes;\n\n @override\n int get hashCode => inBytes.hashCode;\n}\n```\n\n**BAD:**\n```dart\nclass CustomSize implements Size {\n final int inBytes;\n const CustomSize(this.inBytes);\n\n int get inKilobytes => inBytes ~/ 1000;\n}\n```\n\n**BAD:**\n```dart\nimport 'package:test/test.dart';\nimport 'size.dart';\n\nclass FakeSize implements Size {\n int inBytes = 0;\n}\n\nvoid main() {\n test('should not throw on a size >1Kb', () {\n expect(() => someFunction(FakeSize()..inBytes = 1001), returnsNormally);\n });\n}\n```\n\n**GOOD:**\n```dart\nclass ExtendedSize extends Size {\n ExtendedSize(int inBytes) : super(inBytes);\n\n int get inKilobytes => inBytes ~/ 1000;\n}\n```\n\n**GOOD:**\n```dart\nimport 'package:test/test.dart';\nimport 'size.dart';\n\nvoid main() {\n test('should not throw on a size >1Kb', () {\n expect(() => someFunction(Size(1001)), returnsNormally);\n });\n}\n```",
+ "sinceDartSdk": "2.1"
},
{
"name": "avoid_init_to_null",
@@ -336,8 +349,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#dont-explicitly-initialize-variables-to-null):\n\n**DON'T** explicitly initialize variables to `null`.\n\nIf a variable has a non-nullable type or is `final`,\nDart reports a compile error if you try to use it\nbefore it has been definitely initialized.\nIf the variable is nullable and not `const` or `final`,\nthen it is implicitly initialized to `null` for you.\nThere's no concept of \"uninitialized memory\" in Dart\nand no need to explicitly initialize a variable to `null` to be \"safe\".\nAdding `= null` is redundant and unneeded.\n\n**BAD:**\n```dart\nItem? bestDeal(List- cart) {\n Item? bestItem = null;\n\n for (final item in cart) {\n if (bestItem == null || item.price < bestItem.price) {\n bestItem = item;\n }\n }\n\n return bestItem;\n}\n```\n\n**GOOD:**\n```dart\nItem? bestDeal(List
- cart) {\n Item? bestItem;\n\n for (final item in cart) {\n if (bestItem == null || item.price < bestItem.price) {\n bestItem = item;\n }\n }\n\n return bestItem;\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#dont-explicitly-initialize-variables-to-null):\n\n**DON'T** explicitly initialize variables to `null`.\n\nIf a variable has a non-nullable type or is `final`,\nDart reports a compile error if you try to use it\nbefore it has been definitely initialized.\nIf the variable is nullable and not `const` or `final`,\nthen it is implicitly initialized to `null` for you.\nThere's no concept of \"uninitialized memory\" in Dart\nand no need to explicitly initialize a variable to `null` to be \"safe\".\nAdding `= null` is redundant and unneeded.\n\n**BAD:**\n```dart\nItem? bestDeal(List
- cart) {\n Item? bestItem = null;\n\n for (final item in cart) {\n if (bestItem == null || item.price < bestItem.price) {\n bestItem = item;\n }\n }\n\n return bestItem;\n}\n```\n\n**GOOD:**\n```dart\nItem? bestDeal(List
- cart) {\n Item? bestItem;\n\n for (final item in cart) {\n if (bestItem == null || item.price < bestItem.price) {\n bestItem = item;\n }\n }\n\n return bestItem;\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_js_rounded_ints",
@@ -350,8 +363,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**AVOID** integer literals that cannot be represented exactly when compiled to\nJavaScript.\n\nWhen a program is compiled to JavaScript `int` and `double` become JavaScript\nNumbers. Too large integers (`value < Number.MIN_SAFE_INTEGER` or\n`value > Number.MAX_SAFE_INTEGER`) may be rounded to the closest Number value.\n\nFor instance `1000000000000000001` cannot be represented exactly as a JavaScript\nNumber, so `1000000000000000000` will be used instead.\n\n**BAD:**\n```dart\nint value = 9007199254740995;\n```\n\n**GOOD:**\n```dart\nBigInt value = BigInt.parse('9007199254740995');\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** integer literals that cannot be represented exactly when compiled to\nJavaScript.\n\nWhen a program is compiled to JavaScript `int` and `double` become JavaScript\nNumbers. Too large integers (`value < Number.MIN_SAFE_INTEGER` or\n`value > Number.MAX_SAFE_INTEGER`) may be rounded to the closest Number value.\n\nFor instance `1000000000000000001` cannot be represented exactly as a JavaScript\nNumber, so `1000000000000000000` will be used instead.\n\n**BAD:**\n```dart\nint value = 9007199254740995;\n```\n\n**GOOD:**\n```dart\nBigInt value = BigInt.parse('9007199254740995');\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_multiple_declarations_per_line",
@@ -363,8 +376,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DON'T** declare multiple variables on a single line.\n\n**BAD:**\n```dart\nString? foo, bar, baz;\n```\n\n**GOOD:**\n```dart\nString? foo;\nString? bar;\nString? baz;\n```\n\n",
- "sinceDartSdk": "2.13.0"
+ "details": "**DON'T** declare multiple variables on a single line.\n\n**BAD:**\n```dart\nString? foo, bar, baz;\n```\n\n**GOOD:**\n```dart\nString? foo;\nString? bar;\nString? baz;\n```",
+ "sinceDartSdk": "2.13"
},
{
"name": "avoid_null_checks_in_equality_operators",
@@ -376,8 +389,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DON'T** check for `null` in custom `==` operators.\n\nAs `null` is a special value, no instance of any class (other than `Null`) can\nbe equivalent to it. Thus, it is redundant to check whether the other instance\nis `null`.\n\n**BAD:**\n```dart\nclass Person {\n final String? name;\n\n @override\n operator ==(Object? other) =>\n other != null && other is Person && name == other.name;\n}\n```\n\n**GOOD:**\n```dart\nclass Person {\n final String? name;\n\n @override\n operator ==(Object? other) => other is Person && name == other.name;\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** check for `null` in custom `==` operators.\n\nAs `null` is a special value, no instance of any class (other than `Null`) can\nbe equivalent to it. Thus, it is redundant to check whether the other instance\nis `null`.\n\n**BAD:**\n```dart\nclass Person {\n final String? name;\n\n @override\n operator ==(Object? other) =>\n other != null && other is Person && name == other.name;\n}\n```\n\n**GOOD:**\n```dart\nclass Person {\n final String? name;\n\n @override\n operator ==(Object? other) => other is Person && name == other.name;\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_positional_boolean_parameters",
@@ -390,8 +403,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-positional-boolean-parameters):\n\n**AVOID** positional boolean parameters.\n\nPositional boolean parameters are a bad practice because they are very\nambiguous. Using named boolean parameters is much more readable because it\ninherently describes what the boolean value represents.\n\n**BAD:**\n```dart\nTask(true);\nTask(false);\nListBox(false, true, true);\nButton(false);\n```\n\n**GOOD:**\n```dart\nTask.oneShot();\nTask.repeating();\nListBox(scroll: true, showScrollbars: true);\nButton(ButtonState.enabled);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-positional-boolean-parameters):\n\n**AVOID** positional boolean parameters.\n\nPositional boolean parameters are a bad practice because they are very\nambiguous. Using named boolean parameters is much more readable because it\ninherently describes what the boolean value represents.\n\n**BAD:**\n```dart\nTask(true);\nTask(false);\nListBox(false, true, true);\nButton(false);\n```\n\n**GOOD:**\n```dart\nTask.oneShot();\nTask.repeating();\nListBox(scroll: true, showScrollbars: true);\nButton(ButtonState.enabled);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_print",
@@ -405,8 +418,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** avoid `print` calls in production code.\n\nFor production code, consider using a logging framework.\nIf you are using Flutter, you can use `debugPrint`\nor surround `print` calls with a check for `kDebugMode`\n\n**BAD:**\n```dart\nvoid f(int x) {\n print('debug: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n debugPrint('debug: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n log('log: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n if (kDebugMode) {\n print('debug: $x');\n }\n ...\n}\n```\n",
- "sinceDartSdk": "2.5.0"
+ "details": "**DO** avoid `print` calls in production code.\n\nFor production code, consider using a logging framework.\nIf you are using Flutter, you can use `debugPrint`\nor surround `print` calls with a check for `kDebugMode`\n\n**BAD:**\n```dart\nvoid f(int x) {\n print('debug: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n debugPrint('debug: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n log('log: $x');\n ...\n}\n```\n\n\n**GOOD:**\n```dart\nvoid f(int x) {\n if (kDebugMode) {\n print('debug: $x');\n }\n ...\n}\n```",
+ "sinceDartSdk": "2.5"
},
{
"name": "avoid_private_typedef_functions",
@@ -418,8 +431,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**AVOID** private typedef functions used only once. Prefer inline function\nsyntax.\n\n**BAD:**\n```dart\ntypedef void _F();\nm(_F f);\n```\n\n**GOOD:**\n```dart\nm(void Function() f);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** private typedef functions used only once. Prefer inline function\nsyntax.\n\n**BAD:**\n```dart\ntypedef void _F();\nm(_F f);\n```\n\n**GOOD:**\n```dart\nm(void Function() f);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_redundant_argument_values",
@@ -432,8 +445,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DON'T** pass an argument that matches the corresponding parameter's default\nvalue.\n\nNote that a method override can change the default value of a parameter, so that\nan argument may be equal to one default value, and not the other. Take, for\nexample, two classes, `A` and `B` where `B` is a subclass of `A`, and `B`\noverrides a method declared on `A`, and that method has a parameter with one\ndefault value in `A`'s declaration, and a different default value in `B`'s\ndeclaration. If the static type of the target of the invoked method is `B`, and\n`B`'s default value matches the argument, then the argument can be omitted (and\nif the argument value is different, then a lint is not reported). If, however,\nthe static type of the target of the invoked method is `A`, then a lint may be\nreported, but we cannot know statically which method is invoked, so the reported\nlint may be a false positive. Such cases can be ignored inline with a comment\nlike `// ignore: avoid_redundant_argument_values`.\n\n**BAD:**\n```dart\nvoid f({bool valWithDefault = true, bool? val}) {\n ...\n}\n\nvoid main() {\n f(valWithDefault: true);\n}\n```\n\n**GOOD:**\n```dart\nvoid f({bool valWithDefault = true, bool? val}) {\n ...\n}\n\nvoid main() {\n f(valWithDefault: false);\n f();\n}\n```\n",
- "sinceDartSdk": "2.8.1"
+ "details": "**DON'T** pass an argument that matches the corresponding parameter's default\nvalue.\n\nNote that a method override can change the default value of a parameter, so that\nan argument may be equal to one default value, and not the other. Take, for\nexample, two classes, `A` and `B` where `B` is a subclass of `A`, and `B`\noverrides a method declared on `A`, and that method has a parameter with one\ndefault value in `A`'s declaration, and a different default value in `B`'s\ndeclaration. If the static type of the target of the invoked method is `B`, and\n`B`'s default value matches the argument, then the argument can be omitted (and\nif the argument value is different, then a lint is not reported). If, however,\nthe static type of the target of the invoked method is `A`, then a lint may be\nreported, but we cannot know statically which method is invoked, so the reported\nlint may be a false positive. Such cases can be ignored inline with a comment\nlike `// ignore: avoid_redundant_argument_values`.\n\n**BAD:**\n```dart\nvoid f({bool valWithDefault = true, bool? val}) {\n ...\n}\n\nvoid main() {\n f(valWithDefault: true);\n}\n```\n\n**GOOD:**\n```dart\nvoid f({bool valWithDefault = true, bool? val}) {\n ...\n}\n\nvoid main() {\n f(valWithDefault: false);\n f();\n}\n```",
+ "sinceDartSdk": "2.8"
},
{
"name": "avoid_relative_lib_imports",
@@ -449,8 +462,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** avoid relative imports for files in `lib/`.\n\nWhen mixing relative and absolute imports it's possible to create confusion\nwhere the same member gets imported in two different ways. An easy way to avoid\nthat is to ensure you have no relative imports that include `lib/` in their\npaths.\n\nYou can also use 'always_use_package_imports' to disallow relative imports\nbetween files within `lib/`.\n\n**BAD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport '../lib/baz.dart';\n\n...\n```\n\n**GOOD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport 'baz.dart';\n\n...\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** avoid relative imports for files in `lib/`.\n\nWhen mixing relative and absolute imports it's possible to create confusion\nwhere the same member gets imported in two different ways. An easy way to avoid\nthat is to ensure you have no relative imports that include `lib/` in their\npaths.\n\nYou can also use 'always_use_package_imports' to disallow relative imports\nbetween files within `lib/`.\n\n**BAD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport '../lib/baz.dart';\n\n...\n```\n\n**GOOD:**\n```dart\nimport 'package:foo/bar.dart';\n\nimport 'baz.dart';\n\n...\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_renaming_method_parameters",
@@ -465,8 +478,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** rename parameters of overridden methods.\n\nMethods that override another method, but do not have their own documentation\ncomment, will inherit the overridden method's comment when `dart doc` produces\ndocumentation. If the inherited method contains the name of the parameter (in\nsquare brackets), then `dart doc` cannot link it correctly.\n\n**BAD:**\n```dart\nabstract class A {\n m(a);\n}\n\nabstract class B extends A {\n m(b);\n}\n```\n\n**GOOD:**\n```dart\nabstract class A {\n m(a);\n}\n\nabstract class B extends A {\n m(a);\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** rename parameters of overridden methods.\n\nMethods that override another method, but do not have their own documentation\ncomment, will inherit the overridden method's comment when `dart doc` produces\ndocumentation. If the inherited method contains the name of the parameter (in\nsquare brackets), then `dart doc` cannot link it correctly.\n\n**BAD:**\n```dart\nabstract class A {\n m(a);\n}\n\nabstract class B extends A {\n m(b);\n}\n```\n\n**GOOD:**\n```dart\nabstract class A {\n m(a);\n}\n\nabstract class B extends A {\n m(a);\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_return_types_on_setters",
@@ -482,8 +495,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** return types on setters.\n\nAs setters do not return a value, declaring the return type of one is redundant.\n\n**BAD:**\n```dart\nvoid set speed(int ms);\n```\n\n**GOOD:**\n```dart\nset speed(int ms);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** return types on setters.\n\nAs setters do not return a value, declaring the return type of one is redundant.\n\n**BAD:**\n```dart\nvoid set speed(int ms);\n```\n\n**GOOD:**\n```dart\nset speed(int ms);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_returning_null",
@@ -493,8 +506,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**AVOID** returning null from members whose return type is bool, double, int,\nor num.\n\nFunctions that return primitive types such as bool, double, int, and num are\ngenerally expected to return non-nullable values. Thus, returning null where a\nprimitive type was expected can lead to runtime exceptions.\n\n**BAD:**\n```dart\nbool getBool() => null;\nnum getNum() => null;\nint getInt() => null;\ndouble getDouble() => null;\n```\n\n**GOOD:**\n```dart\nbool getBool() => false;\nnum getNum() => -1;\nint getInt() => -1;\ndouble getDouble() => -1.0;\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**AVOID** returning null from members whose return type is bool, double, int,\nor num.\n\nFunctions that return primitive types such as bool, double, int, and num are\ngenerally expected to return non-nullable values. Thus, returning null where a\nprimitive type was expected can lead to runtime exceptions.\n\n**BAD:**\n```dart\nbool getBool() => null;\nnum getNum() => null;\nint getInt() => null;\ndouble getDouble() => null;\n```\n\n**GOOD:**\n```dart\nbool getBool() => false;\nnum getNum() => -1;\nint getInt() => -1;\ndouble getDouble() => -1.0;\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_returning_null_for_future",
@@ -504,8 +517,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**AVOID** returning null for Future.\n\nIt is almost always wrong to return `null` for a `Future`. Most of the time the\ndeveloper simply forgot to put an `async` keyword on the function.\n",
- "sinceDartSdk": "2.1.1"
+ "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**AVOID** returning null for Future.\n\nIt is almost always wrong to return `null` for a `Future`. Most of the time the\ndeveloper simply forgot to put an `async` keyword on the function.",
+ "sinceDartSdk": "2.1"
},
{
"name": "avoid_returning_null_for_void",
@@ -520,8 +533,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** returning `null` for `void`.\n\nIn a large variety of languages `void` as return type is used to indicate that\na function doesn't return anything. Dart allows returning `null` in functions\nwith `void` return type but it also allow using `return;` without specifying any\nvalue. To have a consistent way you should not return `null` and only use an\nempty return.\n\n**BAD:**\n```dart\nvoid f1() {\n return null;\n}\nFuture f2() async {\n return null;\n}\n```\n\n**GOOD:**\n```dart\nvoid f1() {\n return;\n}\nFuture f2() async {\n return;\n}\n```\n\n",
- "sinceDartSdk": "2.1.0"
+ "details": "**AVOID** returning `null` for `void`.\n\nIn a large variety of languages `void` as return type is used to indicate that\na function doesn't return anything. Dart allows returning `null` in functions\nwith `void` return type but it also allow using `return;` without specifying any\nvalue. To have a consistent way you should not return `null` and only use an\nempty return.\n\n**BAD:**\n```dart\nvoid f1() {\n return null;\n}\nFuture f2() async {\n return null;\n}\n```\n\n**GOOD:**\n```dart\nvoid f1() {\n return;\n}\nFuture f2() async {\n return;\n}\n```",
+ "sinceDartSdk": "2.1"
},
{
"name": "avoid_returning_this",
@@ -534,8 +547,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-returning-this-from-methods-just-to-enable-a-fluent-interface):\n\n**AVOID** returning this from methods just to enable a fluent interface.\n\nReturning `this` from a method is redundant; Dart has a cascade operator which\nallows method chaining universally.\n\nReturning `this` is allowed for:\n\n- operators\n- methods with a return type different of the current class\n- methods defined in parent classes / mixins or interfaces\n- methods defined in extensions\n\n**BAD:**\n```dart\nvar buffer = StringBuffer()\n .write('one')\n .write('two')\n .write('three');\n```\n\n**GOOD:**\n```dart\nvar buffer = StringBuffer()\n ..write('one')\n ..write('two')\n ..write('three');\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/design#avoid-returning-this-from-methods-just-to-enable-a-fluent-interface):\n\n**AVOID** returning this from methods just to enable a fluent interface.\n\nReturning `this` from a method is redundant; Dart has a cascade operator which\nallows method chaining universally.\n\nReturning `this` is allowed for:\n\n- operators\n- methods with a return type different of the current class\n- methods defined in parent classes / mixins or interfaces\n- methods defined in extensions\n\n**BAD:**\n```dart\nvar buffer = StringBuffer()\n .write('one')\n .write('two')\n .write('three');\n```\n\n**GOOD:**\n```dart\nvar buffer = StringBuffer()\n ..write('one')\n ..write('two')\n ..write('three');\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_setters_without_getters",
@@ -547,8 +560,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DON'T** define a setter without a corresponding getter.\n\nDefining a setter without defining a corresponding getter can lead to logical\ninconsistencies. Doing this could allow you to set a property to some value,\nbut then upon observing the property's value, it could easily be different.\n\n**BAD:**\n```dart\nclass Bad {\n int l, r;\n\n set length(int newLength) {\n r = l + newLength;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Good {\n int l, r;\n\n int get length => r - l;\n\n set length(int newLength) {\n r = l + newLength;\n }\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** define a setter without a corresponding getter.\n\nDefining a setter without defining a corresponding getter can lead to logical\ninconsistencies. Doing this could allow you to set a property to some value,\nbut then upon observing the property's value, it could easily be different.\n\n**BAD:**\n```dart\nclass Bad {\n int l, r;\n\n set length(int newLength) {\n r = l + newLength;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Good {\n int l, r;\n\n int get length => r - l;\n\n set length(int newLength) {\n r = l + newLength;\n }\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_shadowing_type_parameters",
@@ -564,8 +577,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**AVOID** shadowing type parameters.\n\n**BAD:**\n```dart\nclass A {\n void fn() {}\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n void fn() {}\n}\n```\n\n",
- "sinceDartSdk": "2.1.1"
+ "details": "**AVOID** shadowing type parameters.\n\n**BAD:**\n```dart\nclass A {\n void fn() {}\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n void fn() {}\n}\n```",
+ "sinceDartSdk": "2.1"
},
{
"name": "avoid_single_cascade_in_expression_statements",
@@ -581,8 +594,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** single cascade in expression statements.\n\n**BAD:**\n```dart\no..m();\n```\n\n**GOOD:**\n```dart\no.m();\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** single cascade in expression statements.\n\n**BAD:**\n```dart\no..m();\n```\n\n**GOOD:**\n```dart\no.m();\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_slow_async_io",
@@ -594,8 +607,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**AVOID** using the following asynchronous file I/O methods because they are\nmuch slower than their synchronous counterparts.\n\n* `Directory.exists`\n* `Directory.stat`\n* `File.lastModified`\n* `File.exists`\n* `File.stat`\n* `FileSystemEntity.isDirectory`\n* `FileSystemEntity.isFile`\n* `FileSystemEntity.isLink`\n* `FileSystemEntity.type`\n\n**BAD:**\n```dart\nimport 'dart:io';\n\nFuture someFunction() async {\n var file = File('/path/to/my/file');\n var now = DateTime.now();\n if ((await file.lastModified()).isBefore(now)) print('before'); // LINT\n}\n```\n\n**GOOD:**\n```dart\nimport 'dart:io';\n\nFuture someFunction() async {\n var file = File('/path/to/my/file');\n var now = DateTime.now();\n if (file.lastModifiedSync().isBefore(now)) print('before'); // OK\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** using the following asynchronous file I/O methods because they are\nmuch slower than their synchronous counterparts.\n\n* `Directory.exists`\n* `Directory.stat`\n* `File.lastModified`\n* `File.exists`\n* `File.stat`\n* `FileSystemEntity.isDirectory`\n* `FileSystemEntity.isFile`\n* `FileSystemEntity.isLink`\n* `FileSystemEntity.type`\n\n**BAD:**\n```dart\nimport 'dart:io';\n\nFuture someFunction() async {\n var file = File('/path/to/my/file');\n var now = DateTime.now();\n if ((await file.lastModified()).isBefore(now)) print('before'); // LINT\n}\n```\n\n**GOOD:**\n```dart\nimport 'dart:io';\n\nFuture someFunction() async {\n var file = File('/path/to/my/file');\n var now = DateTime.now();\n if (file.lastModifiedSync().isBefore(now)) print('before'); // OK\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_type_to_string",
@@ -607,8 +620,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DO** avoid calls to .toString() in production code, since it does not\ncontractually return the user-defined name of the Type (or underlying class).\nDevelopment-mode compilers where code size is not a concern use the full name,\nbut release-mode compilers often choose to minify these symbols.\n\n**BAD:**\n```dart\nvoid bar(Object other) {\n if (other.runtimeType.toString() == 'Bar') {\n doThing();\n }\n}\n\nObject baz(Thing myThing) {\n return getThingFromDatabase(key: myThing.runtimeType.toString());\n}\n```\n\n**GOOD:**\n```dart\nvoid bar(Object other) {\n if (other is Bar) {\n doThing();\n }\n}\n\nclass Thing {\n String get thingTypeKey => ...\n}\n\nObject baz(Thing myThing) {\n return getThingFromDatabase(key: myThing.thingTypeKey);\n}\n```\n\n",
- "sinceDartSdk": "2.12.0"
+ "details": "**DO** avoid calls to .toString() in production code, since it does not\ncontractually return the user-defined name of the Type (or underlying class).\nDevelopment-mode compilers where code size is not a concern use the full name,\nbut release-mode compilers often choose to minify these symbols.\n\n**BAD:**\n```dart\nvoid bar(Object other) {\n if (other.runtimeType.toString() == 'Bar') {\n doThing();\n }\n}\n\nObject baz(Thing myThing) {\n return getThingFromDatabase(key: myThing.runtimeType.toString());\n}\n```\n\n**GOOD:**\n```dart\nvoid bar(Object other) {\n if (other is Bar) {\n doThing();\n }\n}\n\nclass Thing {\n String get thingTypeKey => ...\n}\n\nObject baz(Thing myThing) {\n return getThingFromDatabase(key: myThing.thingTypeKey);\n}\n```",
+ "sinceDartSdk": "2.12"
},
{
"name": "avoid_types_as_parameter_names",
@@ -624,8 +637,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** using a parameter name that is the same as an existing type.\n\n**BAD:**\n```dart\nm(f(int));\n```\n\n**GOOD:**\n```dart\nm(f(int v));\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** using a parameter name that is the same as an existing type.\n\n**BAD:**\n```dart\nm(f(int));\n```\n\n**GOOD:**\n```dart\nm(f(int v));\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_types_on_closure_parameters",
@@ -639,8 +652,8 @@
],
"sets": [],
"fixStatus": "hasFix",
- "details": "**AVOID** annotating types for function expression parameters.\n\nAnnotating types for function expression parameters is usually unnecessary\nbecause the parameter types can almost always be inferred from the context,\nthus making the practice redundant.\n\n**BAD:**\n```dart\nvar names = people.map((Person person) => person.name);\n```\n\n**GOOD:**\n```dart\nvar names = people.map((person) => person.name);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** annotating types for function expression parameters.\n\nAnnotating types for function expression parameters is usually unnecessary\nbecause the parameter types can almost always be inferred from the context,\nthus making the practice redundant.\n\n**BAD:**\n```dart\nvar names = people.map((Person person) => person.name);\n```\n\n**GOOD:**\n```dart\nvar names = people.map((person) => person.name);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_unnecessary_containers",
@@ -655,8 +668,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** wrapping widgets in unnecessary containers.\n\nWrapping a widget in `Container` with no other parameters set has no effect \nand makes code needlessly more complex.\n\n**BAD:**\n```dart\nWidget buildRow() {\n return Container(\n child: Row(\n children: [\n const MyLogo(),\n const Expanded(\n child: Text('...'),\n ),\n ],\n )\n );\n}\n```\n\n**GOOD:**\n```dart\nWidget buildRow() {\n return Row(\n children: [\n const MyLogo(),\n const Expanded(\n child: Text('...'),\n ),\n ],\n );\n}\n```\n",
- "sinceDartSdk": "2.7.0"
+ "details": "**AVOID** wrapping widgets in unnecessary containers.\n\nWrapping a widget in `Container` with no other parameters set has no effect\nand makes code needlessly more complex.\n\n**BAD:**\n```dart\nWidget buildRow() {\n return Container(\n child: Row(\n children: [\n const MyLogo(),\n const Expanded(\n child: Text('...'),\n ),\n ],\n )\n );\n}\n```\n\n**GOOD:**\n```dart\nWidget buildRow() {\n return Row(\n children: [\n const MyLogo(),\n const Expanded(\n child: Text('...'),\n ),\n ],\n );\n}\n```",
+ "sinceDartSdk": "2.7"
},
{
"name": "avoid_unstable_final_fields",
@@ -666,8 +679,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "This rule has been removed.\n",
- "sinceDartSdk": "3.3.0"
+ "details": "This rule has been removed.",
+ "sinceDartSdk": "3.3"
},
{
"name": "avoid_unused_constructor_parameters",
@@ -679,8 +692,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**AVOID** defining unused parameters in constructors.\n\n**BAD:**\n```dart\nclass BadOne {\n BadOne(int unusedParameter, [String unusedPositional]);\n}\n\nclass BadTwo {\n int c;\n\n BadTwo(int a, int b, int x) {\n c = a + b;\n }\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** defining unused parameters in constructors.\n\n**BAD:**\n```dart\nclass BadOne {\n BadOne(int unusedParameter, [String unusedPositional]);\n}\n\nclass BadTwo {\n int c;\n\n BadTwo(int a, int b, int x) {\n c = a + b;\n }\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "avoid_void_async",
@@ -692,8 +705,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** mark `async` functions as returning `Future`.\n\nWhen declaring an `async` method or function which does not return a value,\ndeclare that it returns `Future` and not just `void`.\n\n**BAD:**\n```dart\nvoid f() async {}\nvoid f2() async => null;\n```\n\n**GOOD:**\n```dart\nFuture f() async {}\nFuture f2() async => null;\n```\n\n**EXCEPTION:**\n\nAn exception is made for top-level `main` functions, where the `Future`\nannotation *can* (and generally should) be dropped in favor of `void`.\n\n**GOOD:**\n```dart\nFuture f() async {}\n\nvoid main() async {\n await f();\n}\n```\n",
- "sinceDartSdk": "2.1.0"
+ "details": "**DO** mark `async` functions as returning `Future`.\n\nWhen declaring an `async` method or function which does not return a value,\ndeclare that it returns `Future` and not just `void`.\n\n**BAD:**\n```dart\nvoid f() async {}\nvoid f2() async => null;\n```\n\n**GOOD:**\n```dart\nFuture f() async {}\nFuture f2() async => null;\n```\n\n**EXCEPTION:**\n\nAn exception is made for top-level `main` functions, where the `Future`\nannotation *can* (and generally should) be dropped in favor of `void`.\n\n**GOOD:**\n```dart\nFuture f() async {}\n\nvoid main() async {\n await f();\n}\n```",
+ "sinceDartSdk": "2.1"
},
{
"name": "avoid_web_libraries_in_flutter",
@@ -709,8 +722,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**AVOID** using web libraries, `dart:html`, `dart:js` and \n`dart:js_util` in Flutter packages that are not web plugins. These libraries are \nnot supported outside of a web context; functionality that depends on them will\nfail at runtime in Flutter mobile, and their use is generally discouraged in\nFlutter web.\n\nWeb library access *is* allowed in:\n\n* plugin packages that declare `web` as a supported context\n\notherwise, imports of `dart:html`, `dart:js` and `dart:js_util` are disallowed.\n",
- "sinceDartSdk": "2.6.0"
+ "details": "**AVOID** using web libraries, `dart:html`, `dart:js` and\n`dart:js_util` in Flutter packages that are not web plugins. These libraries are\nnot supported outside of a web context; functionality that depends on them will\nfail at runtime in Flutter mobile, and their use is generally discouraged in\nFlutter web.\n\nWeb library access *is* allowed in:\n\n* plugin packages that declare `web` as a supported context\n\notherwise, imports of `dart:html`, `dart:js` and `dart:js_util` are disallowed.",
+ "sinceDartSdk": "2.6"
},
{
"name": "await_only_futures",
@@ -726,8 +739,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** using await on anything which is not a future.\n\nAwait is allowed on the types: `Future`, `FutureOr`, `Future?`, \n`FutureOr?` and `dynamic`.\n\nFurther, using `await null` is specifically allowed as a way to introduce a\nmicrotask delay.\n\n**BAD:**\n```dart\nmain() async {\n print(await 23);\n}\n```\n**GOOD:**\n```dart\nmain() async {\n await null; // If a delay is really intended.\n print(23);\n}\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** using await on anything which is not a future.\n\nAwait is allowed on the types: `Future`, `FutureOr`, `Future?`,\n`FutureOr?` and `dynamic`.\n\nFurther, using `await null` is specifically allowed as a way to introduce a\nmicrotask delay.\n\n**BAD:**\n```dart\nmain() async {\n print(await 23);\n}\n```\n\n**GOOD:**\n```dart\nmain() async {\n await null; // If a delay is really intended.\n print(23);\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "camel_case_extensions",
@@ -744,8 +757,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/style#do-name-extensions-using-uppercamelcase):\n\n**DO** name extensions using `UpperCamelCase`.\n\nExtensions should capitalize the first letter of each word (including\nthe first word), and use no separators.\n\n**GOOD:**\n```dart\nextension MyFancyList on List { \n // ... \n}\n\nextension SmartIterable on Iterable {\n // ...\n}\n```\n",
- "sinceDartSdk": "2.6.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/style#do-name-extensions-using-uppercamelcase):\n\n**DO** name extensions using `UpperCamelCase`.\n\nExtensions should capitalize the first letter of each word (including\nthe first word), and use no separators.\n\n**GOOD:**\n```dart\nextension MyFancyList on List { \n // ... \n}\n\nextension SmartIterable on Iterable {\n // ...\n}\n```",
+ "sinceDartSdk": "2.6"
},
{
"name": "camel_case_types",
@@ -762,8 +775,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/style#do-name-types-using-uppercamelcase):\n\n**DO** name types using UpperCamelCase.\n\nClasses and typedefs should capitalize the first letter of each word (including\nthe first word), and use no separators.\n\n**GOOD:**\n```dart\nclass SliderMenu {\n // ...\n}\n\nclass HttpRequest {\n // ...\n}\n\ntypedef num Adder(num x, num y);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/style#do-name-types-using-uppercamelcase):\n\n**DO** name types using UpperCamelCase.\n\nClasses and typedefs should capitalize the first letter of each word (including\nthe first word), and use no separators.\n\n**GOOD:**\n```dart\nclass SliderMenu {\n // ...\n}\n\nclass HttpRequest {\n // ...\n}\n\ntypedef num Adder(num x, num y);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "cancel_subscriptions",
@@ -776,8 +789,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DO** invoke `cancel` on instances of `dart:async` `StreamSubscription`.\n\nCancelling instances of StreamSubscription prevents memory leaks and unexpected\nbehavior.\n\n**BAD:**\n```dart\nclass A {\n StreamSubscription _subscriptionA; // LINT\n void init(Stream stream) {\n _subscriptionA = stream.listen((_) {});\n }\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n StreamSubscription _subscriptionF; // LINT\n}\n```\n\n**GOOD:**\n```dart\nclass B {\n StreamSubscription _subscriptionB; // OK\n void init(Stream stream) {\n _subscriptionB = stream.listen((_) {});\n }\n\n void dispose(filename) {\n _subscriptionB.cancel();\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunctionOK() {\n StreamSubscription _subscriptionB; // OK\n _subscriptionB.cancel();\n}\n```\n\n**Known limitations**\n\nThis rule does not track all patterns of StreamSubscription instantiations and\ncancellations. See [linter#317](https://github.com/dart-lang/linter/issues/317)\nfor more information.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** invoke `cancel` on instances of `dart:async` `StreamSubscription`.\n\nCancelling instances of StreamSubscription prevents memory leaks and unexpected\nbehavior.\n\n**BAD:**\n```dart\nclass A {\n StreamSubscription _subscriptionA; // LINT\n void init(Stream stream) {\n _subscriptionA = stream.listen((_) {});\n }\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n StreamSubscription _subscriptionF; // LINT\n}\n```\n\n**GOOD:**\n```dart\nclass B {\n StreamSubscription _subscriptionB; // OK\n void init(Stream stream) {\n _subscriptionB = stream.listen((_) {});\n }\n\n void dispose(filename) {\n _subscriptionB.cancel();\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunctionOK() {\n StreamSubscription _subscriptionB; // OK\n _subscriptionB.cancel();\n}\n```\n\n**Known limitations**\n\nThis rule does not track all patterns of StreamSubscription instantiations and\ncancellations. See [linter#317](https://github.com/dart-lang/linter/issues/317)\nfor more information.",
+ "sinceDartSdk": "2.0"
},
{
"name": "cascade_invocations",
@@ -791,8 +804,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** Use the cascading style when successively invoking methods on the same\nreference.\n\n**BAD:**\n```dart\nSomeClass someReference = SomeClass();\nsomeReference.firstMethod();\nsomeReference.secondMethod();\n```\n\n**BAD:**\n```dart\nSomeClass someReference = SomeClass();\n...\nsomeReference.firstMethod();\nsomeReference.aProperty = value;\nsomeReference.secondMethod();\n```\n\n**GOOD:**\n```dart\nSomeClass someReference = SomeClass()\n ..firstMethod()\n ..aProperty = value\n ..secondMethod();\n```\n\n**GOOD:**\n```dart\nSomeClass someReference = SomeClass();\n...\nsomeReference\n ..firstMethod()\n ..aProperty = value\n ..secondMethod();\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** Use the cascading style when successively invoking methods on the same\nreference.\n\n**BAD:**\n```dart\nSomeClass someReference = SomeClass();\nsomeReference.firstMethod();\nsomeReference.secondMethod();\n```\n\n**BAD:**\n```dart\nSomeClass someReference = SomeClass();\n...\nsomeReference.firstMethod();\nsomeReference.aProperty = value;\nsomeReference.secondMethod();\n```\n\n**GOOD:**\n```dart\nSomeClass someReference = SomeClass()\n ..firstMethod()\n ..aProperty = value\n ..secondMethod();\n```\n\n**GOOD:**\n```dart\nSomeClass someReference = SomeClass();\n...\nsomeReference\n ..firstMethod()\n ..aProperty = value\n ..secondMethod();\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "cast_nullable_to_non_nullable",
@@ -804,8 +817,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DON'T** cast a nullable value to a non nullable type. This hides a null check\nand most of the time it is not what is expected.\n\n**BAD:**\n```dart\nclass A {}\nclass B extends A {}\n\nA? a;\nvar v = a as B;\nvar v = a as A;\n```\n\n**GOOD:**\n```dart\nclass A {}\nclass B extends A {}\n\nA? a;\nvar v = a! as B;\nvar v = a!;\n```\n\n",
- "sinceDartSdk": "2.12.0"
+ "details": "**DON'T** cast a nullable value to a non nullable type. This hides a null check\nand most of the time it is not what is expected.\n\n**BAD:**\n```dart\nclass A {}\nclass B extends A {}\n\nA? a;\nvar v = a as B;\nvar v = a as A;\n```\n\n**GOOD:**\n```dart\nclass A {}\nclass B extends A {}\n\nA? a;\nvar v = a! as B;\nvar v = a!;\n```",
+ "sinceDartSdk": "2.12"
},
{
"name": "close_sinks",
@@ -818,8 +831,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DO** invoke `close` on instances of `dart:core` `Sink`.\n\nClosing instances of Sink prevents memory leaks and unexpected behavior.\n\n**BAD:**\n```dart\nclass A {\n IOSink _sinkA;\n void init(filename) {\n _sinkA = File(filename).openWrite(); // LINT\n }\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n IOSink _sinkF; // LINT\n}\n```\n\n**GOOD:**\n```dart\nclass B {\n IOSink _sinkB;\n void init(filename) {\n _sinkB = File(filename).openWrite(); // OK\n }\n\n void dispose(filename) {\n _sinkB.close();\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunctionOK() {\n IOSink _sinkFOK; // OK\n _sinkFOK.close();\n}\n```\n\n**Known limitations**\n\nThis rule does not track all patterns of Sink instantiations and\nclosures. See [linter#1381](https://github.com/dart-lang/linter/issues/1381)\nfor more information.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** invoke `close` on instances of `dart:core` `Sink`.\n\nClosing instances of Sink prevents memory leaks and unexpected behavior.\n\n**BAD:**\n```dart\nclass A {\n IOSink _sinkA;\n void init(filename) {\n _sinkA = File(filename).openWrite(); // LINT\n }\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n IOSink _sinkF; // LINT\n}\n```\n\n**GOOD:**\n```dart\nclass B {\n IOSink _sinkB;\n void init(filename) {\n _sinkB = File(filename).openWrite(); // OK\n }\n\n void dispose(filename) {\n _sinkB.close();\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunctionOK() {\n IOSink _sinkFOK; // OK\n _sinkFOK.close();\n}\n```\n\n**Known limitations**\n\nThis rule does not track all patterns of Sink instantiations and\nclosures. See [linter#1381](https://github.com/dart-lang/linter/issues/1381)\nfor more information.",
+ "sinceDartSdk": "2.0"
},
{
"name": "collection_methods_unrelated_type",
@@ -835,8 +848,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**DON'T** invoke certain collection method with an argument with an unrelated\ntype.\n\nDoing this will invoke `==` on the collection's elements and most likely will\nreturn `false`.\n\nAn argument passed to a collection method should relate to the collection type\nas follows:\n\n* an argument to `Iterable.contains` should be related to `E`\n* an argument to `List.remove` should be related to `E`\n* an argument to `Map.containsKey` should be related to `K`\n* an argument to `Map.containsValue` should be related to `V`\n* an argument to `Map.remove` should be related to `K`\n* an argument to `Map.[]` should be related to `K`\n* an argument to `Queue.remove` should be related to `E`\n* an argument to `Set.lookup` should be related to `E`\n* an argument to `Set.remove` should be related to `E`\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n var set = {};\n set.remove('1'); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains(1)) print('someFunction'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction() {\n var set = {};\n set.remove(1); // OK\n}\n```\n\n",
- "sinceDartSdk": "2.19.0"
+ "details": "**DON'T** invoke certain collection method with an argument with an unrelated\ntype.\n\nDoing this will invoke `==` on the collection's elements and most likely will\nreturn `false`.\n\nAn argument passed to a collection method should relate to the collection type\nas follows:\n\n* an argument to `Iterable.contains` should be related to `E`\n* an argument to `List.remove` should be related to `E`\n* an argument to `Map.containsKey` should be related to `K`\n* an argument to `Map.containsValue` should be related to `V`\n* an argument to `Map.remove` should be related to `K`\n* an argument to `Map.[]` should be related to `K`\n* an argument to `Queue.remove` should be related to `E`\n* an argument to `Set.lookup` should be related to `E`\n* an argument to `Set.remove` should be related to `E`\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction() {\n var set = {};\n set.remove('1'); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains(1)) print('someFunction'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction() {\n var set = {};\n set.remove(1); // OK\n}\n```",
+ "sinceDartSdk": "2.19"
},
{
"name": "combinators_ordering",
@@ -848,8 +861,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** sort combinator names alphabetically.\n\n**BAD:**\n```dart\nimport 'a.dart' show B, A hide D, C;\nexport 'a.dart' show B, A hide D, C;\n```\n\n**GOOD:**\n```dart\nimport 'a.dart' show A, B hide C, D;\nexport 'a.dart' show A, B hide C, D;\n```\n\n",
- "sinceDartSdk": "2.19.0"
+ "details": "**DO** sort combinator names alphabetically.\n\n**BAD:**\n```dart\nimport 'a.dart' show B, A hide D, C;\nexport 'a.dart' show B, A hide D, C;\n```\n\n**GOOD:**\n```dart\nimport 'a.dart' show A, B hide C, D;\nexport 'a.dart' show A, B hide C, D;\n```",
+ "sinceDartSdk": "2.19"
},
{
"name": "comment_references",
@@ -861,8 +874,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** reference only in-scope identifiers in doc comments.\n\nIf you surround identifiers like variable, method, or type names in square\nbrackets, then tools like your IDE and\n[`dart doc`](https://dart.dev/tools/dart-doc) can link to them. For this to\nwork, ensure that all identifiers in docs wrapped in brackets are in scope.\n\nFor example, assuming `outOfScopeId` is out of scope:\n\n**BAD:**\n```dart\n/// Returns whether [value] is larger than [outOfScopeId].\nbool isOutOfRange(int value) { ... }\n```\n\n**GOOD:**\n```dart\n/// Returns the larger of [a] or [b].\nint max_int(int a, int b) { ... }\n```\n\nNote that the square bracket comment format is designed to allow comments to\nrefer to declarations using a fairly natural format but does not allow\n*arbitrary expressions*. In particular, code references within square brackets\ncan consist of any of the following:\n\n- A bare identifier which is in-scope for the comment (see the spec for what is\n \"in-scope\" in doc comments). Examples include `[print]` and `[Future]`.\n- Two identifiers separated by a period (a \"prefixed identifier\"), such that the\n first identifier acts as a namespacing identifier, such as a class property\n name or method name prefixed by the containing class's name, or a top-level\n identifier prefixed by an import prefix. Examples include `[Future.new]` (an\n unnamed constructor), `[Future.value]` (a constructor), `[Future.wait]` (a\n static method), `[Future.then]` (an instance method), `[math.max]` (given that\n 'dart:async' is imported with a `max` prefix).\n- A prefixed identifier followed by a pair of parentheses, used to disambiguate\n named constructors from instance members (whose names are allowed to collide).\n Examples include `[Future.value()]`.\n- Three identifiers separated by two periods, such that the first identifier is\n an import prefix name, the second identifier is a top-level element like a\n class or an extension, and the third identifier is a member of that top-level\n element. Examples include `[async.Future.then]` (given that 'dart:async' is\n imported with an `async` prefix).\n\n**Known limitations**\n\nThe `comment_references` lint rule aligns with the Dart analyzer's notion of\ncomment references, which is occasionally distinct from Dartdoc's notion of\ncomment references. The lint rule may report comment references which Dartdoc\ncan resolve, even though the analyzer cannot. See\n[linter#1142](https://github.com/dart-lang/linter/issues/1142) for more\ninformation.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** reference only in-scope identifiers in doc comments.\n\nIf you surround identifiers like variable, method, or type names in square\nbrackets, then tools like your IDE and\n[`dart doc`](https://dart.dev/tools/dart-doc) can link to them. For this to\nwork, ensure that all identifiers in docs wrapped in brackets are in scope.\n\nFor example, assuming `outOfScopeId` is out of scope:\n\n**BAD:**\n```dart\n/// Returns whether [value] is larger than [outOfScopeId].\nbool isOutOfRange(int value) { ... }\n```\n\n**GOOD:**\n```dart\n/// Returns the larger of [a] or [b].\nint max_int(int a, int b) { ... }\n```\n\nNote that the square bracket comment format is designed to allow comments to\nrefer to declarations using a fairly natural format but does not allow\n*arbitrary expressions*. In particular, code references within square brackets\ncan consist of any of the following:\n\n- A bare identifier which is in-scope for the comment (see the spec for what is\n \"in-scope\" in doc comments). Examples include `[print]` and `[Future]`.\n- Two identifiers separated by a period (a \"prefixed identifier\"), such that the\n first identifier acts as a namespacing identifier, such as a class property\n name or method name prefixed by the containing class's name, or a top-level\n identifier prefixed by an import prefix. Examples include `[Future.new]` (an\n unnamed constructor), `[Future.value]` (a constructor), `[Future.wait]` (a\n static method), `[Future.then]` (an instance method), `[math.max]` (given that\n 'dart:async' is imported with a `max` prefix).\n- A prefixed identifier followed by a pair of parentheses, used to disambiguate\n named constructors from instance members (whose names are allowed to collide).\n Examples include `[Future.value()]`.\n- Three identifiers separated by two periods, such that the first identifier is\n an import prefix name, the second identifier is a top-level element like a\n class or an extension, and the third identifier is a member of that top-level\n element. Examples include `[async.Future.then]` (given that 'dart:async' is\n imported with an `async` prefix).\n\n**Known limitations**\n\nThe `comment_references` lint rule aligns with the Dart analyzer's notion of\ncomment references, which is occasionally distinct from Dartdoc's notion of\ncomment references. The lint rule may report comment references which Dartdoc\ncan resolve, even though the analyzer cannot. See\n[linter#1142](https://github.com/dart-lang/linter/issues/1142) for more\ninformation.",
+ "sinceDartSdk": "2.0"
},
{
"name": "conditional_uri_does_not_exist",
@@ -874,8 +887,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DON'T** reference files that do not exist in conditional imports.\n\nCode may fail at runtime if the condition evaluates such that the missing file\nneeds to be imported.\n\n**BAD:**\n```dart\nimport 'file_that_does_exist.dart'\n if (condition) 'file_that_does_not_exist.dart';\n```\n\n**GOOD:**\n```dart\nimport 'file_that_does_exist.dart'\n if (condition) 'file_that_also_does_exist.dart';\n```\n\n",
- "sinceDartSdk": "2.16.0"
+ "details": "**DON'T** reference files that do not exist in conditional imports.\n\nCode may fail at runtime if the condition evaluates such that the missing file\nneeds to be imported.\n\n**BAD:**\n```dart\nimport 'file_that_does_exist.dart'\n if (condition) 'file_that_does_not_exist.dart';\n```\n\n**GOOD:**\n```dart\nimport 'file_that_does_exist.dart'\n if (condition) 'file_that_also_does_exist.dart';\n```",
+ "sinceDartSdk": "2.16"
},
{
"name": "constant_identifier_names",
@@ -890,8 +903,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**PREFER** using lowerCamelCase for constant names.\n\nIn new code, use `lowerCamelCase` for constant variables, including enum values.\n\nIn existing code that uses `ALL_CAPS_WITH_UNDERSCORES` for constants, you may\ncontinue to use all caps to stay consistent.\n\n**BAD:**\n```dart\nconst PI = 3.14;\nconst kDefaultTimeout = 1000;\nfinal URL_SCHEME = RegExp('^([a-z]+):');\n\nclass Dice {\n static final NUMBER_GENERATOR = Random();\n}\n```\n\n**GOOD:**\n```dart\nconst pi = 3.14;\nconst defaultTimeout = 1000;\nfinal urlScheme = RegExp('^([a-z]+):');\n\nclass Dice {\n static final numberGenerator = Random();\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**PREFER** using lowerCamelCase for constant names.\n\nIn new code, use `lowerCamelCase` for constant variables, including enum values.\n\nIn existing code that uses `ALL_CAPS_WITH_UNDERSCORES` for constants, you may\ncontinue to use all caps to stay consistent.\n\n**BAD:**\n```dart\nconst PI = 3.14;\nconst kDefaultTimeout = 1000;\nfinal URL_SCHEME = RegExp('^([a-z]+):');\n\nclass Dice {\n static final NUMBER_GENERATOR = Random();\n}\n```\n\n**GOOD:**\n```dart\nconst pi = 3.14;\nconst defaultTimeout = 1000;\nfinal urlScheme = RegExp('^([a-z]+):');\n\nclass Dice {\n static final numberGenerator = Random();\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "control_flow_in_finally",
@@ -906,8 +919,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**AVOID** control flow leaving `finally` blocks.\n\nUsing control flow in `finally` blocks will inevitably cause unexpected behavior\nthat is hard to debug.\n\n**BAD:**\n```dart\nclass BadReturn {\n double nonCompliantMethod() {\n try {\n return 1 / 0;\n } catch (e) {\n print(e);\n } finally {\n return 1.0; // LINT\n }\n }\n}\n```\n\n**BAD:**\n```dart\nclass BadContinue {\n double nonCompliantMethod() {\n for (var o in [1, 2]) {\n try {\n print(o / 0);\n } catch (e) {\n print(e);\n } finally {\n continue; // LINT\n }\n }\n return 1.0;\n }\n}\n```\n\n**BAD:**\n```dart\nclass BadBreak {\n double nonCompliantMethod() {\n for (var o in [1, 2]) {\n try {\n print(o / 0);\n } catch (e) {\n print(e);\n } finally {\n break; // LINT\n }\n }\n return 1.0;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Ok {\n double compliantMethod() {\n var i = 5;\n try {\n i = 1 / 0;\n } catch (e) {\n print(e); // OK\n }\n return i;\n }\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** control flow leaving `finally` blocks.\n\nUsing control flow in `finally` blocks will inevitably cause unexpected behavior\nthat is hard to debug.\n\n**BAD:**\n```dart\nclass BadReturn {\n double nonCompliantMethod() {\n try {\n return 1 / 0;\n } catch (e) {\n print(e);\n } finally {\n return 1.0; // LINT\n }\n }\n}\n```\n\n**BAD:**\n```dart\nclass BadContinue {\n double nonCompliantMethod() {\n for (var o in [1, 2]) {\n try {\n print(o / 0);\n } catch (e) {\n print(e);\n } finally {\n continue; // LINT\n }\n }\n return 1.0;\n }\n}\n```\n\n**BAD:**\n```dart\nclass BadBreak {\n double nonCompliantMethod() {\n for (var o in [1, 2]) {\n try {\n print(o / 0);\n } catch (e) {\n print(e);\n } finally {\n break; // LINT\n }\n }\n return 1.0;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Ok {\n double compliantMethod() {\n var i = 5;\n try {\n i = 1 / 0;\n } catch (e) {\n print(e); // OK\n }\n return i;\n }\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "curly_braces_in_flow_control_structures",
@@ -923,8 +936,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** use curly braces for all flow control structures.\n\nDoing so avoids the [dangling else](https://en.wikipedia.org/wiki/Dangling_else)\nproblem.\n\n**BAD:**\n```dart\nif (overflowChars != other.overflowChars)\n return overflowChars < other.overflowChars;\n```\n\n**GOOD:**\n```dart\nif (isWeekDay) {\n print('Bike to work!');\n} else {\n print('Go dancing or read a book!');\n}\n```\n\nThere is one exception to this: an `if` statement with no `else` clause where\nthe entire `if` statement and the then body all fit in one line. In that case,\nyou may leave off the braces if you prefer:\n\n**GOOD:**\n```dart\nif (arg == null) return defaultValue;\n```\n\nIf the body wraps to the next line, though, use braces:\n\n**GOOD:**\n```dart\nif (overflowChars != other.overflowChars) {\n return overflowChars < other.overflowChars;\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** use curly braces for all flow control structures.\n\nDoing so avoids the [dangling else](https://en.wikipedia.org/wiki/Dangling_else)\nproblem.\n\n**BAD:**\n```dart\nif (overflowChars != other.overflowChars)\n return overflowChars < other.overflowChars;\n```\n\n**GOOD:**\n```dart\nif (isWeekDay) {\n print('Bike to work!');\n} else {\n print('Go dancing or read a book!');\n}\n```\n\nThere is one exception to this: an `if` statement with no `else` clause where\nthe entire `if` statement (including the condition and the body) fits in one\nline. In that case, you may leave off the braces if you prefer:\n\n**GOOD:**\n```dart\nif (arg == null) return defaultValue;\n```\n\nIf the body wraps to the next line, though, use braces:\n\n**GOOD:**\n```dart\nif (overflowChars != other.overflowChars) {\n return overflowChars < other.overflowChars;\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "dangling_library_doc_comments",
@@ -940,8 +953,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "Attach library doc comments (with `///`) to library directives, rather than\nleaving them dangling near the top of a library.\n\n**BAD:**\n```dart\n/// This is a great library.\nimport 'package:math';\n```\n\n```dart\n/// This is a great library.\n\nclass C {}\n```\n\n**GOOD:**\n```dart\n/// This is a great library.\nlibrary;\n\nimport 'package:math';\n\nclass C {}\n```\n\n**NOTE:** An unnamed library, like `library;` above, is only supported in Dart\n2.19 and later. Code which might run in earlier versions of Dart will need to\nprovide a name in the `library` directive.\n",
- "sinceDartSdk": "2.19.0"
+ "details": "Attach library doc comments (with `///`) to library directives, rather than\nleaving them dangling near the top of a library.\n\n**BAD:**\n```dart\n/// This is a great library.\nimport 'package:math';\n```\n\n```dart\n/// This is a great library.\n\nclass C {}\n```\n\n**GOOD:**\n```dart\n/// This is a great library.\nlibrary;\n\nimport 'package:math';\n\nclass C {}\n```\n\n**NOTE:** An unnamed library, like `library;` above, is only supported in Dart\n2.19 and later. Code which might run in earlier versions of Dart will need to\nprovide a name in the `library` directive.",
+ "sinceDartSdk": "2.19"
},
{
"name": "depend_on_referenced_packages",
@@ -957,8 +970,8 @@
"flutter"
],
"fixStatus": "needsFix",
- "details": "**DO** depend on referenced packages.\n\nWhen importing a package, add a dependency on it to your pubspec.\n\nDepending explicitly on packages that you reference ensures they will always\nexist and allows you to put a dependency constraint on them to guard you\nagainst breaking changes.\n\nWhether this should be a regular dependency or dev_dependency depends on if it\nis referenced from a public file (one under either `lib` or `bin`), or some\nother private file.\n\n**BAD:**\n```dart\nimport 'package:a/a.dart';\n```\n\n```yaml\ndependencies:\n```\n\n**GOOD:**\n```dart\nimport 'package:a/a.dart';\n```\n\n```yaml\ndependencies:\n a: ^1.0.0\n```\n\n",
- "sinceDartSdk": "2.14.0"
+ "details": "**DO** depend on referenced packages.\n\nWhen importing a package, add a dependency on it to your pubspec.\n\nDepending explicitly on packages that you reference ensures they will always\nexist and allows you to put a dependency constraint on them to guard you\nagainst breaking changes.\n\nWhether this should be a regular dependency or dev_dependency depends on if it\nis referenced from a public file (one under either `lib` or `bin`), or some\nother private file.\n\n**BAD:**\n```dart\nimport 'package:a/a.dart';\n```\n\n```yaml\ndependencies:\n```\n\n**GOOD:**\n```dart\nimport 'package:a/a.dart';\n```\n\n```yaml\ndependencies:\n a: ^1.0.0\n```",
+ "sinceDartSdk": "2.14"
},
{
"name": "deprecated_consistency",
@@ -970,8 +983,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DO** apply `@Deprecated()` consistently:\n\n- if a class is deprecated, its constructors should also be deprecated.\n- if a field is deprecated, the constructor parameter pointing to it should also\n be deprecated.\n- if a constructor parameter pointing to a field is deprecated, the field should\n also be deprecated.\n\n**BAD:**\n```dart\n@deprecated\nclass A {\n A();\n}\n\nclass B {\n B({this.field});\n @deprecated\n Object field;\n}\n```\n\n**GOOD:**\n```dart\n@deprecated\nclass A {\n @deprecated\n A();\n}\n\nclass B {\n B({@deprecated this.field});\n @deprecated\n Object field;\n}\n\nclass C extends B {\n C({@deprecated super.field});\n}\n```\n",
- "sinceDartSdk": "2.13.0"
+ "details": "**DO** apply `@Deprecated()` consistently:\n\n- if a class is deprecated, its constructors should also be deprecated.\n- if a field is deprecated, the constructor parameter pointing to it should also\n be deprecated.\n- if a constructor parameter pointing to a field is deprecated, the field should\n also be deprecated.\n\n**BAD:**\n```dart\n@deprecated\nclass A {\n A();\n}\n\nclass B {\n B({this.field});\n @deprecated\n Object field;\n}\n```\n\n**GOOD:**\n```dart\n@deprecated\nclass A {\n @deprecated\n A();\n}\n\nclass B {\n B({@deprecated this.field});\n @deprecated\n Object field;\n}\n\nclass C extends B {\n C({@deprecated super.field});\n}\n```",
+ "sinceDartSdk": "2.13"
},
{
"name": "deprecated_member_use_from_same_package",
@@ -983,8 +996,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Elements that are annotated with `@Deprecated` should not be referenced from\nwithin the package in which they are declared.\n\n**AVOID** using deprecated elements.\n\n...\n\n**BAD:**\n```dart\n// Declared in one library:\nclass Foo {\n @Deprecated(\"Use 'm2' instead\")\n void m1() {}\n\n void m2({\n @Deprecated('This is an old parameter') int? p,\n })\n}\n\n@Deprecated('Do not use')\nint x = 0;\n\n// In the same or another library, but within the same package:\nvoid m(Foo foo) {\n foo.m1();\n foo.m2(p: 7);\n x = 1;\n}\n```\n\nDeprecated elements can be used from within _other_ deprecated elements, in\norder to allow for the deprecation of a collection of APIs together as one unit.\n\n**GOOD:**\n```dart\n// Declared in one library:\nclass Foo {\n @Deprecated(\"Use 'm2' instead\")\n void m1() {}\n\n void m2({\n @Deprecated('This is an old parameter') int? p,\n })\n}\n\n@Deprecated('Do not use')\nint x = 0;\n\n// In the same or another library, but within the same package:\n@Deprecated('Do not use')\nvoid m(Foo foo) {\n foo.m1();\n foo.m2(p: 7);\n x = 1;\n}\n```\n",
- "sinceDartSdk": "3.0.0"
+ "details": "Elements that are annotated with `@Deprecated` should not be referenced from\nwithin the package in which they are declared.\n\n**AVOID** using deprecated elements.\n\n...\n\n**BAD:**\n```dart\n// Declared in one library:\nclass Foo {\n @Deprecated(\"Use 'm2' instead\")\n void m1() {}\n\n void m2({\n @Deprecated('This is an old parameter') int? p,\n })\n}\n\n@Deprecated('Do not use')\nint x = 0;\n\n// In the same or another library, but within the same package:\nvoid m(Foo foo) {\n foo.m1();\n foo.m2(p: 7);\n x = 1;\n}\n```\n\nDeprecated elements can be used from within _other_ deprecated elements, in\norder to allow for the deprecation of a collection of APIs together as one unit.\n\n**GOOD:**\n```dart\n// Declared in one library:\nclass Foo {\n @Deprecated(\"Use 'm2' instead\")\n void m1() {}\n\n void m2({\n @Deprecated('This is an old parameter') int? p,\n })\n}\n\n@Deprecated('Do not use')\nint x = 0;\n\n// In the same or another library, but within the same package:\n@Deprecated('Do not use')\nvoid m(Foo foo) {\n foo.m1();\n foo.m2(p: 7);\n x = 1;\n}\n```",
+ "sinceDartSdk": "3.0"
},
{
"name": "diagnostic_describe_all_properties",
@@ -997,8 +1010,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** reference all public properties in `debug` method implementations.\n\nImplementers of `Diagnosticable` should reference all public properties in\na `debugFillProperties(...)` or `debugDescribeChildren(...)` method\nimplementation to improve debuggability at runtime.\n\nPublic properties are defined as fields and getters that are\n\n* not package-private (e.g., prefixed with `_`)\n* not `static` or overriding\n* not themselves `Widget`s or collections of `Widget`s\n\nIn addition, the \"debug\" prefix is treated specially for properties in Flutter.\nFor the purposes of diagnostics, a property `foo` and a prefixed property\n`debugFoo` are treated as effectively describing the same property and it is\nsufficient to refer to one or the other.\n\n**BAD:**\n```dart\nclass Absorber extends Widget {\n bool get absorbing => _absorbing;\n bool _absorbing;\n bool get ignoringSemantics => _ignoringSemantics;\n bool _ignoringSemantics;\n @override\n void debugFillProperties(DiagnosticPropertiesBuilder properties) {\n super.debugFillProperties(properties);\n properties.add(DiagnosticsProperty('absorbing', absorbing));\n // Missing reference to ignoringSemantics\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Absorber extends Widget {\n bool get absorbing => _absorbing;\n bool _absorbing;\n bool get ignoringSemantics => _ignoringSemantics;\n bool _ignoringSemantics;\n @override\n void debugFillProperties(DiagnosticPropertiesBuilder properties) {\n super.debugFillProperties(properties);\n properties.add(DiagnosticsProperty('absorbing', absorbing));\n properties.add(DiagnosticsProperty('ignoringSemantics', ignoringSemantics));\n }\n}\n```\n",
- "sinceDartSdk": "2.3.0"
+ "details": "**DO** reference all public properties in `debug` method implementations.\n\nImplementers of `Diagnosticable` should reference all public properties in\na `debugFillProperties(...)` or `debugDescribeChildren(...)` method\nimplementation to improve debuggability at runtime.\n\nPublic properties are defined as fields and getters that are\n\n* not package-private (e.g., prefixed with `_`)\n* not `static` or overriding\n* not themselves `Widget`s or collections of `Widget`s\n\nIn addition, the \"debug\" prefix is treated specially for properties in Flutter.\nFor the purposes of diagnostics, a property `foo` and a prefixed property\n`debugFoo` are treated as effectively describing the same property and it is\nsufficient to refer to one or the other.\n\n**BAD:**\n```dart\nclass Absorber extends Widget {\n bool get absorbing => _absorbing;\n bool _absorbing;\n bool get ignoringSemantics => _ignoringSemantics;\n bool _ignoringSemantics;\n @override\n void debugFillProperties(DiagnosticPropertiesBuilder properties) {\n super.debugFillProperties(properties);\n properties.add(DiagnosticsProperty('absorbing', absorbing));\n // Missing reference to ignoringSemantics\n }\n}\n```\n\n**GOOD:**\n```dart\nclass Absorber extends Widget {\n bool get absorbing => _absorbing;\n bool _absorbing;\n bool get ignoringSemantics => _ignoringSemantics;\n bool _ignoringSemantics;\n @override\n void debugFillProperties(DiagnosticPropertiesBuilder properties) {\n super.debugFillProperties(properties);\n properties.add(DiagnosticsProperty('absorbing', absorbing));\n properties.add(DiagnosticsProperty('ignoringSemantics', ignoringSemantics));\n }\n}\n```",
+ "sinceDartSdk": "2.3"
},
{
"name": "directives_ordering",
@@ -1010,8 +1023,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** follow the directive ordering conventions in\n[Effective Dart](https://dart.dev/effective-dart/style#ordering):\n\n**DO** place `dart:` imports before other imports.\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n\nimport 'dart:async'; // LINT\nimport 'dart:html'; // LINT\n```\n\n**BAD:**\n```dart\nimport 'dart:html'; // OK\nimport 'package:bar/bar.dart';\n\nimport 'dart:async'; // LINT\nimport 'package:foo/foo.dart';\n```\n\n**GOOD:**\n```dart\nimport 'dart:async'; // OK\nimport 'dart:html'; // OK\n\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n```\n\n**DO** place `package:` imports before relative imports.\n\n**BAD:**\n```dart\nimport 'a.dart';\nimport 'b.dart';\n\nimport 'package:bar/bar.dart'; // LINT\nimport 'package:foo/foo.dart'; // LINT\n```\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'a.dart';\n\nimport 'package:foo/foo.dart'; // LINT\nimport 'b.dart';\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'package:foo/foo.dart'; // OK\n\nimport 'a.dart';\nimport 'b.dart';\n```\n\n**DO** specify exports in a separate section after all imports.\n\n**BAD:**\n```dart\nimport 'src/error.dart';\nexport 'src/error.dart'; // LINT\nimport 'src/string_source.dart';\n```\n\n**GOOD:**\n```dart\nimport 'src/error.dart';\nimport 'src/string_source.dart';\n\nexport 'src/error.dart'; // OK\n```\n\n**DO** sort sections alphabetically.\n\n**BAD:**\n```dart\nimport 'package:foo/bar.dart'; // OK\nimport 'package:bar/bar.dart'; // LINT\n\nimport 'a/b.dart'; // OK\nimport 'a.dart'; // LINT\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'package:foo/bar.dart'; // OK\n\nimport 'a.dart'; // OK\nimport 'a/b.dart'; // OK\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** follow the directive ordering conventions in\n[Effective Dart](https://dart.dev/effective-dart/style#ordering):\n\n**DO** place `dart:` imports before other imports.\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n\nimport 'dart:async'; // LINT\nimport 'dart:html'; // LINT\n```\n\n**BAD:**\n```dart\nimport 'dart:html'; // OK\nimport 'package:bar/bar.dart';\n\nimport 'dart:async'; // LINT\nimport 'package:foo/foo.dart';\n```\n\n**GOOD:**\n```dart\nimport 'dart:async'; // OK\nimport 'dart:html'; // OK\n\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n```\n\n**DO** place `package:` imports before relative imports.\n\n**BAD:**\n```dart\nimport 'a.dart';\nimport 'b.dart';\n\nimport 'package:bar/bar.dart'; // LINT\nimport 'package:foo/foo.dart'; // LINT\n```\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'a.dart';\n\nimport 'package:foo/foo.dart'; // LINT\nimport 'b.dart';\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'package:foo/foo.dart'; // OK\n\nimport 'a.dart';\nimport 'b.dart';\n```\n\n**DO** specify exports in a separate section after all imports.\n\n**BAD:**\n```dart\nimport 'src/error.dart';\nexport 'src/error.dart'; // LINT\nimport 'src/string_source.dart';\n```\n\n**GOOD:**\n```dart\nimport 'src/error.dart';\nimport 'src/string_source.dart';\n\nexport 'src/error.dart'; // OK\n```\n\n**DO** sort sections alphabetically.\n\n**BAD:**\n```dart\nimport 'package:foo/bar.dart'; // OK\nimport 'package:bar/bar.dart'; // LINT\n\nimport 'a/b.dart'; // OK\nimport 'a.dart'; // LINT\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'package:foo/bar.dart'; // OK\n\nimport 'a.dart'; // OK\nimport 'a/b.dart'; // OK\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "discarded_futures",
@@ -1023,8 +1036,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Making asynchronous calls in non-`async` functions is usually the sign of a\nprogramming error. In general these functions should be marked `async` and such\nfutures should likely be awaited (as enforced by `unawaited_futures`).\n\n**DON'T** invoke asynchronous functions in non-`async` blocks.\n\n**BAD:**\n```dart\nvoid recreateDir(String path) {\n deleteDir(path);\n createDir(path);\n}\n\nFuture deleteDir(String path) async {}\n\nFuture createDir(String path) async {}\n```\n\n**GOOD:**\n```dart\nFuture recreateDir(String path) async {\n await deleteDir(path);\n await createDir(path);\n}\n\nFuture deleteDir(String path) async {}\n\nFuture createDir(String path) async {}\n```\n",
- "sinceDartSdk": "2.18.0"
+ "details": "Making asynchronous calls in non-`async` functions is usually the sign of a\nprogramming error. In general these functions should be marked `async` and such\nfutures should likely be awaited (as enforced by `unawaited_futures`).\n\n**DON'T** invoke asynchronous functions in non-`async` blocks.\n\n**BAD:**\n```dart\nvoid recreateDir(String path) {\n deleteDir(path);\n createDir(path);\n}\n\nFuture deleteDir(String path) async {}\n\nFuture createDir(String path) async {}\n```\n\n**GOOD:**\n```dart\nFuture recreateDir(String path) async {\n await deleteDir(path);\n await createDir(path);\n}\n\nFuture deleteDir(String path) async {}\n\nFuture createDir(String path) async {}\n```",
+ "sinceDartSdk": "2.18"
},
{
"name": "do_not_use_environment",
@@ -1036,8 +1049,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "Using values derived from the environment at compile-time, creates\nhidden global state and makes applications hard to understand and maintain.\n\n**DON'T** use `fromEnvironment` or `hasEnvironment` factory constructors.\n\n**BAD:**\n```dart\nconst loggingLevel =\n bool.hasEnvironment('logging') ? String.fromEnvironment('logging') : null;\n```\n",
- "sinceDartSdk": "2.9.0"
+ "details": "Using values derived from the environment at compile-time, creates\nhidden global state and makes applications hard to understand and maintain.\n\n**DON'T** use `fromEnvironment` or `hasEnvironment` factory constructors.\n\n**BAD:**\n```dart\nconst loggingLevel =\n bool.hasEnvironment('logging') ? String.fromEnvironment('logging') : null;\n```",
+ "sinceDartSdk": "2.9"
},
{
"name": "document_ignores",
@@ -1049,8 +1062,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DO** document all ignored diagnostic reports.\n\n**BAD:**\n```dart\n// ignore: unused_element\nint _x = 1;\n```\n\n**GOOD:**\n```dart\n// This private field will be used later.\n// ignore: unused_element\nint _x = 1;\n```\n\n",
- "sinceDartSdk": "3.5.0"
+ "details": "**DO** document all ignored diagnostic reports.\n\n**BAD:**\n```dart\n// ignore: unused_element\nint _x = 1;\n```\n\n**GOOD:**\n```dart\n// This private field will be used later.\n// ignore: unused_element\nint _x = 1;\n```",
+ "sinceDartSdk": "3.5"
},
{
"name": "empty_catches",
@@ -1066,8 +1079,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** empty catch blocks.\n\nIn general, empty catch blocks should be avoided. In cases where they are\nintended, a comment should be provided to explain why exceptions are being\ncaught and suppressed. Alternatively, the exception identifier can be named with\nunderscores (e.g., `_`) to indicate that we intend to skip it.\n\n**BAD:**\n```dart\ntry {\n ...\n} catch(exception) { }\n```\n\n**GOOD:**\n```dart\ntry {\n ...\n} catch(e) {\n // ignored, really.\n}\n\n// Alternatively:\ntry {\n ...\n} catch(_) { }\n\n// Better still:\ntry {\n ...\n} catch(e) {\n doSomething(e);\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** empty catch blocks.\n\nIn general, empty catch blocks should be avoided. In cases where they are\nintended, a comment should be provided to explain why exceptions are being\ncaught and suppressed. Alternatively, the exception identifier can be named with\nunderscores (e.g., `_`) to indicate that we intend to skip it.\n\n**BAD:**\n```dart\ntry {\n ...\n} catch(exception) { }\n```\n\n**GOOD:**\n```dart\ntry {\n ...\n} catch(e) {\n // ignored, really.\n}\n\n// Alternatively:\ntry {\n ...\n} catch(_) { }\n\n// Better still:\ntry {\n ...\n} catch(e) {\n doSomething(e);\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "empty_constructor_bodies",
@@ -1084,8 +1097,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#do-use--instead-of--for-empty-constructor-bodies):\n\n**DO** use `;` instead of `{}` for empty constructor bodies.\n\nIn Dart, a constructor with an empty body can be terminated with just a\nsemicolon. This is required for const constructors. For consistency and\nbrevity, other constructors should also do this.\n\n**BAD:**\n```dart\nclass Point {\n int x, y;\n Point(this.x, this.y) {}\n}\n```\n\n**GOOD:**\n```dart\nclass Point {\n int x, y;\n Point(this.x, this.y);\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#do-use--instead-of--for-empty-constructor-bodies):\n\n**DO** use `;` instead of `{}` for empty constructor bodies.\n\nIn Dart, a constructor with an empty body can be terminated with just a\nsemicolon. This is required for const constructors. For consistency and\nbrevity, other constructors should also do this.\n\n**BAD:**\n```dart\nclass Point {\n int x, y;\n Point(this.x, this.y) {}\n}\n```\n\n**GOOD:**\n```dart\nclass Point {\n int x, y;\n Point(this.x, this.y);\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "empty_statements",
@@ -1100,8 +1113,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**AVOID** empty statements.\n\nEmpty statements almost always indicate a bug.\n\nFor example,\n\n**BAD:**\n```dart\nif (complicated.expression.foo());\n bar();\n```\n\nFormatted with `dart format` the bug becomes obvious:\n\n```dart\nif (complicated.expression.foo()) ;\nbar();\n\n```\n\nBetter to avoid the empty statement altogether.\n\n**GOOD:**\n```dart\nif (complicated.expression.foo())\n bar();\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** empty statements.\n\nEmpty statements almost always indicate a bug.\n\nFor example,\n\n**BAD:**\n```dart\nif (complicated.expression.foo());\n bar();\n```\n\nFormatted with `dart format` the bug becomes obvious:\n\n```dart\nif (complicated.expression.foo()) ;\nbar();\n\n```\n\nBetter to avoid the empty statement altogether.\n\n**GOOD:**\n```dart\nif (complicated.expression.foo())\n bar();\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "enable_null_safety",
@@ -1111,8 +1124,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.0.0; it is no longer functional.\n\n**DO** use sound null safety, by not specifying a dart version lower than `2.12`.\n\n**BAD:**\n```dart\n// @dart=2.8\na() {\n}\n```\n\n**GOOD:**\n```dart\nb() {\n}\n```\n\n",
- "sinceDartSdk": "2.19.0"
+ "details": "NOTE: This rule is removed in Dart 3.0.0; it is no longer functional.\n\n**DO** use sound null safety, by not specifying a dart version lower than `2.12`.\n\n**BAD:**\n```dart\n// @dart=2.8\na() {\n}\n```\n\n**GOOD:**\n```dart\nb() {\n}\n```",
+ "sinceDartSdk": "2.19"
},
{
"name": "eol_at_end_of_file",
@@ -1124,8 +1137,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** put a single newline at the end of non-empty files.\n\n**BAD:**\n```dart\na {\n}\n```\n\n**GOOD:**\n```dart\nb {\n}\n <-- newline\n```\n",
- "sinceDartSdk": "2.14.0"
+ "details": "**DO** put a single newline at the end of non-empty files.\n\n**BAD:**\n```dart\na {\n}\n```\n\n**GOOD:**\n```dart\nb {\n}\n <-- newline\n```",
+ "sinceDartSdk": "2.14"
},
{
"name": "exhaustive_cases",
@@ -1140,8 +1153,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "Switching on instances of enum-like classes should be exhaustive.\n\nEnum-like classes are defined as concrete (non-abstract) classes that have:\n * only private non-factory constructors\n * two or more static const fields whose type is the enclosing class and\n * no subclasses of the class in the defining library\n\n**DO** define case clauses for all constants in enum-like classes.\n\n**BAD:**\n```dart\nclass EnumLike {\n final int i;\n const EnumLike._(this.i);\n\n static const e = EnumLike._(1);\n static const f = EnumLike._(2);\n static const g = EnumLike._(3);\n}\n\nvoid bad(EnumLike e) {\n // Missing case.\n switch(e) { // LINT\n case EnumLike.e :\n print('e');\n break;\n case EnumLike.f :\n print('f');\n break;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass EnumLike {\n final int i;\n const EnumLike._(this.i);\n\n static const e = EnumLike._(1);\n static const f = EnumLike._(2);\n static const g = EnumLike._(3);\n}\n\nvoid ok(EnumLike e) {\n // All cases covered.\n switch(e) { // OK\n case EnumLike.e :\n print('e');\n break;\n case EnumLike.f :\n print('f');\n break;\n case EnumLike.g :\n print('g');\n break;\n }\n}\n```\n",
- "sinceDartSdk": "2.9.0"
+ "details": "Switching on instances of enum-like classes should be exhaustive.\n\nEnum-like classes are defined as concrete (non-abstract) classes that have:\n * only private non-factory constructors\n * two or more static const fields whose type is the enclosing class and\n * no subclasses of the class in the defining library\n\n**DO** define case clauses for all constants in enum-like classes.\n\n**BAD:**\n```dart\nclass EnumLike {\n final int i;\n const EnumLike._(this.i);\n\n static const e = EnumLike._(1);\n static const f = EnumLike._(2);\n static const g = EnumLike._(3);\n}\n\nvoid bad(EnumLike e) {\n // Missing case.\n switch(e) { // LINT\n case EnumLike.e :\n print('e');\n break;\n case EnumLike.f :\n print('f');\n break;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass EnumLike {\n final int i;\n const EnumLike._(this.i);\n\n static const e = EnumLike._(1);\n static const f = EnumLike._(2);\n static const g = EnumLike._(3);\n}\n\nvoid ok(EnumLike e) {\n // All cases covered.\n switch(e) { // OK\n case EnumLike.e :\n print('e');\n break;\n case EnumLike.f :\n print('f');\n break;\n case EnumLike.g :\n print('g');\n break;\n }\n}\n```",
+ "sinceDartSdk": "2.9"
},
{
"name": "file_names",
@@ -1157,8 +1170,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**DO** name source files using `lowercase_with_underscores`.\n\nSome file systems are not case-sensitive, so many projects require filenames to\nbe all lowercase. Using a separating character allows names to still be readable\nin that form. Using underscores as the separator ensures that the name is still\na valid Dart identifier, which may be helpful if the language later supports\nsymbolic imports.\n\n**BAD:**\n\n* `SliderMenu.dart`\n* `filesystem.dart`\n* `file-system.dart`\n\n**GOOD:**\n\n* `slider_menu.dart`\n* `file_system.dart`\n\nFiles without a strict `.dart` extension are ignored. For example:\n\n**OK:**\n\n* `file-system.g.dart`\n* `SliderMenu.css.dart`\n\nThe lint `library_names` can be used to enforce the same kind of naming on the\nlibrary.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** name source files using `lowercase_with_underscores`.\n\nSome file systems are not case-sensitive, so many projects require filenames to\nbe all lowercase. Using a separating character allows names to still be readable\nin that form. Using underscores as the separator ensures that the name is still\na valid Dart identifier, which may be helpful if the language later supports\nsymbolic imports.\n\n**BAD:**\n\n* `SliderMenu.dart`\n* `filesystem.dart`\n* `file-system.dart`\n\n**GOOD:**\n\n* `slider_menu.dart`\n* `file_system.dart`\n\nFiles without a strict `.dart` extension are ignored. For example:\n\n**OK:**\n\n* `file-system.g.dart`\n* `SliderMenu.css.dart`\n\nThe lint `library_names` can be used to enforce the same kind of naming on the\nlibrary.",
+ "sinceDartSdk": "2.0"
},
{
"name": "flutter_style_todos",
@@ -1170,8 +1183,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DO** use Flutter TODO format.\n\nFrom the [Flutter\ndocs](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#comments):\n\n> TODOs should include the string TODO in all caps, followed by the GitHub\nusername of the person with the best context about the problem referenced by the\nTODO in parenthesis. A TODO is not a commitment that the person referenced will\nfix the problem, it is intended to be the person with enough context to explain\nthe problem. Thus, when you create a TODO, it is almost always your username\nthat is given.\n\n**GOOD:**\n```dart\n// TODO(username): message.\n// TODO(username): message, https://URL-to-issue.\n```\n\n",
- "sinceDartSdk": "2.1.0"
+ "details": "**DO** use Flutter TODO format.\n\nFrom the [Flutter\ndocs](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#comments):\n\n> TODOs should include the string TODO in all caps, followed by the GitHub\nusername of the person with the best context about the problem referenced by the\nTODO in parenthesis. A TODO is not a commitment that the person referenced will\nfix the problem, it is intended to be the person with enough context to explain\nthe problem. Thus, when you create a TODO, it is almost always your username\nthat is given.\n\n**GOOD:**\n```dart\n// TODO(username): message.\n// TODO(username): message, https://URL-to-issue.\n```",
+ "sinceDartSdk": "2.1"
},
{
"name": "hash_and_equals",
@@ -1187,8 +1200,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** override `hashCode` if overriding `==` and prefer overriding `==` if\noverriding `hashCode`.\n\nEvery object in Dart has a `hashCode`. Both the `==` operator and the\n`hashCode` property of objects must be consistent in order for a common hash\nmap implementation to function properly. Thus, when overriding `==`, the\n`hashCode` should also be overridden to maintain consistency. Similarly, if\n`hashCode` is overridden, `==` should be also.\n\n**BAD:**\n```dart\nclass Bad {\n final int value;\n Bad(this.value);\n\n @override\n bool operator ==(Object other) => other is Bad && other.value == value;\n}\n```\n\n**GOOD:**\n```dart\nclass Better {\n final int value;\n Better(this.value);\n\n @override\n bool operator ==(Object other) =>\n other is Better &&\n other.runtimeType == runtimeType &&\n other.value == value;\n\n @override\n int get hashCode => value.hashCode;\n}\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** override `hashCode` if overriding `==` and prefer overriding `==` if\noverriding `hashCode`.\n\nEvery object in Dart has a `hashCode`. Both the `==` operator and the\n`hashCode` property of objects must be consistent in order for a common hash\nmap implementation to function properly. Thus, when overriding `==`, the\n`hashCode` should also be overridden to maintain consistency. Similarly, if\n`hashCode` is overridden, `==` should be also.\n\n**BAD:**\n```dart\nclass Bad {\n final int value;\n Bad(this.value);\n\n @override\n bool operator ==(Object other) => other is Bad && other.value == value;\n}\n```\n\n**GOOD:**\n```dart\nclass Better {\n final int value;\n Better(this.value);\n\n @override\n bool operator ==(Object other) =>\n other is Better &&\n other.runtimeType == runtimeType &&\n other.value == value;\n\n @override\n int get hashCode => value.hashCode;\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "implementation_imports",
@@ -1203,8 +1216,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "From the the [pub package layout doc](https://dart.dev/tools/pub/package-layout#implementation-files):\n\n**DON'T** import implementation files from another package.\n\nThe libraries inside `lib` are publicly visible: other packages are free to\nimport them. But much of a package's code is internal implementation libraries\nthat should only be imported and used by the package itself. Those go inside a\nsubdirectory of `lib` called `src`. You can create subdirectories in there if\nit helps you organize things.\n\nYou are free to import libraries that live in `lib/src` from within other Dart\ncode in the same package (like other libraries in `lib`, scripts in `bin`,\nand tests) but you should never import from another package's `lib/src`\ndirectory. Those files are not part of the package's public API, and they\nmight change in ways that could break your code.\n\n**BAD:**\n```dart\n// In 'road_runner'\nimport 'package:acme/src/internals.dart';\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "From the the [pub package layout doc](https://dart.dev/tools/pub/package-layout#implementation-files):\n\n**DON'T** import implementation files from another package.\n\nThe libraries inside `lib` are publicly visible: other packages are free to\nimport them. But much of a package's code is internal implementation libraries\nthat should only be imported and used by the package itself. Those go inside a\nsubdirectory of `lib` called `src`. You can create subdirectories in there if\nit helps you organize things.\n\nYou are free to import libraries that live in `lib/src` from within other Dart\ncode in the same package (like other libraries in `lib`, scripts in `bin`,\nand tests) but you should never import from another package's `lib/src`\ndirectory. Those files are not part of the package's public API, and they\nmight change in ways that could break your code.\n\n**BAD:**\n```dart\n// In 'road_runner'\nimport 'package:acme/src/internals.dart';\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "implicit_call_tearoffs",
@@ -1220,8 +1233,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO**\nExplicitly tear off `.call` methods from objects when assigning to a Function\ntype. There is less magic with an explicit tear off. Future language versions\nmay remove the implicit call tear off.\n\n**BAD:**\n```dart\nclass Callable {\n void call() {}\n}\nvoid callIt(void Function() f) {\n f();\n}\n\ncallIt(Callable());\n```\n\n**GOOD:**\n```dart\nclass Callable {\n void call() {}\n}\nvoid callIt(void Function() f) {\n f();\n}\n\ncallIt(Callable().call);\n```\n\n",
- "sinceDartSdk": "2.19.0"
+ "details": "**DO**\nExplicitly tear off `.call` methods from objects when assigning to a Function\ntype. There is less magic with an explicit tear off. Future language versions\nmay remove the implicit call tear off.\n\n**BAD:**\n```dart\nclass Callable {\n void call() {}\n}\nvoid callIt(void Function() f) {\n f();\n}\n\ncallIt(Callable());\n```\n\n**GOOD:**\n```dart\nclass Callable {\n void call() {}\n}\nvoid callIt(void Function() f) {\n f();\n}\n\ncallIt(Callable().call);\n```",
+ "sinceDartSdk": "2.19"
},
{
"name": "implicit_reopen",
@@ -1233,8 +1246,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Using an `interface`, `base`, `final`, or `sealed` modifier on a class,\nor a `base` modifier on a mixin,\nauthors can control whether classes and mixins allow being implemented,\nextended, and/or mixed in from outside of the library where they're defined.\nIn some cases, it's possible for an author to inadvertently relax these controls\nand implicitly \"reopen\" a class. (A similar reopening cannot occur with a mixin.)\n\nThis lint guards against unintentionally reopening a class by requiring such\ncases to be made explicit with the\n[`@reopen`](https://pub.dev/documentation/meta/latest/meta/reopen-constant.html)\nannotation in `package:meta`.\n\n**BAD:**\n```dart\ninterface class I {}\n\nclass C extends I {} // LINT\n```\n\n**GOOD:**\n```dart\ninterface class I {}\n\nfinal class C extends I {}\n```\n\n```dart\nimport 'package:meta/meta.dart';\n\ninterface class I {}\n\n@reopen\nclass C extends I {}\n```\n",
- "sinceDartSdk": "3.0.0"
+ "details": "Using an `interface`, `base`, `final`, or `sealed` modifier on a class,\nor a `base` modifier on a mixin,\nauthors can control whether classes and mixins allow being implemented,\nextended, and/or mixed in from outside of the library where they're defined.\nIn some cases, it's possible for an author to inadvertently relax these controls\nand implicitly \"reopen\" a class. (A similar reopening cannot occur with a mixin.)\n\nThis lint guards against unintentionally reopening a class by requiring such\ncases to be made explicit with the\n[`@reopen`](https://pub.dev/documentation/meta/latest/meta/reopen-constant.html)\nannotation in `package:meta`.\n\n**BAD:**\n```dart\ninterface class I {}\n\nclass C extends I {} // LINT\n```\n\n**GOOD:**\n```dart\ninterface class I {}\n\nfinal class C extends I {}\n```\n\n```dart\nimport 'package:meta/meta.dart';\n\ninterface class I {}\n\n@reopen\nclass C extends I {}\n```",
+ "sinceDartSdk": "3.0"
},
{
"name": "invalid_case_patterns",
@@ -1246,8 +1259,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Some case expressions that are valid in Dart 2.19 and below will become an error\nor have changed semantics when a library is upgraded to 3.0. This lint flags\nthose expressions in order to ease migration to Dart 3.0.\n\nSome valid switch cases in 2.19 will become compile errors in Dart 3.0:\n\n* Set literals\n* Parenthesized expressions\n* Calls to `identical()`.\n* Unary operator expressions `!`, `-`, or `~` (except for `-` before an integer\n literal, which is a valid pattern and is fine)\n* Binary operator expressions `!=`, `==`, `&`, `|`, `^`, `~/`, `>>`, `>>>`,\n `<<`, `+`, `-`, `*`, `/`, `%`, `<`, `<=`, `>`, `>=`, `??`.\n* Conditional operator `?:`\n* `.length` calls on strings\n* `is` and `is!` expressions\n\nExamples of all of them:\n\n```dart\nswitch (obj) {\n case {1}: // Set literal.\n case (1): // Parenthesized expression.\n case identical(1, 2): // `identical()` call.\n case -pi: // Unary operator.\n case 1 + 2: // Binary operator.\n case true ? 1 : 2: // Conditional operator.\n case 'hi'.length: // .length call.\n case i is int: // is expression.\n}\n```\n\nSome valid switch cases in 2.19 are also syntactically valid patterns, but the\npattern matching behavior may be different from the current constant equality\nbehavior. They are:\n\n**List and map literals.** A list or map literal can appear as a constant in a\ncase:\n\n```dart\nswitch (obj) {\n case [1, 2]: ...\n case {'k': 'v'}: ...\n}\n```\n\nCurrently, the case will only match if the incoming value has the same identity\nas the constant. So:\n\n```dart\ntest(List list) {\n switch (list) {\n case [1, 2]: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const [1, 2]); // Prints \"Matched\".\n test([1, 2]); // Prints \"Did not match\".\n}\n```\n\nWith patterns, a list or map literal becomes a list or map pattern. The pattern\ndestructures the incoming object and matches if the subpatterns all match. In\nother words, list and map pattern match using something more like deep equality.\n\nWith Dart 3.0, the above program prints \"Matched\" twice.\n\n**Constant constructor calls.** Similar to collections, you can construct a\nconstant instance of a class in a case:\n\n```dart\nclass Point {\n final int x;\n final int y;\n const Point({this.x, this.y});\n}\n\ntest(Point p) {\n switch (p) {\n case Point(x: 1, y: 2): print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const Point(1, 2)); // Prints \"Matched\".\n test(Point(1, 2)); // Prints \"Did not match\".\n}\n```\n\nAgain, like collections, the case currently only matches if the incoming value\nhas the same identity. With patterns, the `Point(...)` syntax becomes an object\npattern that destructures the incoming point, calls the `x` and `y` getters on\nit and then matches the results of those against the corresponding subpatterns.\n\nIn this example, it will print \"Matched\" twice.\n\nNote that object patterns only support named fields. So any constant constructor\nin a case today that has positional arguments will become a compile-time error\nwhen parsed as a pattern. A constant constructor call with no arguments is a\nvalid object pattern and only does a type test:\n\n```dart\nclass Thing {\n const Thing();\n}\n\ntest(Thing t) {\n switch (t) {\n case Thing(): print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const Thing()); // Prints \"Matched\".\n test(Thing()); // Prints \"Did not match\".\n}\n```\n\nWhen interpreted as a pattern, this prints \"Matched\" twice.\n\n**Wildcards.** Today, you can have a constant named `_`:\n\n```dart\ntest(int n) {\n const _ = 3;\n switch (n) {\n case _: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(3); // Prints \"Matched\".\n test(5); // Prints \"Did not match\".\n}\n```\n\nWith patterns, the identifier `_` is treated as a pattern that matches all \nvalues, so this prints \"Matched\" twice.\n\n**Logic operators.** The logic operators `&&` and `||` are valid constant\nexpressions and also valid patterns. As a constant expression, they simply\nevaluate the expression to a boolean and match if the incoming value is equal to\nthat boolean value. So:\n\n```dart\ntest(bool b) {\n switch (b) {\n case true && false: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(false); // Prints \"Matched\".\n test(true); // Prints \"Did not match\".\n}\n```\n\nWith Dart 3.0, these become patterns. The above example prints \"Did not match\"\ntwice because no boolean value can be both true and false.\n\nMany of invalid cases can be mechanically changed to something that is valid\nboth in Dart today and valid and means the same in Dart 3.0.\n\n**Parenthesized expressions:** Provided the inner expression is one that's not\nbroken in Dart 3.0, just discard the parentheses.\n\n**List literals, map literals, set literals, and constant constructor calls:**\nPut `const` before the literal or call. This turns it into a constant pattern\nwhich preserves the current behavior:\n\n**BAD:**\n\n```dart\ncase [1, 2]:\ncase {'k': 'v'}:\ncase {1, 2}:\ncase Point(1, 2):\n```\n\n**GOOD:**\n\n```dart\ncase const [1, 2]:\ncase const {'k': 'v'}:\ncase const {1, 2}:\ncase const Point(1, 2):\n```\n\n* **Wildcards:** Rename the constant from `_` to something else. Since the name\nis private, this can be done locally in the library without affecting other\ncode.\n\n* **Everything else:** For any other invalid expression, you have to hoist the\nexpression out into a new named constant. For example, if you have code like\nthis:\n\n\n**BAD:**\n\n```dart\nswitch (n) {\n case 1 + 2: ...\n}\n```\n\nIt can be fixed by changing it to:\n\n**GOOD:**\n\n ```dart\nconst three = 1 + 2;\n\nswitch (n) {\n case three: ...\n}\n```\n",
- "sinceDartSdk": "3.0.0"
+ "details": "Some case expressions that are valid in Dart 2.19 and below will become an error\nor have changed semantics when a library is upgraded to 3.0. This lint flags\nthose expressions in order to ease migration to Dart 3.0.\n\nSome valid switch cases in 2.19 will become compile errors in Dart 3.0:\n\n* Set literals\n* Parenthesized expressions\n* Calls to `identical()`.\n* Unary operator expressions `!`, `-`, or `~` (except for `-` before an integer\n literal, which is a valid pattern and is fine)\n* Binary operator expressions `!=`, `==`, `&`, `|`, `^`, `~/`, `>>`, `>>>`,\n `<<`, `+`, `-`, `*`, `/`, `%`, `<`, `<=`, `>`, `>=`, `??`.\n* Conditional operator `?:`\n* `.length` calls on strings\n* `is` and `is!` expressions\n\nExamples of all of them:\n\n```dart\nswitch (obj) {\n case {1}: // Set literal.\n case (1): // Parenthesized expression.\n case identical(1, 2): // `identical()` call.\n case -pi: // Unary operator.\n case 1 + 2: // Binary operator.\n case true ? 1 : 2: // Conditional operator.\n case 'hi'.length: // .length call.\n case i is int: // is expression.\n}\n```\n\nSome valid switch cases in 2.19 are also syntactically valid patterns, but the\npattern matching behavior may be different from the current constant equality\nbehavior. They are:\n\n**List and map literals.** A list or map literal can appear as a constant in a\ncase:\n\n```dart\nswitch (obj) {\n case [1, 2]: ...\n case {'k': 'v'}: ...\n}\n```\n\nCurrently, the case will only match if the incoming value has the same identity\nas the constant. So:\n\n```dart\ntest(List list) {\n switch (list) {\n case [1, 2]: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const [1, 2]); // Prints \"Matched\".\n test([1, 2]); // Prints \"Did not match\".\n}\n```\n\nWith patterns, a list or map literal becomes a list or map pattern. The pattern\ndestructures the incoming object and matches if the subpatterns all match. In\nother words, list and map pattern match using something more like deep equality.\n\nWith Dart 3.0, the above program prints \"Matched\" twice.\n\n**Constant constructor calls.** Similar to collections, you can construct a\nconstant instance of a class in a case:\n\n```dart\nclass Point {\n final int x;\n final int y;\n const Point({this.x, this.y});\n}\n\ntest(Point p) {\n switch (p) {\n case Point(x: 1, y: 2): print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const Point(1, 2)); // Prints \"Matched\".\n test(Point(1, 2)); // Prints \"Did not match\".\n}\n```\n\nAgain, like collections, the case currently only matches if the incoming value\nhas the same identity. With patterns, the `Point(...)` syntax becomes an object\npattern that destructures the incoming point, calls the `x` and `y` getters on\nit and then matches the results of those against the corresponding subpatterns.\n\nIn this example, it will print \"Matched\" twice.\n\nNote that object patterns only support named fields. So any constant constructor\nin a case today that has positional arguments will become a compile-time error\nwhen parsed as a pattern. A constant constructor call with no arguments is a\nvalid object pattern and only does a type test:\n\n```dart\nclass Thing {\n const Thing();\n}\n\ntest(Thing t) {\n switch (t) {\n case Thing(): print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(const Thing()); // Prints \"Matched\".\n test(Thing()); // Prints \"Did not match\".\n}\n```\n\nWhen interpreted as a pattern, this prints \"Matched\" twice.\n\n**Wildcards.** Today, you can have a constant named `_`:\n\n```dart\ntest(int n) {\n const _ = 3;\n switch (n) {\n case _: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(3); // Prints \"Matched\".\n test(5); // Prints \"Did not match\".\n}\n```\n\nWith patterns, the identifier `_` is treated as a pattern that matches all\nvalues, so this prints \"Matched\" twice.\n\n**Logic operators.** The logic operators `&&` and `||` are valid constant\nexpressions and also valid patterns. As a constant expression, they simply\nevaluate the expression to a boolean and match if the incoming value is equal to\nthat boolean value. So:\n\n```dart\ntest(bool b) {\n switch (b) {\n case true && false: print('Matched'); break;\n default: print('Did not match'); break;\n }\n}\n\nmain() {\n test(false); // Prints \"Matched\".\n test(true); // Prints \"Did not match\".\n}\n```\n\nWith Dart 3.0, these become patterns. The above example prints \"Did not match\"\ntwice because no boolean value can be both true and false.\n\nMany of invalid cases can be mechanically changed to something that is valid\nboth in Dart today and valid and means the same in Dart 3.0.\n\n**Parenthesized expressions:** Provided the inner expression is one that's not\nbroken in Dart 3.0, just discard the parentheses.\n\n**List literals, map literals, set literals, and constant constructor calls:**\nPut `const` before the literal or call. This turns it into a constant pattern\nwhich preserves the current behavior:\n\n**BAD:**\n\n```dart\ncase [1, 2]:\ncase {'k': 'v'}:\ncase {1, 2}:\ncase Point(1, 2):\n```\n\n**GOOD:**\n\n```dart\ncase const [1, 2]:\ncase const {'k': 'v'}:\ncase const {1, 2}:\ncase const Point(1, 2):\n```\n\n* **Wildcards:** Rename the constant from `_` to something else. Since the name\nis private, this can be done locally in the library without affecting other\ncode.\n\n* **Everything else:** For any other invalid expression, you have to hoist the\nexpression out into a new named constant. For example, if you have code like\nthis:\n\n\n**BAD:**\n\n```dart\nswitch (n) {\n case 1 + 2: ...\n}\n```\n\nIt can be fixed by changing it to:\n\n**GOOD:**\n\n ```dart\nconst three = 1 + 2;\n\nswitch (n) {\n case three: ...\n}\n```",
+ "sinceDartSdk": "3.0"
},
{
"name": "invalid_runtime_check_with_js_interop_types",
@@ -1263,8 +1276,8 @@
"flutter"
],
"fixStatus": "needsEvaluation",
- "details": "**DON'T** use `is` checks where the type is a JS interop type.\n\n**DON'T** use `is` checks where the type is a generic Dart type that has JS\ninterop type arguments.\n\n**DON'T** use `is` checks with a JS interop value.\n\n`dart:js_interop` types have runtime types that are different based on whether\nyou are compiling to JS or to Wasm. Therefore, runtime type checks may result in\ndifferent behavior. Runtime checks also do not necessarily check that a JS\ninterop value is a particular JavaScript type.\n\n**BAD:**\n```dart\nextension type HTMLElement(JSObject o) {}\nextension type HTMLDivElement(JSObject o) implements HTMLElement {}\n\nvoid compute(JSAny a, bool b, List lo, List ls, JSObject o,\n HTMLElement e) {\n a is String; // LINT, checking that a JS value is a Dart type\n b is JSBoolean; // LINT, checking that a Dart value is a JS type\n a is JSString; // LINT, checking that a JS value is a different JS interop\n // type\n o is JSNumber; // LINT, checking that a JS value is a different JS interop\n // type\n lo is List; // LINT, JS interop type argument and Dart type argument\n // are incompatible\n ls is List; // LINT, Dart type argument and JS interop type argument\n // are incompatible\n lo is List; // LINT, comparing JS interop type argument with\n // different JS interop type argument\n lo is List; // LINT, comparing JS interop type argument with\n // different JS interop type argument\n o is HTMLElement; // LINT, true because both are JSObjects but doesn't check\n // that it's a JS HTMLElement\n e is HTMLDivElement; // LINT, true because both are JSObjects but doesn't\n // check that it's a JS HTMLDivElement\n}\n```\n\nPrefer using JS interop helpers like `isA` from `dart:js_interop` to check the\nunderlying type of JS interop values.\n\n**GOOD:**\n```dart\nextension type HTMLElement(JSObject o) implements JSObject {}\nextension type HTMLDivElement(JSObject o) implements HTMLElement {}\n\nvoid compute(JSAny a, List l, JSObject o, HTMLElement e) {\n a.isA; // OK, uses JS interop to check it is a JS string\n l[0].isA; // OK, uses JS interop to check it is a JS string\n o.isA(); // OK, uses JS interop to check `o` is an HTMLElement\n e.isA(); // OK, uses JS interop to check `e` is an\n // HTMLDivElement\n}\n```\n\n**DON'T** use `as` to cast a JS interop value to an unrelated Dart type or an\nunrelated Dart value to a JS interop type.\n\n**DON'T** use `as` to cast a JS interop value to a JS interop type represented\nby an incompatible `dart:js_interop` type.\n\n**BAD:**\n```dart\nextension type Window(JSObject o) {}\n\nvoid compute(String s, JSBoolean b, Window w, List l,\n List lo) {\n s as JSString; // LINT, casting Dart type to JS interop type\n b as bool; // LINT, casting JS interop type to Dart type\n b as JSNumber; // LINT, JSBoolean and JSNumber are incompatible\n b as Window; // LINT, JSBoolean and JSObject are incompatible\n w as JSBoolean; // LINT, JSObject and JSBoolean are incompatible\n l as List; // LINT, casting Dart value with Dart type argument to\n // Dart type with JS interop type argument\n lo as List; // LINT, casting Dart value with JS interop type argument\n // to Dart type with Dart type argument\n lo as List; // LINT, casting Dart value with JS interop type\n // argument to Dart type with incompatible JS interop\n // type argument\n}\n```\n\nPrefer using `dart:js_interop` conversion methods to convert a JS interop value\nto a Dart value and vice versa.\n\n**GOOD:**\n```dart\nextension type Window(JSObject o) {}\nextension type Document(JSObject o) {}\n\nvoid compute(String s, JSBoolean b, Window w, JSArray a,\n List ls, JSObject o, List la) {\n s.toJS; // OK, converts the Dart type to a JS type\n b.toDart; // OK, converts the JS type to a Dart type\n a.toDart; // OK, converts the JS type to a Dart type\n w as Document; // OK, but no runtime check that `w` is a JS Document\n ls.map((e) => e.toJS).toList(); // OK, converts the Dart types to JS types\n o as JSArray; // OK, JSObject and JSArray are compatible\n la as List; // OK, JSAny and JSString are compatible\n (o as Object) as JSObject; // OK, Object is a supertype of JSAny\n}\n```\n\n",
- "sinceDartSdk": "3.5.0"
+ "details": "**DON'T** use `is` checks where the type is a JS interop type.\n\n**DON'T** use `is` checks where the type is a generic Dart type that has JS\ninterop type arguments.\n\n**DON'T** use `is` checks with a JS interop value.\n\n`dart:js_interop` types have runtime types that are different based on whether\nyou are compiling to JS or to Wasm. Therefore, runtime type checks may result in\ndifferent behavior. Runtime checks also do not necessarily check that a JS\ninterop value is a particular JavaScript type.\n\n**BAD:**\n```dart\nextension type HTMLElement(JSObject o) {}\nextension type HTMLDivElement(JSObject o) implements HTMLElement {}\n\nvoid compute(JSAny a, bool b, List lo, List ls, JSObject o,\n HTMLElement e) {\n a is String; // LINT, checking that a JS value is a Dart type\n b is JSBoolean; // LINT, checking that a Dart value is a JS type\n a is JSString; // LINT, checking that a JS value is a different JS interop\n // type\n o is JSNumber; // LINT, checking that a JS value is a different JS interop\n // type\n lo is List; // LINT, JS interop type argument and Dart type argument\n // are incompatible\n ls is List; // LINT, Dart type argument and JS interop type argument\n // are incompatible\n lo is List; // LINT, comparing JS interop type argument with\n // different JS interop type argument\n lo is List; // LINT, comparing JS interop type argument with\n // different JS interop type argument\n o is HTMLElement; // LINT, true because both are JSObjects but doesn't check\n // that it's a JS HTMLElement\n e is HTMLDivElement; // LINT, true because both are JSObjects but doesn't\n // check that it's a JS HTMLDivElement\n}\n```\n\nPrefer using JS interop helpers like `isA` from `dart:js_interop` to check the\nunderlying type of JS interop values.\n\n**GOOD:**\n```dart\nextension type HTMLElement(JSObject o) implements JSObject {}\nextension type HTMLDivElement(JSObject o) implements HTMLElement {}\n\nvoid compute(JSAny a, List l, JSObject o, HTMLElement e) {\n a.isA; // OK, uses JS interop to check it is a JS string\n l[0].isA; // OK, uses JS interop to check it is a JS string\n o.isA(); // OK, uses JS interop to check `o` is an HTMLElement\n e.isA(); // OK, uses JS interop to check `e` is an\n // HTMLDivElement\n}\n```\n\n**DON'T** use `as` to cast a JS interop value to an unrelated Dart type or an\nunrelated Dart value to a JS interop type.\n\n**DON'T** use `as` to cast a JS interop value to a JS interop type represented\nby an incompatible `dart:js_interop` type.\n\n**BAD:**\n```dart\nextension type Window(JSObject o) {}\n\nvoid compute(String s, JSBoolean b, Window w, List l,\n List lo) {\n s as JSString; // LINT, casting Dart type to JS interop type\n b as bool; // LINT, casting JS interop type to Dart type\n b as JSNumber; // LINT, JSBoolean and JSNumber are incompatible\n b as Window; // LINT, JSBoolean and JSObject are incompatible\n w as JSBoolean; // LINT, JSObject and JSBoolean are incompatible\n l as List; // LINT, casting Dart value with Dart type argument to\n // Dart type with JS interop type argument\n lo as List; // LINT, casting Dart value with JS interop type argument\n // to Dart type with Dart type argument\n lo as List; // LINT, casting Dart value with JS interop type\n // argument to Dart type with incompatible JS interop\n // type argument\n}\n```\n\nPrefer using `dart:js_interop` conversion methods to convert a JS interop value\nto a Dart value and vice versa.\n\n**GOOD:**\n```dart\nextension type Window(JSObject o) {}\nextension type Document(JSObject o) {}\n\nvoid compute(String s, JSBoolean b, Window w, JSArray a,\n List ls, JSObject o, List la) {\n s.toJS; // OK, converts the Dart type to a JS type\n b.toDart; // OK, converts the JS type to a Dart type\n a.toDart; // OK, converts the JS type to a Dart type\n w as Document; // OK, but no runtime check that `w` is a JS Document\n ls.map((e) => e.toJS).toList(); // OK, converts the Dart types to JS types\n o as JSArray; // OK, JSObject and JSArray are compatible\n la as List; // OK, JSAny and JSString are compatible\n (o as Object) as JSObject; // OK, Object is a supertype of JSAny\n}\n```",
+ "sinceDartSdk": "3.5"
},
{
"name": "invariant_booleans",
@@ -1274,8 +1287,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.0.0; it is no longer functional.\n\n**DON'T** test for conditions that can be inferred at compile time or test the\nsame condition twice.\n\nConditional statements using a condition which cannot be anything but `false`\nhave the effect of making blocks of code non-functional. If the condition\ncannot evaluate to anything but `true`, the conditional statement is completely\nredundant, and makes the code less readable.\nIt is quite likely that the code does not match the programmer's intent.\nEither the condition should be removed or it should be updated so that it does\nnot always evaluate to `true` or `false` and does not perform redundant tests.\nThis rule will hint to the test conflicting with the linted one.\n\n**BAD:**\n```dart\n// foo can't be both equal and not equal to bar in the same expression\nif(foo == bar && something && foo != bar) {...}\n```\n\n**BAD:**\n```dart\nvoid compute(int foo) {\n if (foo == 4) {\n doSomething();\n // we know foo is equal to 4 at this point, so the next condition is always false\n if (foo > 4) {...}\n ...\n }\n ...\n}\n```\n\n**BAD:**\n```dart\nvoid compute(bool foo) {\n if (foo) {\n return;\n }\n doSomething();\n // foo is always false here\n if (foo){...}\n ...\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOK() {\n if (foo == bar) {\n foo = baz;\n if (foo != bar) {...}\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOk2() {\n if (foo == bar) {\n return;\n }\n\n foo = baz;\n if (foo == bar) {...} // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOk5() {\n if (foo != null) {\n if (bar != null) {\n return;\n }\n }\n\n if (bar != null) {...} // OK\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule is removed in Dart 3.0.0; it is no longer functional.\n\n**DON'T** test for conditions that can be inferred at compile time or test the\nsame condition twice.\n\nConditional statements using a condition which cannot be anything but `false`\nhave the effect of making blocks of code non-functional. If the condition\ncannot evaluate to anything but `true`, the conditional statement is completely\nredundant, and makes the code less readable.\nIt is quite likely that the code does not match the programmer's intent.\nEither the condition should be removed or it should be updated so that it does\nnot always evaluate to `true` or `false` and does not perform redundant tests.\nThis rule will hint to the test conflicting with the linted one.\n\n**BAD:**\n```dart\n// foo can't be both equal and not equal to bar in the same expression\nif(foo == bar && something && foo != bar) {...}\n```\n\n**BAD:**\n```dart\nvoid compute(int foo) {\n if (foo == 4) {\n doSomething();\n // we know foo is equal to 4 at this point, so the next condition is always false\n if (foo > 4) {...}\n ...\n }\n ...\n}\n```\n\n**BAD:**\n```dart\nvoid compute(bool foo) {\n if (foo) {\n return;\n }\n doSomething();\n // foo is always false here\n if (foo){...}\n ...\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOK() {\n if (foo == bar) {\n foo = baz;\n if (foo != bar) {...}\n }\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOk2() {\n if (foo == bar) {\n return;\n }\n\n foo = baz;\n if (foo == bar) {...} // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid nestedOk5() {\n if (foo != null) {\n if (bar != null) {\n return;\n }\n }\n\n if (bar != null) {...} // OK\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "iterable_contains_unrelated_type",
@@ -1285,8 +1298,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DON'T** invoke `contains` on `Iterable` with an instance of different type\nthan the parameter type.\n\nDoing this will invoke `==` on its elements and most likely will return `false`.\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction3() {\n List list = [];\n if (list.contains('1')) print('someFunction3'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction8() {\n List list = [];\n DerivedClass3 instance;\n if (list.contains(instance)) print('someFunction8'); // LINT\n}\n```\n\n**BAD:**\n```dart\nabstract class SomeIterable implements Iterable {}\n\nabstract class MyClass implements SomeIterable {\n bool badMethod(String thing) => this.contains(thing); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction10() {\n var list = [];\n if (list.contains(1)) print('someFunction10'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction1() {\n var list = [];\n if (list.contains(1)) print('someFunction1'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction4() {\n List list = [];\n if (list.contains(1)) print('someFunction4'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction5() {\n List list = [];\n DerivedClass1 instance;\n if (list.contains(instance)) print('someFunction5'); // OK\n}\n\nabstract class ClassBase {}\n\nclass DerivedClass1 extends ClassBase {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction6() {\n List list = [];\n DerivedClass2 instance;\n if (list.contains(instance)) print('someFunction6'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass2 extends ClassBase with Mixin {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction7() {\n List list = [];\n DerivedClass3 instance;\n if (list.contains(instance)) print('someFunction7'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass3 extends ClassBase implements Mixin {}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DON'T** invoke `contains` on `Iterable` with an instance of different type\nthan the parameter type.\n\nDoing this will invoke `==` on its elements and most likely will return `false`.\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.contains('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction3() {\n List list = [];\n if (list.contains('1')) print('someFunction3'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction8() {\n List list = [];\n DerivedClass3 instance;\n if (list.contains(instance)) print('someFunction8'); // LINT\n}\n```\n\n**BAD:**\n```dart\nabstract class SomeIterable implements Iterable {}\n\nabstract class MyClass implements SomeIterable {\n bool badMethod(String thing) => this.contains(thing); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction10() {\n var list = [];\n if (list.contains(1)) print('someFunction10'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction1() {\n var list = [];\n if (list.contains(1)) print('someFunction1'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction4() {\n List list = [];\n if (list.contains(1)) print('someFunction4'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction5() {\n List list = [];\n DerivedClass1 instance;\n if (list.contains(instance)) print('someFunction5'); // OK\n}\n\nabstract class ClassBase {}\n\nclass DerivedClass1 extends ClassBase {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction6() {\n List list = [];\n DerivedClass2 instance;\n if (list.contains(instance)) print('someFunction6'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass2 extends ClassBase with Mixin {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction7() {\n List list = [];\n DerivedClass3 instance;\n if (list.contains(instance)) print('someFunction7'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass3 extends ClassBase implements Mixin {}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "join_return_with_assignment",
@@ -1299,8 +1312,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DO** join return statement with assignment when possible.\n\n**BAD:**\n```dart\nclass A {\n B _lazyInstance;\n static B get instance {\n _lazyInstance ??= B(); // LINT\n return _lazyInstance;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n B _lazyInstance;\n static B get instance => _lazyInstance ??= B();\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** join return statement with assignment when possible.\n\n**BAD:**\n```dart\nclass A {\n B _lazyInstance;\n static B get instance {\n _lazyInstance ??= B(); // LINT\n return _lazyInstance;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n B _lazyInstance;\n static B get instance => _lazyInstance ??= B();\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "leading_newlines_in_multiline_strings",
@@ -1312,8 +1325,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Multiline strings are easier to read when they start with a newline (a newline\nstarting a multiline string is ignored).\n\n**BAD:**\n```dart\nvar s1 = '''{\n \"a\": 1,\n \"b\": 2\n}''';\n```\n\n**GOOD:**\n```dart\nvar s1 = '''\n{\n \"a\": 1,\n \"b\": 2\n}''';\n\nvar s2 = '''This one-liner multiline string is ok. It usually allows to escape both ' and \" in the string.''';\n```\n\n",
- "sinceDartSdk": "2.8.1"
+ "details": "Multiline strings are easier to read when they start with a newline (a newline\nstarting a multiline string is ignored).\n\n**BAD:**\n```dart\nvar s1 = '''{\n \"a\": 1,\n \"b\": 2\n}''';\n```\n\n**GOOD:**\n```dart\nvar s1 = '''\n{\n \"a\": 1,\n \"b\": 2\n}''';\n\nvar s2 = '''This one-liner multiline string is ok. It usually allows to escape both ' and \" in the string.''';\n```",
+ "sinceDartSdk": "2.8"
},
{
"name": "library_annotations",
@@ -1329,8 +1342,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "Attach library annotations to library directives, rather than\nsome other library-level element.\n\n**BAD:**\n```dart\n@TestOn('browser')\n\nimport 'package:test/test.dart';\n\nvoid main() {}\n```\n\n**GOOD:**\n```dart\n@TestOn('browser')\nlibrary;\n\nimport 'package:test/test.dart';\n\nvoid main() {}\n```\n\n**NOTE:** An unnamed library, like `library;` above, is only supported in Dart\n2.19 and later. Code which might run in earlier versions of Dart will need to\nprovide a name in the `library` directive.\n",
- "sinceDartSdk": "2.19.0"
+ "details": "Attach library annotations to library directives, rather than\nsome other library-level element.\n\n**BAD:**\n```dart\n@TestOn('browser')\n\nimport 'package:test/test.dart';\n\nvoid main() {}\n```\n\n**GOOD:**\n```dart\n@TestOn('browser')\nlibrary;\n\nimport 'package:test/test.dart';\n\nvoid main() {}\n```\n\n**NOTE:** An unnamed library, like `library;` above, is only supported in Dart\n2.19 and later. Code which might run in earlier versions of Dart will need to\nprovide a name in the `library` directive.",
+ "sinceDartSdk": "2.19"
},
{
"name": "library_names",
@@ -1342,8 +1355,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DO** name libraries using `lowercase_with_underscores`.\n\nSome file systems are not case-sensitive, so many projects require filenames to\nbe all lowercase. Using a separating character allows names to still be readable\nin that form. Using underscores as the separator ensures that the name is still\na valid Dart identifier, which may be helpful if the language later supports\nsymbolic imports.\n\n**BAD:**\n```dart\nlibrary peg-parser;\n```\n\n**GOOD:**\n```dart\nlibrary peg_parser;\n```\n\nThe lint `file_names` can be used to enforce the same kind of naming on the\nfile.\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** name libraries using `lowercase_with_underscores`.\n\nSome file systems are not case-sensitive, so many projects require filenames to\nbe all lowercase. Using a separating character allows names to still be readable\nin that form. Using underscores as the separator ensures that the name is still\na valid Dart identifier, which may be helpful if the language later supports\nsymbolic imports.\n\n**BAD:**\n```dart\nlibrary peg-parser;\n```\n\n**GOOD:**\n```dart\nlibrary peg_parser;\n```\n\nThe lint `file_names` can be used to enforce the same kind of naming on the\nfile.",
+ "sinceDartSdk": "2.0"
},
{
"name": "library_prefixes",
@@ -1358,8 +1371,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**DO** use `lowercase_with_underscores` when specifying a library prefix.\n\n**BAD:**\n```dart\nimport 'dart:math' as Math;\nimport 'dart:json' as JSON;\nimport 'package:js/js.dart' as JS;\nimport 'package:javascript_utils/javascript_utils.dart' as jsUtils;\n```\n\n**GOOD:**\n```dart\nimport 'dart:math' as math;\nimport 'dart:json' as json;\nimport 'package:js/js.dart' as js;\nimport 'package:javascript_utils/javascript_utils.dart' as js_utils;\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** use `lowercase_with_underscores` when specifying a library prefix.\n\n**BAD:**\n```dart\nimport 'dart:math' as Math;\nimport 'dart:json' as JSON;\nimport 'package:js/js.dart' as JS;\nimport 'package:javascript_utils/javascript_utils.dart' as jsUtils;\n```\n\n**GOOD:**\n```dart\nimport 'dart:math' as math;\nimport 'dart:json' as json;\nimport 'package:js/js.dart' as js;\nimport 'package:javascript_utils/javascript_utils.dart' as js_utils;\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "library_private_types_in_public_api",
@@ -1374,8 +1387,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**AVOID** using library private types in public APIs.\n\nFor the purposes of this lint, a public API is considered to be any top-level or\nmember declaration unless the declaration is library private or contained in a\ndeclaration that's library private. The following uses of types are checked:\n\n- the return type of a function or method,\n- the type of any parameter of a function or method,\n- the bound of a type parameter to any function, method, class, mixin,\n extension's extended type, or type alias,\n- the type of any top level variable or field,\n- any type used in the declaration of a type alias (for example\n `typedef F = _Private Function();`), or\n- any type used in the `on` clause of an extension or a mixin\n\n**BAD:**\n```dart\nf(_Private p) { ... }\nclass _Private {}\n```\n\n**GOOD:**\n```dart\nf(String s) { ... }\n```\n\n",
- "sinceDartSdk": "2.14.0"
+ "details": "**AVOID** using library private types in public APIs.\n\nFor the purposes of this lint, a public API is considered to be any top-level or\nmember declaration unless the declaration is library private or contained in a\ndeclaration that's library private. The following uses of types are checked:\n\n- the return type of a function or method,\n- the type of any parameter of a function or method,\n- the bound of a type parameter to any function, method, class, mixin,\n extension's extended type, or type alias,\n- the type of any top level variable or field,\n- any type used in the declaration of a type alias (for example\n `typedef F = _Private Function();`), or\n- any type used in the `on` clause of an extension or a mixin\n\n**BAD:**\n```dart\nf(_Private p) { ... }\nclass _Private {}\n```\n\n**GOOD:**\n```dart\nf(String s) { ... }\n```",
+ "sinceDartSdk": "2.14"
},
{
"name": "lines_longer_than_80_chars",
@@ -1387,8 +1400,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**AVOID** lines longer than 80 characters\n\nReadability studies show that long lines of text are harder to read because your\neye has to travel farther when moving to the beginning of the next line. This is\nwhy newspapers and magazines use multiple columns of text.\n\nIf you really find yourself wanting lines longer than 80 characters, our\nexperience is that your code is likely too verbose and could be a little more\ncompact. The main offender is usually `VeryLongCamelCaseClassNames`. Ask\nyourself, “Does each word in that type name tell me something critical or\nprevent a name collision?” If not, consider omitting it.\n\nNote that `dart format` does 99% of this for you, but the last 1% is you. It\ndoes not split long string literals to fit in 80 columns, so you have to do\nthat manually.\n\nWe make an exception for URIs and file paths. When those occur in comments or\nstrings (usually in imports and exports), they may remain on a single line even\nif they go over the line limit. This makes it easier to search source files for\na given path.\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**AVOID** lines longer than 80 characters\n\nReadability studies show that long lines of text are harder to read because your\neye has to travel farther when moving to the beginning of the next line. This is\nwhy newspapers and magazines use multiple columns of text.\n\nIf you really find yourself wanting lines longer than 80 characters, our\nexperience is that your code is likely too verbose and could be a little more\ncompact. The main offender is usually `VeryLongCamelCaseClassNames`. Ask\nyourself, “Does each word in that type name tell me something critical or\nprevent a name collision?” If not, consider omitting it.\n\nNote that `dart format` does 99% of this for you, but the last 1% is you. It\ndoes not split long string literals to fit in 80 columns, so you have to do\nthat manually.\n\nWe make an exception for URIs and file paths. When those occur in comments or\nstrings (usually in imports and exports), they may remain on a single line even\nif they go over the line limit. This makes it easier to search source files for\na given path.",
+ "sinceDartSdk": "2.0"
},
{
"name": "list_remove_unrelated_type",
@@ -1398,8 +1411,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DON'T** invoke `remove` on `List` with an instance of different type than\nthe parameter type.\n\nDoing this will invoke `==` on its elements and most likely will\nreturn `false`.\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.remove('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction3() {\n List list = [];\n if (list.remove('1')) print('someFunction3'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction8() {\n List list = [];\n DerivedClass3 instance;\n if (list.remove(instance)) print('someFunction8'); // LINT\n}\n```\n\n**BAD:**\n```dart\nabstract class SomeList implements List {}\n\nabstract class MyClass implements SomeList {\n bool badMethod(String thing) => this.remove(thing); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction10() {\n var list = [];\n if (list.remove(1)) print('someFunction10'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction1() {\n var list = [];\n if (list.remove(1)) print('someFunction1'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction4() {\n List list = [];\n if (list.remove(1)) print('someFunction4'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction5() {\n List list = [];\n DerivedClass1 instance;\n if (list.remove(instance)) print('someFunction5'); // OK\n}\n\nabstract class ClassBase {}\n\nclass DerivedClass1 extends ClassBase {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction6() {\n List list = [];\n DerivedClass2 instance;\n if (list.remove(instance)) print('someFunction6'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass2 extends ClassBase with Mixin {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction7() {\n List list = [];\n DerivedClass3 instance;\n if (list.remove(instance)) print('someFunction7'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass3 extends ClassBase implements Mixin {}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "NOTE: This rule is removed in Dart 3.3.0; it is no longer functional.\n\n**DON'T** invoke `remove` on `List` with an instance of different type than\nthe parameter type.\n\nDoing this will invoke `==` on its elements and most likely will\nreturn `false`.\n\n**BAD:**\n```dart\nvoid someFunction() {\n var list = [];\n if (list.remove('1')) print('someFunction'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction3() {\n List list = [];\n if (list.remove('1')) print('someFunction3'); // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid someFunction8() {\n List list = [];\n DerivedClass3 instance;\n if (list.remove(instance)) print('someFunction8'); // LINT\n}\n```\n\n**BAD:**\n```dart\nabstract class SomeList implements List {}\n\nabstract class MyClass implements SomeList {\n bool badMethod(String thing) => this.remove(thing); // LINT\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction10() {\n var list = [];\n if (list.remove(1)) print('someFunction10'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction1() {\n var list = [];\n if (list.remove(1)) print('someFunction1'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction4() {\n List list = [];\n if (list.remove(1)) print('someFunction4'); // OK\n}\n```\n\n**GOOD:**\n```dart\nvoid someFunction5() {\n List list = [];\n DerivedClass1 instance;\n if (list.remove(instance)) print('someFunction5'); // OK\n}\n\nabstract class ClassBase {}\n\nclass DerivedClass1 extends ClassBase {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction6() {\n List list = [];\n DerivedClass2 instance;\n if (list.remove(instance)) print('someFunction6'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass2 extends ClassBase with Mixin {}\n```\n\n**GOOD:**\n```dart\nvoid someFunction7() {\n List list = [];\n DerivedClass3 instance;\n if (list.remove(instance)) print('someFunction7'); // OK\n}\n\nabstract class ClassBase {}\n\nabstract class Mixin {}\n\nclass DerivedClass3 extends ClassBase implements Mixin {}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "literal_only_boolean_expressions",
@@ -1411,8 +1424,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "**DON'T** test for conditions composed only by literals, since the value can be\ninferred at compile time.\n\nConditional statements using a condition which cannot be anything but FALSE have\nthe effect of making blocks of code non-functional. If the condition cannot\nevaluate to anything but `true`, the conditional statement is completely\nredundant, and makes the code less readable.\nIt is quite likely that the code does not match the programmer's intent.\nEither the condition should be removed or it should be updated so that it does\nnot always evaluate to `true` or `false`.\n\n**BAD:**\n```dart\nvoid bad() {\n if (true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && 1 != 0) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0 && true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 < 0 && true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && false) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && 1 != 0 || 3 < 4) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0 || 3 < 4 && true) {} // LINT\n}\n```\n\n**NOTE:** that an exception is made for the common `while (true) { }` idiom,\nwhich is often reasonably preferred to the equivalent `for (;;)`.\n\n**GOOD:**\n```dart\nvoid good() {\n while (true) {\n // Do stuff.\n }\n}\n```\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** test for conditions composed only by literals, since the value can be\ninferred at compile time.\n\nConditional statements using a condition which cannot be anything but FALSE have\nthe effect of making blocks of code non-functional. If the condition cannot\nevaluate to anything but `true`, the conditional statement is completely\nredundant, and makes the code less readable.\nIt is quite likely that the code does not match the programmer's intent.\nEither the condition should be removed or it should be updated so that it does\nnot always evaluate to `true` or `false`.\n\n**BAD:**\n```dart\nvoid bad() {\n if (true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && 1 != 0) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0 && true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 < 0 && true) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && false) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (true && 1 != 0 || 3 < 4) {} // LINT\n}\n```\n\n**BAD:**\n```dart\nvoid bad() {\n if (1 != 0 || 3 < 4 && true) {} // LINT\n}\n```\n\n**NOTE:** that an exception is made for the common `while (true) { }` idiom,\nwhich is often reasonably preferred to the equivalent `for (;;)`.\n\n**GOOD:**\n```dart\nvoid good() {\n while (true) {\n // Do stuff.\n }\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "matching_super_parameters",
@@ -1424,8 +1437,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DO** use super parameter names that match their corresponding super\nconstructor's parameter names.\n\n**BAD:**\n\n```dart\nclass Rectangle {\n final int width;\n final int height;\n \n Rectangle(this.width, this.height);\n}\n\nclass ColoredRectangle extends Rectangle {\n final Color color;\n \n ColoredRectangle(\n this.color,\n super.height, // Bad, actually corresponds to the `width` parameter.\n super.width, // Bad, actually corresponds to the `height` parameter.\n ); \n}\n```\n\n**GOOD:**\n\n```dart\nclass Rectangle {\n final int width;\n final int height;\n \n Rectangle(this.width, this.height);\n}\n\nclass ColoredRectangle extends Rectangle {\n final Color color;\n \n ColoredRectangle(\n this.color,\n super.width,\n super.height, \n ); \n}\n```\n",
- "sinceDartSdk": "3.0.0"
+ "details": "**DO** use super parameter names that match their corresponding super\nconstructor's parameter names.\n\n**BAD:**\n\n```dart\nclass Rectangle {\n final int width;\n final int height;\n\n Rectangle(this.width, this.height);\n}\n\nclass ColoredRectangle extends Rectangle {\n final Color color;\n\n ColoredRectangle(\n this.color,\n super.height, // Bad, actually corresponds to the `width` parameter.\n super.width, // Bad, actually corresponds to the `height` parameter.\n );\n}\n```\n\n**GOOD:**\n\n```dart\nclass Rectangle {\n final int width;\n final int height;\n\n Rectangle(this.width, this.height);\n}\n\nclass ColoredRectangle extends Rectangle {\n final Color color;\n\n ColoredRectangle(\n this.color,\n super.width,\n super.height,\n );\n}\n```",
+ "sinceDartSdk": "3.0"
},
{
"name": "missing_code_block_language_in_doc_comment",
@@ -1437,8 +1450,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsEvaluation",
- "details": "**DO** specify the language used in the code block of a doc comment.\n\nTo enable proper syntax highlighting of Markdown code blocks,\n[`dart doc`](https://dart.dev/tools/dart-doc) strongly recommends code blocks to\nspecify the language used after the initial code fence.\n\nSee [highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md)\nfor the list of languages supported by `dart doc`.\nTo disable syntax highlighting or if no language is suitable,\nyou can specify `none` as the language.\n\n**BAD:**\n```dart\n/// ```\n/// void main() {}\n/// ```\nclass A {}\n```\n\n**GOOD:**\n```dart\n/// ```dart\n/// void main() {}\n/// ```\nclass A {}\n```\n\n",
- "sinceDartSdk": "3.4.0"
+ "details": "**DO** specify the language used in the code block of a doc comment.\n\nTo enable proper syntax highlighting of Markdown code blocks,\n[`dart doc`](https://dart.dev/tools/dart-doc) strongly recommends code blocks to\nspecify the language used after the initial code fence.\n\nSee [highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md)\nfor the list of languages supported by `dart doc`.\nTo disable syntax highlighting or if no language is suitable,\nyou can specify `none` as the language.\n\n**BAD:**\n```dart\n/// ```\n/// void main() {}\n/// ```\nclass A {}\n```\n\n**GOOD:**\n```dart\n/// ```dart\n/// void main() {}\n/// ```\nclass A {}\n```",
+ "sinceDartSdk": "3.4"
},
{
"name": "missing_whitespace_between_adjacent_strings",
@@ -1450,8 +1463,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "Add a trailing whitespace to prevent missing whitespace between adjacent\nstrings.\n\nWith long text split across adjacent strings it's easy to forget a whitespace\nbetween strings.\n\n**BAD:**\n```dart\nvar s =\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed'\n 'do eiusmod tempor incididunt ut labore et dolore magna';\n```\n\n**GOOD:**\n```dart\nvar s =\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed '\n 'do eiusmod tempor incididunt ut labore et dolore magna';\n```\n\n",
- "sinceDartSdk": "2.8.1"
+ "details": "Add a trailing whitespace to prevent missing whitespace between adjacent\nstrings.\n\nWith long text split across adjacent strings it's easy to forget a whitespace\nbetween strings.\n\n**BAD:**\n```dart\nvar s =\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed'\n 'do eiusmod tempor incididunt ut labore et dolore magna';\n```\n\n**GOOD:**\n```dart\nvar s =\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed '\n 'do eiusmod tempor incididunt ut labore et dolore magna';\n```",
+ "sinceDartSdk": "2.8"
},
{
"name": "no_adjacent_strings_in_list",
@@ -1463,8 +1476,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "**DON'T** use adjacent strings in a list.\n\nThis can indicate a forgotten comma.\n\n**BAD:**\n```dart\nList list = [\n 'a'\n 'b',\n 'c',\n];\n```\n\n**GOOD:**\n```dart\nList list = [\n 'a' +\n 'b',\n 'c',\n];\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** use adjacent strings in a list.\n\nThis can indicate a forgotten comma.\n\n**BAD:**\n```dart\nList list = [\n 'a'\n 'b',\n 'c',\n];\n```\n\n**GOOD:**\n```dart\nList list = [\n 'a' +\n 'b',\n 'c',\n];\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "no_default_cases",
@@ -1476,8 +1489,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsFix",
- "details": "Switches on enums and enum-like classes should not use a `default` clause.\n\nEnum-like classes are defined as concrete (non-abstract) classes that have:\n * only private non-factory constructors\n * two or more static const fields whose type is the enclosing class and\n * no subclasses of the class in the defining library\n\n**DO** define default behavior outside switch statements.\n\n**BAD:**\n```dart\n switch (testEnum) {\n case TestEnum.A:\n return '123';\n case TestEnum.B:\n return 'abc';\n default:\n return null;\n }\n```\n\n**GOOD:**\n```dart\n switch (testEnum) {\n case TestEnum.A:\n return '123';\n case TestEnum.B:\n return 'abc';\n }\n // Default here.\n return null;\n```\n\n",
- "sinceDartSdk": "2.9.0"
+ "details": "Switches on enums and enum-like classes should not use a `default` clause.\n\nEnum-like classes are defined as concrete (non-abstract) classes that have:\n * only private non-factory constructors\n * two or more static const fields whose type is the enclosing class and\n * no subclasses of the class in the defining library\n\n**DO** define default behavior outside switch statements.\n\n**BAD:**\n```dart\n switch (testEnum) {\n case TestEnum.A:\n return '123';\n case TestEnum.B:\n return 'abc';\n default:\n return null;\n }\n```\n\n**GOOD:**\n```dart\n switch (testEnum) {\n case TestEnum.A:\n return '123';\n case TestEnum.B:\n return 'abc';\n }\n // Default here.\n return null;\n```",
+ "sinceDartSdk": "2.9"
},
{
"name": "no_duplicate_case_values",
@@ -1493,8 +1506,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** use more than one case with same value.\n\nThis is usually a typo or changed value of constant.\n\n**BAD:**\n```dart\nconst int A = 1;\nswitch (v) {\n case 1:\n case 2:\n case A:\n case 2:\n}\n```\n\n**GOOD:**\n```dart\nconst int A = 1;\nswitch (v) {\n case A:\n case 2:\n}\n```\n\nNOTE: this lint only reports duplicate cases in libraries opted in to Dart 2.19\nand below. In Dart 3.0 and after, duplicate cases are reported as dead code\nby the analyzer.\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** use more than one case with same value.\n\nThis is usually a typo or changed value of constant.\n\n**BAD:**\n```dart\nconst int A = 1;\nswitch (v) {\n case 1:\n case 2:\n case A:\n case 2:\n}\n```\n\n**GOOD:**\n```dart\nconst int A = 1;\nswitch (v) {\n case A:\n case 2:\n}\n```\n\nNOTE: this lint only reports duplicate cases in libraries opted in to Dart 2.19\nand below. In Dart 3.0 and after, duplicate cases are reported as dead code\nby the analyzer.",
+ "sinceDartSdk": "2.0"
},
{
"name": "no_leading_underscores_for_library_prefixes",
@@ -1509,8 +1522,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** use a leading underscore for library prefixes.\nThere is no concept of \"private\" for library prefixes. When one of those has a\nname that starts with an underscore, it sends a confusing signal to the reader. \nTo avoid that, don't use leading underscores in those names.\n\n**BAD:**\n```dart\nimport 'dart:core' as _core;\n```\n\n**GOOD:**\n```dart\nimport 'dart:core' as core;\n```\n",
- "sinceDartSdk": "2.16.0"
+ "details": "**DON'T** use a leading underscore for library prefixes.\nThere is no concept of \"private\" for library prefixes. When one of those has a\nname that starts with an underscore, it sends a confusing signal to the reader.\nTo avoid that, don't use leading underscores in those names.\n\n**BAD:**\n```dart\nimport 'dart:core' as _core;\n```\n\n**GOOD:**\n```dart\nimport 'dart:core' as core;\n```",
+ "sinceDartSdk": "2.16"
},
{
"name": "no_leading_underscores_for_local_identifiers",
@@ -1525,8 +1538,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** use a leading underscore for identifiers that aren't private. Dart\nuses a leading underscore in an identifier to mark members and top-level\ndeclarations as private. This trains users to associate a leading underscore\nwith one of those kinds of declarations. They see `_` and think \"private\".\nThere is no concept of \"private\" for local variables or parameters. When one of \nthose has a name that starts with an underscore, it sends a confusing signal to\nthe reader. To avoid that, don't use leading underscores in those names.\n\n**EXCEPTION:**: An unused parameter can be named `_`, `__`, `___`, etc. This is\ncommon practice in callbacks where you are passed a value but you don't need\nto use it. Giving it a name that consists solely of underscores is the idiomatic\nway to indicate that the value isn't used.\n\n**BAD:**\n```dart\nvoid print(String _name) {\n var _size = _name.length;\n ...\n}\n```\n**GOOD:**\n\n```dart\nvoid print(String name) {\n var size = name.length;\n ...\n}\n```\n\n**OK:**\n\n```dart\n[1,2,3].map((_) => print('Hello'));\n```\n",
- "sinceDartSdk": "2.16.0"
+ "details": "**DON'T** use a leading underscore for identifiers that aren't private. Dart\nuses a leading underscore in an identifier to mark members and top-level\ndeclarations as private. This trains users to associate a leading underscore\nwith one of those kinds of declarations. They see `_` and think \"private\".\nThere is no concept of \"private\" for local variables or parameters. When one of\nthose has a name that starts with an underscore, it sends a confusing signal to\nthe reader. To avoid that, don't use leading underscores in those names.\n\n**EXCEPTION:**: An unused parameter can be named `_`, `__`, `___`, etc. This is\ncommon practice in callbacks where you are passed a value but you don't need\nto use it. Giving it a name that consists solely of underscores is the idiomatic\nway to indicate that the value isn't used.\n\n**BAD:**\n```dart\nvoid print(String _name) {\n var _size = _name.length;\n ...\n}\n```\n**GOOD:**\n\n```dart\nvoid print(String name) {\n var size = name.length;\n ...\n}\n```\n\n**OK:**\n\n```dart\n[1,2,3].map((_) => print('Hello'));\n```",
+ "sinceDartSdk": "2.16"
},
{
"name": "no_literal_bool_comparisons",
@@ -1539,8 +1552,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#dont-use-true-or-false-in-equality-operations):\n\n**DON'T** use `true` or `false` in equality operations.\n\nThis lint applies only if the expression is of a non-nullable `bool` type.\n\n**BAD:**\n```dart\nif (someBool == true) {\n print('true!');\n}\nwhile (someBool == false) {\n print('still false!');\n}\n```\n\n**GOOD:**\n```dart\nif (someBool) {\n print('true!');\n}\nwhile (!someBool) {\n print('still false!');\n}\n```\n",
- "sinceDartSdk": "3.0.0"
+ "details": "From [Effective Dart](https://dart.dev/effective-dart/usage#dont-use-true-or-false-in-equality-operations):\n\n**DON'T** use `true` or `false` in equality operations.\n\nThis lint applies only if the expression is of a non-nullable `bool` type.\n\n**BAD:**\n```dart\nif (someBool == true) {\n print('true!');\n}\nwhile (someBool == false) {\n print('still false!');\n}\n```\n\n**GOOD:**\n```dart\nif (someBool) {\n print('true!');\n}\nwhile (!someBool) {\n print('still false!');\n}\n```",
+ "sinceDartSdk": "3.0"
},
{
"name": "no_logic_in_create_state",
@@ -1555,8 +1568,8 @@
"flutter"
],
"fixStatus": "noFix",
- "details": "**DON'T** put any logic in `createState()`.\n\nImplementations of `createState()` should return a new instance\nof a State object and do nothing more. Since state access is preferred \nvia the `widget` field, passing data to `State` objects using custom\nconstructor parameters should also be avoided and so further, the State\nconstructor is required to be passed no arguments.\n\n**BAD:**\n```dart\nMyState global;\n\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() {\n global = MyState();\n return global;\n } \n}\n```\n\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() => MyState()..field = 42;\n}\n```\n\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() => MyState(42);\n}\n```\n\n\n**GOOD:**\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() {\n return MyState();\n }\n}\n```\n",
- "sinceDartSdk": "2.8.1"
+ "details": "**DON'T** put any logic in `createState()`.\n\nImplementations of `createState()` should return a new instance\nof a State object and do nothing more. Since state access is preferred\nvia the `widget` field, passing data to `State` objects using custom\nconstructor parameters should also be avoided and so further, the State\nconstructor is required to be passed no arguments.\n\n**BAD:**\n```dart\nMyState global;\n\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() {\n global = MyState();\n return global;\n }\n}\n```\n\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() => MyState()..field = 42;\n}\n```\n\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() => MyState(42);\n}\n```\n\n\n**GOOD:**\n```dart\nclass MyStateful extends StatefulWidget {\n @override\n MyState createState() {\n return MyState();\n }\n}\n```",
+ "sinceDartSdk": "2.8"
},
{
"name": "no_runtimeType_toString",
@@ -1568,8 +1581,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
- "details": "Calling `toString` on a runtime type is a non-trivial operation that can\nnegatively impact performance. It's better to avoid it.\n\n**BAD:**\n```dart\nclass A {\n String toString() => '$runtimeType()';\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n String toString() => 'A()';\n}\n```\n\nThis lint has some exceptions where performance is not a problem or where real\ntype information is more important than performance:\n\n* in an assertion\n* in a throw expression\n* in a catch clause\n* in a mixin declaration\n* in an abstract class declaration\n\n",
- "sinceDartSdk": "2.8.1"
+ "details": "Calling `toString` on a runtime type is a non-trivial operation that can\nnegatively impact performance. It's better to avoid it.\n\n**BAD:**\n```dart\nclass A {\n String toString() => '$runtimeType()';\n}\n```\n\n**GOOD:**\n```dart\nclass A {\n String toString() => 'A()';\n}\n```\n\nThis lint has some exceptions where performance is not a problem or where real\ntype information is more important than performance:\n\n* in an assertion\n* in a throw expression\n* in a catch clause\n* in a mixin declaration\n* in an abstract class declaration",
+ "sinceDartSdk": "2.8"
},
{
"name": "no_self_assignments",
@@ -1581,8 +1594,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "needsEvaluation",
- "details": "**DON'T** assign a variable to itself. Usually this is a mistake.\n\n**BAD:**\n```dart\nclass C {\n int x;\n\n C(int x) {\n x = x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x;\n\n C(int x) : x = x;\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x;\n\n C(int x) {\n this.x = x;\n }\n}\n```\n\n**BAD:**\n```dart\nclass C {\n int _x = 5;\n\n int get x => _x;\n\n set x(int x) {\n _x = x;\n _customUpdateLogic();\n }\n\n void _customUpdateLogic() {\n print('updated');\n }\n\n void example() {\n x = x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int _x = 5;\n\n int get x => _x;\n\n set x(int x) {\n _x = x;\n _customUpdateLogic();\n }\n\n void _customUpdateLogic() {\n print('updated');\n }\n\n void example() {\n _customUpdateLogic();\n }\n}\n```\n\n**BAD:**\n```dart\nclass C {\n int x = 5;\n\n void update(C other) {\n this.x = this.x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x = 5;\n\n void update(C other) {\n this.x = other.x;\n }\n}\n```\n\n",
- "sinceDartSdk": "3.1.0"
+ "details": "**DON'T** assign a variable to itself. Usually this is a mistake.\n\n**BAD:**\n```dart\nclass C {\n int x;\n\n C(int x) {\n x = x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x;\n\n C(int x) : x = x;\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x;\n\n C(int x) {\n this.x = x;\n }\n}\n```\n\n**BAD:**\n```dart\nclass C {\n int _x = 5;\n\n int get x => _x;\n\n set x(int x) {\n _x = x;\n _customUpdateLogic();\n }\n\n void _customUpdateLogic() {\n print('updated');\n }\n\n void example() {\n x = x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int _x = 5;\n\n int get x => _x;\n\n set x(int x) {\n _x = x;\n _customUpdateLogic();\n }\n\n void _customUpdateLogic() {\n print('updated');\n }\n\n void example() {\n _customUpdateLogic();\n }\n}\n```\n\n**BAD:**\n```dart\nclass C {\n int x = 5;\n\n void update(C other) {\n this.x = this.x;\n }\n}\n```\n\n**GOOD:**\n```dart\nclass C {\n int x = 5;\n\n void update(C other) {\n this.x = other.x;\n }\n}\n```",
+ "sinceDartSdk": "3.1"
},
{
"name": "no_wildcard_variable_uses",
@@ -1599,8 +1612,8 @@
"flutter"
],
"fixStatus": "needsEvaluation",
- "details": "**DON'T** use wildcard parameters or variables.\n\nWildcard parameters and local variables\n(e.g. underscore-only names like `_`, `__`, `___`, etc.) will\nbecome non-binding in a future version of the Dart language.\nAny existing code that uses wildcard parameters or variables will\nbreak. In anticipation of this change, and to make adoption easier,\nthis lint disallows wildcard and variable parameter uses.\n\n\n**BAD:**\n```dart\nvar _ = 1;\nprint(_); // LINT\n```\n\n```dart\nvoid f(int __) {\n print(__); // LINT multiple underscores too\n}\n```\n\n**GOOD:**\n```dart\nfor (var _ in [1, 2, 3]) count++;\n```\n\n```dart\nvar [a, _, b, _] = [1, 2, 3, 4];\n```\n",
- "sinceDartSdk": "3.1.0"
+ "details": "**DON'T** use wildcard parameters or variables.\n\nWildcard parameters and local variables\n(e.g. underscore-only names like `_`, `__`, `___`, etc.) will\nbecome non-binding in a future version of the Dart language.\nAny existing code that uses wildcard parameters or variables will\nbreak. In anticipation of this change, and to make adoption easier,\nthis lint disallows wildcard and variable parameter uses.\n\n\n**BAD:**\n```dart\nvar _ = 1;\nprint(_); // LINT\n```\n\n```dart\nvoid f(int __) {\n print(__); // LINT multiple underscores too\n}\n```\n\n**GOOD:**\n```dart\nfor (var _ in [1, 2, 3]) count++;\n```\n\n```dart\nvar [a, _, b, _] = [1, 2, 3, 4];\n```",
+ "sinceDartSdk": "3.1"
},
{
"name": "non_constant_identifier_names",
@@ -1616,8 +1629,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DO** name non-constant identifiers using lowerCamelCase.\n\nClass members, top-level definitions, variables, parameters, named parameters\nand named constructors should capitalize the first letter of each word\nexcept the first word, and use no separators.\n\n**GOOD:**\n```dart\nvar item;\n\nHttpRequest httpRequest;\n\nalign(clearItems) {\n // ...\n}\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DO** name non-constant identifiers using lowerCamelCase.\n\nClass members, top-level definitions, variables, parameters, named parameters\nand named constructors should capitalize the first letter of each word\nexcept the first word, and use no separators.\n\n**GOOD:**\n```dart\nvar item;\n\nHttpRequest httpRequest;\n\nalign(clearItems) {\n // ...\n}\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "noop_primitive_operations",
@@ -1629,8 +1642,8 @@
"incompatible": [],
"sets": [],
"fixStatus": "hasFix",
- "details": "Some operations on primitive types are idempotent and can be removed.\n\n**BAD:**\n\n```dart\ndoubleValue.toDouble();\n\nintValue.toInt();\nintValue.round();\nintValue.ceil();\nintValue.floor();\nintValue.truncate();\n\nstring.toString();\nstring = 'hello\\n'\n ''\n 'world';\n\n'string with ${x.toString()}';\n```\n\nNote that the empty string literals at the beginning or end of a string are\nallowed, as they are typically used to format the string literal across multiple\nlines:\n\n```dart\n// OK\nstring = ''\n 'hello\\n'\n 'world\\n';\n\n// OK\nstring = 'hello\\n'\n 'world\\n'\n '';\n```\n",
- "sinceDartSdk": "2.14.0"
+ "details": "Some operations on primitive types are idempotent and can be removed.\n\n**BAD:**\n\n```dart\ndoubleValue.toDouble();\n\nintValue.toInt();\nintValue.round();\nintValue.ceil();\nintValue.floor();\nintValue.truncate();\n\nstring.toString();\nstring = 'hello\\n'\n ''\n 'world';\n\n'string with ${x.toString()}';\n```\n\nNote that the empty string literals at the beginning or end of a string are\nallowed, as they are typically used to format the string literal across multiple\nlines:\n\n```dart\n// OK\nstring = ''\n 'hello\\n'\n 'world\\n';\n\n// OK\nstring = 'hello\\n'\n 'world\\n'\n '';\n```",
+ "sinceDartSdk": "2.14"
},
{
"name": "null_check_on_nullable_type_parameter",
@@ -1646,8 +1659,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** use `null` check on a potentially nullable type parameter.\n\nGiven a generic type parameter `T` which has a nullable bound (e.g., the default\nbound of `Object?`), it is very easy to introduce erroneous `null` checks when\nworking with a variable of type `T?`. Specifically, it is not uncommon to have\n`T? x;` and want to assert that `x` has been set to a valid value of type `T`.\nA common mistake is to do so using `x!`. This is almost always incorrect, since\nif `T` is a nullable type, `x` may validly hold `null` as a value of type `T`.\n\n**BAD:**\n```dart\nT run(T callback()) {\n T? result;\n (() { result = callback(); })();\n return result!;\n}\n```\n\n**GOOD:**\n```dart\nT run(T callback()) {\n T? result;\n (() { result = callback(); })();\n return result as T;\n}\n```\n\n",
- "sinceDartSdk": "2.12.0"
+ "details": "**DON'T** use `null` check on a potentially nullable type parameter.\n\nGiven a generic type parameter `T` which has a nullable bound (e.g., the default\nbound of `Object?`), it is very easy to introduce erroneous `null` checks when\nworking with a variable of type `T?`. Specifically, it is not uncommon to have\n`T? x;` and want to assert that `x` has been set to a valid value of type `T`.\nA common mistake is to do so using `x!`. This is almost always incorrect, since\nif `T` is a nullable type, `x` may validly hold `null` as a value of type `T`.\n\n**BAD:**\n```dart\nT run(T callback()) {\n T? result;\n (() { result = callback(); })();\n return result!;\n}\n```\n\n**GOOD:**\n```dart\nT run(T callback()) {\n T? result;\n (() { result = callback(); })();\n return result as T;\n}\n```",
+ "sinceDartSdk": "2.12"
},
{
"name": "null_closures",
@@ -1662,8 +1675,8 @@
"flutter"
],
"fixStatus": "hasFix",
- "details": "**DON'T** pass `null` as an argument where a closure is expected.\n\nOften a closure that is passed to a method will only be called conditionally,\nso that tests and \"happy path\" production calls do not reveal that `null` will\nresult in an exception being thrown.\n\nThis rule only catches null literals being passed where closures are expected\nin the following locations:\n\n#### Constructors\n\n* From `dart:async`\n * `Future` at the 0th positional parameter\n * `Future.microtask` at the 0th positional parameter\n * `Future.sync` at the 0th positional parameter\n * `Timer` at the 0th positional parameter\n * `Timer.periodic` at the 1st positional parameter\n* From `dart:core`\n * `List.generate` at the 1st positional parameter\n\n#### Static functions\n\n* From `dart:async`\n * `scheduleMicrotask` at the 0th positional parameter\n * `Future.doWhile` at the 0th positional parameter\n * `Future.forEach` at the 0th positional parameter\n * `Future.wait` at the named parameter `cleanup`\n * `Timer.run` at the 0th positional parameter\n\n#### Instance methods\n\n* From `dart:async`\n * `Future.then` at the 0th positional parameter\n * `Future.complete` at the 0th positional parameter\n* From `dart:collection`\n * `Queue.removeWhere` at the 0th positional parameter\n * `Queue.retain\n * `Iterable.firstWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.forEach` at the 0th positional parameter\n * `Iterable.fold` at the 1st positional parameter\n * `Iterable.lastWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.map` at the 0th positional parameter\n * `Iterable.reduce` at the 0th positional parameter\n * `Iterable.singleWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.skipWhile` at the 0th positional parameter\n * `Iterable.takeWhile` at the 0th positional parameter\n * `Iterable.where` at the 0th positional parameter\n * `List.removeWhere` at the 0th positional parameter\n * `List.retainWhere` at the 0th positional parameter\n * `String.replaceAllMapped` at the 1st positional parameter\n * `String.replaceFirstMapped` at the 1st positional parameter\n * `String.splitMapJoin` at the named parameters `onMatch` and `onNonMatch`\n\n**BAD:**\n```dart\n[1, 3, 5].firstWhere((e) => e.isOdd, orElse: null);\n```\n\n**GOOD:**\n```dart\n[1, 3, 5].firstWhere((e) => e.isOdd, orElse: () => null);\n```\n\n",
- "sinceDartSdk": "2.0.0"
+ "details": "**DON'T** pass `null` as an argument where a closure is expected.\n\nOften a closure that is passed to a method will only be called conditionally,\nso that tests and \"happy path\" production calls do not reveal that `null` will\nresult in an exception being thrown.\n\nThis rule only catches null literals being passed where closures are expected\nin the following locations:\n\n#### Constructors\n\n* From `dart:async`\n * `Future` at the 0th positional parameter\n * `Future.microtask` at the 0th positional parameter\n * `Future.sync` at the 0th positional parameter\n * `Timer` at the 0th positional parameter\n * `Timer.periodic` at the 1st positional parameter\n* From `dart:core`\n * `List.generate` at the 1st positional parameter\n\n#### Static functions\n\n* From `dart:async`\n * `scheduleMicrotask` at the 0th positional parameter\n * `Future.doWhile` at the 0th positional parameter\n * `Future.forEach` at the 0th positional parameter\n * `Future.wait` at the named parameter `cleanup`\n * `Timer.run` at the 0th positional parameter\n\n#### Instance methods\n\n* From `dart:async`\n * `Future.then` at the 0th positional parameter\n * `Future.complete` at the 0th positional parameter\n* From `dart:collection`\n * `Queue.removeWhere` at the 0th positional parameter\n * `Queue.retain\n * `Iterable.firstWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.forEach` at the 0th positional parameter\n * `Iterable.fold` at the 1st positional parameter\n * `Iterable.lastWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.map` at the 0th positional parameter\n * `Iterable.reduce` at the 0th positional parameter\n * `Iterable.singleWhere` at the 0th positional parameter, and the named\n parameter `orElse`\n * `Iterable.skipWhile` at the 0th positional parameter\n * `Iterable.takeWhile` at the 0th positional parameter\n * `Iterable.where` at the 0th positional parameter\n * `List.removeWhere` at the 0th positional parameter\n * `List.retainWhere` at the 0th positional parameter\n * `String.replaceAllMapped` at the 1st positional parameter\n * `String.replaceFirstMapped` at the 1st positional parameter\n * `String.splitMapJoin` at the named parameters `onMatch` and `onNonMatch`\n\n**BAD:**\n```dart\n[1, 3, 5].firstWhere((e) => e.isOdd, orElse: null);\n```\n\n**GOOD:**\n```dart\n[1, 3, 5].firstWhere((e) => e.isOdd, orElse: () => null);\n```",
+ "sinceDartSdk": "2.0"
},
{
"name": "omit_local_variable_types",
@@ -1678,8 +1691,8 @@
],
"sets": [],
"fixStatus": "hasFix",
- "details": "**DON'T** redundantly type annotate initialized local variables.\n\nLocal variables, especially in modern code where functions tend to be small,\nhave very little scope. Omitting the type focuses the reader's attention on the\nmore important *name* of the variable and its initialized value.\n\n**BAD:**\n```dart\nList
> possibleDesserts(Set pantry) {\n List> desserts = >[];\n for (final List recipe in cookbook) {\n if (pantry.containsAll(recipe)) {\n desserts.add(recipe);\n }\n }\n\n return desserts;\n}\n```\n\n**GOOD:**\n```dart\nList