You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/) now detects misleading return type annotations when object literal properties are initialized with `as const`.
6
+
7
+
This function is now reported because the return annotation widens a property initialized with `as const`:
[`noUselessTypeConversion`](https://biomejs.dev/linter/rules/no-useless-type-conversion/) now detects redundant conversions on object literal properties initialized with `as const`.
6
+
7
+
This conversion is now reported because `message.value` is inferred as a string literal:
[`useExhaustiveSwitchCases`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) now checks switch statements over object literal properties initialized with `as const`.
6
+
7
+
This switch is now reported because `status.kind` is inferred as the string literal `"ready"` but no case handles it:
[`useStringStartsEndsWith`](https://biomejs.dev/linter/rules/use-string-starts-ends-with/) now detects string index comparisons on object literal properties initialized with `as const`.
6
+
7
+
This comparison is now reported because `message.value` is inferred as a string literal:
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1746
+
1747
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1769
+
1770
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i The return type annotation is wider than what the function actually returns.
1779
+
1780
+
142 │ }
1781
+
143 │
1782
+
> 144 │ function parenthesizedObjectPropertyAsConst(): {a: string}{
1783
+
│ ^^^^^^^^^^^^^^^
1784
+
145 │ return { a: ("x"asconst) };
1785
+
146 │ }
1786
+
1787
+
i A wider return type hides the precise types that callers could rely on.
1788
+
1789
+
i Narrow the return type to match what the function actually returns.
1790
+
1791
+
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1792
+
1793
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i The return type annotation is wider than what the function actually returns.
1802
+
1803
+
146 │ }
1804
+
147 │
1805
+
> 148 │ function objectPropertyNegativeNumberAsConst(): {a: number}{
1806
+
│ ^^^^^^^^^^^^^^^
1807
+
149 │ return { a: -1asconst };
1808
+
150 │ }
1809
+
1810
+
i A wider return type hides the precise types that callers could rely on.
1811
+
1812
+
i Narrow the return type to match what the function actually returns.
1813
+
1814
+
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1815
+
1816
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i The return type annotation is wider than what the function actually returns.
1825
+
1826
+
150 │ }
1827
+
151 │
1828
+
> 152 │ function objectPropertyTupleAsConst(): {a: [number, number] }{
1829
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
1830
+
153 │ return { a: [1, 2] asconst };
1831
+
154 │ }
1832
+
1833
+
i A wider return type hides the precise types that callers could rely on.
1834
+
1835
+
i Narrow the return type to match what the function actually returns.
1836
+
1837
+
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1838
+
1839
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i The return type annotation is wider than what the function actually returns.
1848
+
1849
+
154 │ }
1850
+
155 │
1851
+
> 156 │ function objectPropertyAsConstWithSibling(): {a: string; b: number}{
1852
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^
1853
+
157 │ return { a: "x"asconst, b: 1 };
1854
+
158 │ }
1855
+
1856
+
i A wider return type hides the precise types that callers could rely on.
1857
+
1858
+
i Narrow the return type to match what the function actually returns.
1859
+
1860
+
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1861
+
1862
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
i A wider return type hides the precise types that callers could rely on.
1880
+
1881
+
i Narrow the return type to match what the function actually returns.
1882
+
1883
+
i This rule is still being actively worked on, so it may be missing features or have rough edges. Visit https://github.com/biomejs/biome/issues/9810 for more information or to report possible bugs.
1884
+
1885
+
i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
0 commit comments