Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
82 stars 2 forks source link

Stripping spaces from string in directive #77

Closed howdu closed 1 year ago

howdu commented 1 year ago
@props([
   'product',
   'title' => $product->name . ' - ' . $product->category,
])

Becomes

@props([
   'product',
   'title' => $product->name . '-' . $product->category,
])
JohnathonKoster commented 1 year ago

Would you be able to share your prettier config as well as the formatting config (if applicable)? Thanks!

howdu commented 1 year ago

Sure no problem it's:

{
  "semi": false,
  "endOfLine": "lf",
  "singleQuote": true,
  "tailwindConfig": "./tailwind.config.js",
  "trailingComma": "all",
  "singleAttributePerLine": true,
  "plugins": [
    "./node_modules/prettier-plugin-blade/",
    "./node_modules/prettier-plugin-tailwindcss/"
  ],
  "overrides": [
    {
      "files": ["*.blade.php"],
      "options": {
        "parser": "blade"
      }
    }
  ]
}

.blade.format.json

{
  "useLaravelPint": true
}

pint.json (not sure if you read pint config - tested by removing all but the present and get the same issue)

{
  "preset": "laravel",
  "rules": {
    "blank_line_before_statement": true,
    "concat_space": {
      "spacing": "one"
    },
    "method_argument_space": true,
    "single_trait_insert_per_statement": true,
    "types_spaces": {
      "space": "single"
    }
  }
}
JohnathonKoster commented 1 year ago

Thank you very much 🙂

I've identified the issue, and have released 1.6.12 to address this; with additional test coverage going forward.