nocterm_lints 0.5.0 copy "nocterm_lints: ^0.5.0" to clipboard
nocterm_lints: ^0.5.0 copied to clipboard

Nocterm lints add Assistants to the editor.

nocterm_lints #

ZOOCITYBOY ZOOCITYBOY

Pub Dart Nocterm

nocterm_lints is a Dart analysis server plugin focused on Nocterm UI productivity. It provides code actions for wrapping, moving, swapping, removing, and converting Nocterm components directly in your editor.

Note

The plugin targets Dart SDK >=3.10.0 <4.0.0 and uses the modern analysis_server_plugin stack.

Installation #

Use from local path (development) #

include: package:nocterm_lints/recommended.yaml

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

Use from pub package #

include: package:nocterm_lints/recommended.yaml

plugins:
  nocterm_lints: ^0.4.0

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

Compatibility Matrix #

Component Supported / Tested Range
Dart SDK >=3.10.0 <4.0.0
analysis_server_plugin >=0.3.8 <0.4.0
analyzer >=10.0.2 <11.0.0
analyzer_plugin >=0.14.2 <0.15.0
nocterm ^0.5.0
Editors VS Code, IntelliJ IDEA, Android Studio (via Dart Analysis Server)

All Assistants #

The table below lists every registered assistant in this project.

Category Assistant Code Action label Description
Move MoveUp Move component up Swaps the selected component with the previous sibling in a list.
Move MoveDown Move component down Swaps the selected component with the next sibling in a list.
Swap SwapWithChild Swap with child Swaps a parent component with its direct child when structure is valid.
Swap SwapWithParent Swap with parent Swaps a child component with its direct parent when structure is valid.
Remove RemoveWidget Remove this component Removes a wrapper and preserves valid child or children content when possible.
Wrap WrapComponent Wrap with component... Wraps a selected list of components with a generic component wrapper.
Wrap WrapGeneric Wrap with component... Wraps a single component with a generic configurable wrapper.
Wrap WrapCenter Wrap with Center Wraps the selected component in Center.
Wrap WrapContainer Wrap with Container Wraps the selected component in Container.
Wrap WrapExpanded Wrap with Expanded Wraps the selected component in Expanded in compatible flex contexts.
Wrap WrapFlexible Wrap with Flexible Wraps the selected component in Flexible in compatible flex contexts.
Wrap WrapPadding Wrap with Padding Wraps the selected component in Padding with default edge insets.
Wrap WrapSizedBox Wrap with SizedBox Wraps the selected component in SizedBox.
Wrap WrapRow Wrap with Row Wraps selected component(s) in a Row(children: [...]).
Wrap WrapColumn Wrap with Column Wraps selected component(s) in a Column(children: [...]).
Wrap WrapBuilder Wrap with Builder Wraps the selected component in Builder and generates a builder closure.
Wrap WrapValueListenableBuilder Wrap with ValueListenableBuilder Wraps the selected component in ValueListenableBuilder.
Convert ConvertToStatefulComponent Convert to StatefulComponent Refactors a stateless component into StatefulComponent + State classes.
Convert ConvertToStatelessComponent Convert to StatelessComponent Refactors eligible stateful component/state pair into a stateless component.

Usage #

  1. Place the cursor on, or inside, a Nocterm component expression.
  2. Open code actions (Cmd+. on macOS, Ctrl+. on Windows/Linux).
  3. Pick an assist from the list.

Tip

If assists do not appear after install/config changes, run Dart: Restart Analysis Server.

Example #

Before:

return Text('hello');

After Wrap with Padding:

return Padding(
  padding: const EdgeInsets.all(8),
  child: Text('hello'),
);

Development #

dart pub get
dart analyze
dart test test/assistants

Project Layout #

lib/
  main.dart
  assistants/
  services/
  utilities/
test/
  assistants/
example/