Type object
File match macro.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/macro-json/latest.json
Source https://raw.githubusercontent.com/rebaz94/macro_kit/refs/heads/main/macro_schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Configuration file for Dart macro system

Properties

config object

Global macro configuration settings

4 nested properties
remap_generated_file_to string

Directory path where generated files should be remapped to

Examples: "lib/gen", "lib/generated"
auto_rebuild_on_connect boolean

Automatically rebuild when connecting

Default: true
always_rebuild_on_connect boolean

Always force rebuild on connect

Default: false
skip_connect_rebuild_with_auto_run_macro boolean

Skip connect-triggered rebuilds when external auto-run process is active. Disables auto_rebuild_on_connect and always_rebuild_on_connect if macro generation is being handled by a separate auto-run process. Set to true when autoRunMacro from your macro_context.dart is true

Default: true
macros Record<string, object>

Configuration for individual macros

3 nested properties
DataClassMacro object

Configuration for the built-in DataClassMacro

12 nested properties
field_rename string

Field renaming strategy

Default: "none"
Values: "none" "snake_case" "kebab_case" "camel_case" "pascal_case"
create_from_json boolean

Generate fromJson method

Default: true
create_to_json boolean

Generate toJson method

Default: true
create_map_to boolean

Generate mapTo method

Default: true
create_as_cast boolean

Generate as cast methods

Default: true
create_equal boolean

Generate equality operator override

Default: true
create_copy_with boolean

Generate copyWith method

Default: true
copy_with_as_option boolean

When true, generates copyWith methods using Option to support setting nullable fields to null. Defaults to false. Can be overridden per-field using @JsonKey(copyWithAsOption).

Default: false
create_to_string boolean

Generate toString override

Default: true
include_if_null boolean

Include null fields in JSON serialization

Default: false
as_literal_types string[]

List of types to be treated as literals

Default:
[]
use_map_convention boolean

Use 'toMap'/'fromMap' naming convention instead of 'toJson'/'fromJson'. This is configured globally since data classes that depend on other data classes need consistent method names.

Default: false
WidgetStateMacro object

Configuration for the WidgetStateMacro

1 nested properties
state_field_strategy string

Controls how state field visibility is resolved when no explicit visibility is specified on the annotation.

Default: "public"
Values: "public" "private" "keep"
ModelMacro object

Configuration for the WidgetStateMacro

1 nested properties
state_field_strategy string

Controls how state field visibility is resolved when no explicit visibility is specified on the annotation.

Default: "public"
Values: "public" "private" "keep"

Definitions

DataClassMacroConfig object

Configuration for the built-in DataClassMacro

field_rename string

Field renaming strategy

Default: "none"
Values: "none" "snake_case" "kebab_case" "camel_case" "pascal_case"
create_from_json boolean

Generate fromJson method

Default: true
create_to_json boolean

Generate toJson method

Default: true
create_map_to boolean

Generate mapTo method

Default: true
create_as_cast boolean

Generate as cast methods

Default: true
create_equal boolean

Generate equality operator override

Default: true
create_copy_with boolean

Generate copyWith method

Default: true
copy_with_as_option boolean

When true, generates copyWith methods using Option to support setting nullable fields to null. Defaults to false. Can be overridden per-field using @JsonKey(copyWithAsOption).

Default: false
create_to_string boolean

Generate toString override

Default: true
include_if_null boolean

Include null fields in JSON serialization

Default: false
as_literal_types string[]

List of types to be treated as literals

Default:
[]
use_map_convention boolean

Use 'toMap'/'fromMap' naming convention instead of 'toJson'/'fromJson'. This is configured globally since data classes that depend on other data classes need consistent method names.

Default: false
WidgetStateMacroConfig object

Configuration for the WidgetStateMacro

state_field_strategy string

Controls how state field visibility is resolved when no explicit visibility is specified on the annotation.

Default: "public"
Values: "public" "private" "keep"