All rules

Sheath rule

native-line-points

NativePHP line endpoints must contain two finite numeric coordinates.
Package
NativePHP
Category
Native
Default severity
error by default
Auto-fix
Manual fix

#Why

The line renderer splits from and to on a comma and casts both parts to floating-point values. Missing parts, CSS units, nonnumeric text, and non-finite values draw from unexpected coordinates or cannot cross the JSON boundary.

#Examples

#Bad

{{-- 10px is cast to 10, so the authored unit is misleading. --}}
<native:line from="10px,20" to="80,20" />

#Good

{{-- Both endpoints contain two finite unitless numbers. --}}
<native:line from="10,20" to="80,20" />

Signed numbers, decimals, and scientific notation are accepted when they are finite.

#Notes

A bare endpoint, an endpoint with any part count other than two, or a value such as 1e999 is reported. Bound and interpolated values are skipped.

When one endpoint is written more than once, the rule follows NativePHP's final attribute value.

#Options

All NativePHP rules accept nativeViewPaths. The default is ['views/native/']. See Native View Detection for path configuration.

#See Also

Related rules validate elements and their attributes: