marcoroth / stimulus-parser

Statically analyze Stimulus controllers in your project.

Home Page:https://hotwire.io/ecosystem/tooling/stimulus-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse kind of value definition

marcoroth opened this issue · comments

Shorthand-version:

import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
  static values = {
    name: String
  }
}

Explicit-version:

import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
  static values = {
    name: {
      type: String,
      default: "Stimulus"
    }
  }
}

Inferred-version:

import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
  static values = {
    name: "Stimulus"
  }
}