Comments (6)
Thanks @nelson6e65.
Maybe we should support trailingCommaPHP
and respect phpVersion
for compatibility.
from prettier-plugin-blade.
Added --trailing-comma-php
option at https://github.com/shufo/prettier-plugin-blade/releases/tag/v1.12.0.
You can disable trailing comma by setting like
.prettierrc.json
"options": {
~~
"trailingCommaPHP": false,
}
from prettier-plugin-blade.
And 1.13 with phpVersion?
Yes, this package will respect phpVersion
option if exists.
from prettier-plugin-blade.
.prettierrc.json
{
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5",
"semi": true,
"singleQuote": true,
"arrowParens": "always",
"overrides": [
{
"files": ["*.php"],
"options": {
"phpVersion": "7.2",
"tabWidth": 4,
"printWidth": 120
}
},
{
"files": ["*.blade.php"],
"options": {
"phpVersion": "7.2",
"trailingCommaPHP": false,
"tabWidth": 2,
"printWidth": 120,
"parser": "blade",
"sortHtmlAttributes": "vuejs",
"wrapAttributes": "force-expand-multiline"
}
}
],
"plugins": ["@prettier/plugin-php", "@shufo/prettier-plugin-blade"]
}
from prettier-plugin-blade.
It happens even in a @php
directive:
@php
echo Form::select(
'refundType',
REFUND_TYPES,
$data->refundType ?? null,
[
'class' => 'form-control refundType',
'required' => 'required',
] + ($refundId ? ['disabled' => 'true'] : []),
);
@endphp
In a normal PHP file, the trailing comma it's removed:
public function test()
{
$refundId = null;
echo Form::select(
'refundType',
REFUND_TYPES,
null,
[
'class' => 'form-control refundType',
'required' => 'required',
] + ($refundId ? ['disabled' => 'true'] : [])
);
}
from prettier-plugin-blade.
Thanks a lot! 🎉
And 1.13 with phpVersion
?
from prettier-plugin-blade.
Related Issues (20)
- [Feature Request]: Format JS inside of AlpineJS attributes HOT 5
- [Feature Request]: $attributes->class() & @class() sorting support HOT 3
- [Feature Request]: prettier-plugin-tailwindcss config support HOT 3
- [Bug]: Unknown node type: undefined HOT 5
- [Formatting Bug]: Arrays are being collapse on a single line HOT 3
- [Bug]: In doc is missing --end-with-new-line in .prettierrc example HOT 2
- [Formatting Bug]: Blade Component HOT 1
- [Formatting Bug]: Bad formatting in @php tags HOT 2
- [Formatting Bug]: Adds spaces where there shouldn't be HOT 1
- [Bug]: Blade components format is not compliant with Prettier HOT 3
- [Formatting Bug]: HOT 3
- [Formatting Bug]: extra line in plain html with CRLF (windows, phpstorm) HOT 2
- [Feature Request]: wrapAttributesPrintWidth HOT 3
- [Feature Request]: Let Prettier format script tags HOT 1
- [Question]: can any tailwind.config.* fileformat be used by default HOT 4
- [Formatting Bug]: Weird indentation HOT 3
- [Bug]: Install command is installing prettier v2.8.8 HOT 4
- [Bug]: Error: Unknown node type: undefined HOT 1
- [Feature Request]: Respect the `htmlWhitespaceSensitivity` option of Prettier HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-plugin-blade.