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

插件详情v2.0.0

solid_lints

基于软件行业标准和最佳实践的 Dart 和 Flutter 代码检查规则。

近 30 天下载
5580
喜欢数
57
Pub 分数
150

安装插件

flutter pub add solid_lints

插件介绍

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

solid_lints 是一个 Dart 和 Flutter 的代码检查工具包,用于强制执行行业标准的最佳实践,以确保代码质量、可读性和可维护性。它提供了一套精心挑选的代码检查规则,符合现代软件工程原则,帮助开发者编写清晰、一致且健壮的代码。该工具包专为 Flutter 项目设计,能够及早发现常见问题,提升团队协作效率,并促进代码的长期健康。它可通过 pub.dev 无缝集成,由 solid.software 维护。

适合场景

  • 在团队间强制执行一致的编码风格
  • 提高代码的可读性和可维护性
  • 自动检测 Dart/Flutter 代码中的反模式
  • 通过静态分析支持 CI/CD 流水线
  • 指导新开发人员遵循经过验证的最佳实践

主要特点

  • 基于行业标准的规则
  • Dart 和 Flutter 最佳实践的全面覆盖
  • 通过 pub.dev 实现轻松集成
  • 定期更新以反映不断演变的标准
  • 清晰、可操作的 lint 消息

适合对象

  • Flutter 开发团队
  • 重视代码质量的项目
  • 学习 Dart 最佳实践的新开发者
  • 需要一致性的大规模应用
  • CI/CD 环境

使用建议

  • 可能需要初始配置以适应项目需求
  • 某些规则可能与个人或团队偏好冲突
  • 需要理解 linting 概念
  • 并非所有规则都适用于每种项目类型
  • 升级版本时可能需要调整

原始 README

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

Solid Lints

style: solid $solid_lints

Flutter/Dart lints configuration based on software engineering industry standards (ISO/IEC, NIST) and best practices.

Documentation

For more detailed information and guidelines on using Solid Lints, please refer to the documentation:

  • https://lints.solid.software

Usage

Add dependency in your pubspec.yaml:

dev_dependencies:
  solid_lints: <INSERT LATEST VERSION>

Enable the plugin and include solid_lints in your project's top-level analysis_options.yaml:

include: package:solid_lints/analysis_options.yaml

plugins:
  solid_lints: <INSERT LATEST VERSION>

Also, you can use a specialized rule set designed for Dart tests. Add an analysis_options.yaml file under the test/ directory, and include the ruleset:

include: package:solid_lints/analysis_options_test.yaml

plugins:
  solid_lints: <INSERT LATEST VERSION>

Then you can see suggestions in your IDE or you can run checks manually:

dart analyze

Configuration

You can customize individual rule settings in your analysis_options.yaml:

plugins:
  solid_lints: <INSERT LATEST VERSION>

solid_lints:
  diagnostics:
    cyclomatic_complexity:
      max_complexity: 10
    avoid_non_null_assertion: true

Badge

To indicate that your project is using Solid Lints, you can use the following badge:

[![style: solid](https://img.shields.io/badge/style-solid-orange)](https://pub.dev/packages/solid_lints)

所属分类

依赖

依赖清单 7 项

源码仓库

使用此插件的项目