nocterm_lints 0.3.0+beta.3 copy "nocterm_lints: ^0.3.0+beta.3" to clipboard
nocterm_lints: ^0.3.0+beta.3 copied to clipboard

Nocterm lints add Assistants to the editor.

nocterm_lints #

Pub Dart Nocterm

Productivity assists for Nocterm terminal UI development

An analysis server plugin providing intelligent IDE assists and refactoring tools for building Nocterm terminal UI components. Works seamlessly in VS Code, IntelliJ IDEA, Android Studio, and other Dart-enabled editors.

[!info] Built on the modern analysis_server_plugin framework (Dart 3.10+). Originally derived from Dart project foundations and enhanced for Nocterm-specific workflows.

Features #

19 productivity assists organized into four categories:

Component Manipulation (5) #

  • Move Up/Down — Reorder components up or down in the tree
  • Swap with Child — Exchange positions with immediate child
  • Swap with Parent — Exchange positions with parent component
  • Remove Component — Delete wrapper while preserving children

Component Wrapping (10) #

  • Wrap with Component — Choose from available component types
  • Wrap with Generic — Container with customizable child
  • Wrap with Center — Center-align component
  • Wrap with Container — Add styling container
  • Wrap with Padding — Add spacing (default: 8dp)
  • Wrap with Row/Column — Create horizontal/vertical layouts
  • Wrap with Expanded/Flexible — Control sizing in flex contexts
  • Wrap with SizedBox — Define explicit dimensions

Layout Builders (2) #

  • Wrap with Builder — Builder pattern wrapper
  • Wrap with ValueListenableBuilder — Reactive state pattern

Component Conversion (2) #

  • Convert to Stateful — Refactor to StatefulComponent
  • Convert to Stateless — Refactor to StatelessComponent

Getting Started #

For Development (Local Path) #

Add to your project's analysis_options.yaml:

include: package:nocterm_lints/recommended.yaml

plugins:
  nocterm_lints:
    path: ../path/to/nocterm_lints

For Published Package #

include: package:nocterm_lints/recommended.yaml

plugins:
  nocterm_lints: ^0.1.0

Activate Assists #

After updating analysis_options.yaml, restart the Dart Analysis Server:

Editor Command
VS Code Cmd+Shift+P → "Dart: Restart Analysis Server"
IntelliJ / Android Studio Tools → Dart Analysis → Restart

Tip

Use Cmd+. (macOS) or Ctrl+. (Windows/Linux) to see available assists when the cursor is on a component.

Usage Examples #

Wrap with Padding #

Before:

final component = MyComponent(child: Text('Hello'));

After: Invoke "Wrap with Padding" assist

final component = Padding(
  padding: const EdgeInsets.all(8),
  child: MyComponent(child: Text('Hello')),
);

Convert to Stateless Component #

Before:

class MyComponent extends StatefulComponent {
  @override
  State<MyComponent> createState() => _MyComponentState();
}

class _MyComponentState extends State<MyComponent> {
  @override
  Component build(BuildContext context) => Text('Hello');
}

After: Invoke "Convert to Stateless Component" assist

class MyComponent extends StatelessComponent {
  const MyComponent({super.key});

  @override
  Component build(BuildContext context) => Text('Hello');
}

Configuration #

Enable or disable diagnostics in analysis_options.yaml:

plugins:
  nocterm_lints:
    path: ../nocterm_lints

Development #

Setup #

Bootstrap dependencies:

dart pub get

Run Tests #

dart test

Format Code #

dart format .

Analyze #

dart analyze

Test Against Local Project #

  1. Add to test project's analysis_options.yaml:

    plugins:
      nocterm_lints:
        path: /path/to/nocterm_lints
    
  2. Restart the Dart Analysis Server

Project Structure #

nocterm_lints/
├── lib/
│   ├── main.dart                 # Plugin entry point
│   ├── src/assistants/            # Individual assists
│   │   ├── wrap_*.dart
│   │   ├── move_*.dart
│   │   ├── convert_*.dart
│   │   └── ...
│   ├── services/                 # Core services
│   └── utilities/                # Shared extensions
├── test/                         # Unit tests
├── example/                      # Example project
├── analysis_options.yaml
├── pubspec.yaml
└── recommended.yaml              # Default lint config

Requirements #

Requirement Version
Dart SDK >= 3.10.0
analysis_server_plugin ^0.3.4
analyzer >= 8.0.0, < 10.0.0

Supported Editors #

  • VS Code (via Dart extension)
  • IntelliJ IDEA
  • Android Studio
  • Other Dart analyzer-compatible editors

Licensing #

Dual-licensed for compatibility:

See ACKNOWLEDGMENTS.md and LICENSE for detailed attribution.