搜索插件、代码仓与 APP 分类

插件详情v1.3.0

linteo

iteo 使用的 Flutter 和 Dart 代码规范

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
382
喜欢数
30
Pub 分数
150

安装插件

flutter pub add linteo

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Linteо 是由 iteo 内部开发和使用的 Flutter 和 Dart 代码检查工具包,提供了一致的编码标准和最佳实践。它通过预设的代码检查规则来强制执行代码质量,帮助在各个项目中保持代码的整洁、可读性和可维护性。该工具包专为希望在代码风格和结构上保持一致性的团队设计,尤其适用于 iteo 生态系统。它支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。通过集成 linteo,开发者可以及早发现常见问题,并通过标准化的代码审查提升协作效率。

适合场景

  • 强制执行团队范围内的代码风格
  • 跨多平台应用保持一致性
  • 自动化代码质量检查
  • 支持CI/CD流水线
  • 改进新开发者的入职体验

主要特点

  • 来自 iteo 标准的预定义 lint 规则
  • 跨平台兼容性
  • 通过 pub add 轻松集成
  • 定期更新以反映最佳实践
  • 与 Flutter 和 Dart 工具链无缝集成

适合对象

  • Flutter 开发团队
  • 使用标准化编码实践的组织
  • 需要严格代码质量的项目
  • CI/CD 环境
  • 采用共享代码规范的团队

使用建议

  • 需要了解 Dart 代码检查规则
  • 可能需要为非iteo工作流进行自定义
  • 依赖于 GitHub 托管的源
  • 不适用于无配置的独立应用程序
  • 最适合在协作开发环境中使用

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

linteo

License: MIT style: linteo


Provides set of Flutter and Dart linter rules used at iteo. By default, package enables all available lint rules (all_lint_rules.yaml) and disables some of them upon team agreement.

Install

  1. Depend on this package as a dev_dependency by running flutter pub add --dev linteo
  2. Create analysis_options.yaml file at the root of the package (alongside the pubspec.yaml file) and include: package:linteo/analysis_options.yaml from it.

Which version to use?

Dart Version Linteo Version
3.1 1.3.0
2.17 1.2.0
2.17 1.1.0
2.17 1.0.1
2.18 1.0.0
Example analysis_options.yaml file
include: package:linteo/analysis_options.yaml

linter:
  rules:
    # Adjust package to specific project needs
    # package_api_docs: true  # Uncomment to enable rule

Suppress lint

Your project may require special case. Lint rules can be suppressed at the line, file, or project level.

Line Level

Use an ignore: comment directly above the line

// ignore: public_member_api_docs
class A {}
File level

Use an ignore_for_file: comment at the top of the file


// ignore_for_file: public_member_api_docs

class A {}

class B {}
Project Level

Update root analysis_options.yaml according to your needs:

include: package:linteo/analysis_options.yaml
linter:
  rules:
    public_member_api_docs: true

Badge

Support the project using a badge in your repository

style:linteo

所属分类

源码仓库

使用此插件的项目