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

插件详情v1.2.1

mvvm_linter

MVVM Linter 是一个旨在强制执行 MVVM 中最佳实践和编码标准的工具。

近 30 天下载
16
喜欢数
2
Pub 分数
50

安装插件

flutter pub add mvvm_linter

插件介绍

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

MVVM Linter 是一个 Flutter/Dart 包,用于在 MVVM(模型-视图-视图模型)架构模式中强制执行一致的编码标准和最佳实践。它通过检测常见的反模式以及与推荐的 MVVM 约定的偏差,帮助开发人员保持代码的整洁、结构化和可维护性。通过将此 linter 集成到开发工作流中,团队可以确保项目之间的统一性并减少技术债务。该工具在需要严格遵守架构原则的协作环境中尤其有用。

适合场景

  • 在团队项目中强制执行MVVM结构
  • 自动化MVVM模式的代码质量检查
  • 在大型Flutter应用程序中保持一致性
  • 识别不当的 ViewModel 或 View 使用
  • 通过清晰的指南支持新开发人员的入职

主要特点

  • MVVM架构特定规则
  • 与 Flutter 分析工具的集成
  • 可自定义的 lint 规则
  • 清晰的错误消息以提示违规
  • 支持自动化代码审查

适合对象

  • 使用 MVVM 的 Flutter 团队
  • 开发者专注于代码质量
  • 需要严格遵守建筑规范的项目
  • 采用标准化开发实践的团队
  • CI/CD流水线强制执行编码标准

使用建议

  • 需要手动配置自定义规则
  • 可能需要为新的 Flutter 版本更新
  • 有限的平台特定功能
  • 最好与其他 linter 一起使用
  • 仅适用于基于 MVVM 的项目

原始 README

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

MVVM Linter

The MVVM Linter is a tool designed to enforce best practices and coding standards in MVVM (Model-View-ViewModel) architecture within your projects. It provides a set of rules and guidelines to help maintain code quality, readability, and consistency.

Features

  • Member Order: Enforces a specified order for class members.
  • Organize Class Order Action: Orders class members according to a predefined structure.

Installation

To install the MVVM Linter, follow these steps:

  1. Add the following dependencies to your pubspec.yaml:
flutter pub add --dev custom_lint mvvm_linter
  1. Update your analysis_options.yaml:
include: package:flutter_lints/flutter.yaml

analyzer:
  plugins:
    - custom_lint
custom_lint:
  rules:
    - mvvm_linter

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。