Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rules versions #158

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build Doc
on:
pull_request:
branches:
- gh-pages-source
jobs:
test-docs:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Build docs
run: npm run build
44 changes: 44 additions & 0 deletions .github/workflows/release-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Doc

on:
push:
branches:
- gh-pages-source
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm install
- name: Build website
run: npm run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# avoid-collection-methods-with-unrelated-types

added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>.
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>.

Avoid using collection methods with unrelated types, such as accessing a map of integers using a string key.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-double-slash-imports.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-double-slash-imports
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when an import/export directive contains a double slash.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-duplicate-exports.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-duplicate-exports
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a file has multiple exports declarations with the same URI.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-dynamic.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-dynamic
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when the `dynamic` type is used as a variable type in a declaration, return type of a function, etc. Using `dynamic` is considered unsafe since it can easily result in runtime errors.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-global-state.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-global-state
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

The rule should violate on not final and non-const top-level variables.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-ignoring-return-values.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-ignoring-return-values
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a return value of a method or function invocation or a class instance property access is not used.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-late-keyword.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-late-keyword
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a field or variable is declared with a `late` keyword.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-missing-enum-constant-in-map.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-missing-enum-constant-in-map
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a enum constant is missing in a map declaration.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-nested-conditional-expressions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-nested-conditional-expressions
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Checks for nested conditional expressions.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-non-ascii-symbols.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-non-ascii-symbols
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a string literal contains non ascii characters. This might indicate that the string was not localized.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-non-null-assertion.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-non-null-assertion
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when non null assertion operator (! or “bang” operator) is used for a property access or method invocation. The operator check works at runtime and it may fail and throw a runtime exception.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-passing-async-when-sync-expected.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-passing-async-when-sync-expected
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Avoid passing asynchronous function as an argument where a synchronous function is expected.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-redundant-async.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-redundant-async
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Checks for redundant `async` in a method or function body.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-throw-in-catch-block.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-throw-in-catch-block
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Call throw in a catch block loses the original stack trace and the original exception.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-top-level-members-in-tests.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-top-level-members-in-tests
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a public top-level member (expect the entrypoint) is declared inside a test file.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-unnecessary-conditionals.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-unnecessary-conditionals
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Checks for unnecessary conditional expressions.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-unnecessary-type-assertions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-unnecessary-type-assertions
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns about unnecessary usage of `is` and `whereType` operators.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-unnecessary-type-casts.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-unnecessary-type-casts
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns about of unnecessary use of casting operators.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-unrelated-type-assertions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-unrelated-type-assertions
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns about unrelated usages of `is` operator.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/avoid-unused-parameters.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# avoid-unused-parameters
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Checks for unused parameters inside a function or method body. For overridden methods suggests renaming unused parameters to _, __, etc.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/ban-name.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ban-name
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Configure some names that you want to ban.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/binary-expression-operand-order.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# binary-expression-operand-order
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Warns when a literal value is on the left hand side in a binary expressions.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/double-literal-format.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# double-literal-format
added in: 1.5.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Checks that double literals should begin with `0.` instead of just `.`, and should not end with a trailing `0.` Helps keep a consistent style of numeric literals and decrease potential typos.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/format-comment.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# format-comment
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Prefer format comments like sentences.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/list-all-equatable-fields.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# list-all-equatable-fields
added in: 1.2.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a field is not added to `props` getter of a class that extends `Equatable` or `EquatableMixin`.
Example
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/member-ordering.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# member-ordering
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Enforces member ordering.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/missing-test-assertion.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# missing-test-assertion
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns that there is no assertion in the test.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/newline-before-return.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# newline-before-return
added in: 1.5.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Enforces a blank line between statements and return in a block.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-boolean-literal-compare.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-boolean-literal-compare
added in: 1.5.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Warns on comparison to a boolean literal, as in `x == true`. Comparing boolean values to boolean literals is unnecessary, as those expressions will result in booleans too. Just use the boolean values directly or negate them.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-empty-block.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-empty-block
added in: 1.5.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Disallows empty blocks except catch clause block. Blocks with a todo comment inside are not considered empty.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-equal-arguments.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-equal-arguments
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when equal arguments passed to a function or method invocation.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-equal-then-else.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-equal-then-else
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when an if statement has equal then and else statements or conditional expression has equal then and else expressions.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-magic-number.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-magic-number
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns against using number literals outside of named constants or variables. Exceptions are made for common constants (by default: -1, 0 and 1) and for literals inside DateTime constructor as there is no way to create `const DateTime` and extracting each int argument to separate named constant is far too inconvenient.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/no-object-declaration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# no-object-declaration
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Warns when a class member is declared with `Object` type.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-async-await.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-async-await
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Recommends to use async/await syntax to handle Futures result instead of `.then()` invocation. Also can help prevent errors with mixed await and `.then()` usages, since awaiting the result of a `Future` with `.then()` invocation awaits the completion of `.then()`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-commenting-analyzer-ignores.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-commenting-analyzer-ignores
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when `// ignore:` comments are left without any additional description why this ignore is applied.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-conditional-expressions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-conditional-expressions
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Recommends to use a conditional expression instead of assigning to the same thing or return statement in each branch of an if statement.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-correct-identifier-length.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-correct-identifier-length
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

The rule checks the length of variable names in classes, functions, extensions, mixins, and also checks the value of enum.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-correct-test-file-name.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-correct-test-file-name
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns if the file within `/test` contains a `main`, but the file name doesn't end with `_test.dart`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-correct-type-name.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-correct-type-name
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Rule checks that the type name should only contain alphanumeric characters, start with an uppercase character and span between min-length and `max-length` characters in length.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-enums-by-name.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prefer-enums-by-name

added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Since Dart 2.15 it's possible to use `byName` method on enum values prop instead of searching the value with `firstWhere`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-first.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-first
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Warns when the first element of an Iterable or a List is accessed by `list[0]` or `iterable.elementAt(0)` instead of calling `iterable.first`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-immediate-return.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-immediate-return
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Declaring a local variable only to immediately return it might be considered a bad practice. The name of a function or a class method with its return type should give enough information about what should be returned.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-iterable-of.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-iterable-of
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when `List.from()` factory is used instead of `List.of()`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-last.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-last
added in: 1.6.0 <span style={{color: 'green'}}>style</span>
added in: 1.0.0 <span style={{color: 'green'}}>style</span>

Warns when the last element of an Iterable is accessed by `iterable[iterable.length - 1]` or `iterable.elementAt(iterable.length - 1)` instead of calling `iterable.last`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-match-file-name.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-match-file-name
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns if the file name does not match the name of the first public class / mixin / extension / enum in the file or a private one if there are no public entries.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/dart/prefer-moving-to-variable.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# prefer-moving-to-variable
added in: 1.6.0 <span style={{color: 'orange'}}>warning</span>
added in: 1.0.0 <span style={{color: 'orange'}}>warning</span>

Warns when a property access or a method invocation start with duplicated chains of other invocations / accesses inside a single function or method block.

Expand Down
Loading