Replies: 11 comments 21 replies
-
NOTE: Prettier only support Markdown ESLint supports that.
We want to use it too 🙏 |
Beta Was this translation helpful? Give feedback.
-
I don't think we will support this kind of suppression system |
Beta Was this translation helpful? Give feedback.
-
I want to use it in cases like this. exampleconst theme = {
colors: {
// biome-ignore format:
primary: '#000',
secondary: '#000',
success: '#000',
info: '#000',
warning: '#000',
error: '#000',
tokens: {
// ...
},
},
} If it's not acceptable, exampleconst theme = {
colors: {
// biome-ignore format:
...{
primary: '#000',
secondary: '#000',
success: '#000',
info: '#000',
warning: '#000',
error: '#000',
},
tokens: {
// ...
},
},
} |
Beta Was this translation helpful? Give feedback.
-
IMO this is a necessary feature. Also, as the previous commenter suggested, table alignment (or just whitespace preservation) can be a huge win for readability. // simple example
export const getCoords = (elem: Element) => {
const box = elem.getBoundingClientRect()
return {
top: box.top + window.scrollY,
right: box.right + window.scrollX,
bottom: box.bottom + window.scrollY,
left: box.left + window.scrollX,
}
}
// vs
export const getCoords = (elem: Element) => {
const box = elem.getBoundingClientRect()
return {
top: box.top + window.scrollY,
right: box.right + window.scrollX,
bottom: box.bottom + window.scrollY,
left: box.left + window.scrollX,
}
} |
Beta Was this translation helpful? Give feedback.
-
+1 for this feature. When working with external apis/sdks, they don't always conform to camelCase conventions. AWS SDK's use PascalCase for example const command = new CreateTableCommand({
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
TableName: name,
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
AttributeDefinitions: [
{
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
AttributeName: "base_uri",
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
AttributeType: "S",
},
{
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
AttributeName: "version",
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
AttributeType: "N",
},
],
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
KeySchema: [
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
{ AttributeName: "base_uri", KeyType: "HASH" },
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
{ AttributeName: "version", KeyType: "RANGE" },
],
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
ProvisionedThroughput: {
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
ReadCapacityUnits: 1,
// biome-ignore lint/style/useNamingConvention: we dont control aws' api
WriteCapacityUnits: 1,
},
}); I don't want to supress the rule for the entire file, but only for a specific code block. |
Beta Was this translation helpful? Give feedback.
-
I still think we should change how Biome ignore comments work. Instead of applying the ignore comment to a single node, we could apply the suppression comment to the entire tree of node that is commented. This could solve a long-standing issue where our formatter add parentheses around an expression with an ignore comment and move the ignore comment before the parentheses. Although this change could lead to a perf regression? This solution has also a caveat: it no longer allow ignoring a single node. For example ignoring |
Beta Was this translation helpful? Give feedback.
-
+1 this feature would be really handy when working with helm charts with keys that don't conform the naming convention |
Beta Was this translation helpful? Give feedback.
-
+1 - running into areas where files are littered and made unreadable with While I understand biome aims to be modern in its approach, I feel that this feature really hampers adoption for existing codebases. I love biome in all other aspects, but would appreciate if the team could reconsider |
Beta Was this translation helpful? Give feedback.
-
I'm evaluating this feature, but it still lacks a proper proposal that is inline with our suppression grammar, and the one proposed by OP doesn't fit. I'm not very fond of this tactic for many reasons, so I'm not very invested in it, but maybe other maintainers feel differently and want to implement it. However, I know we have the infrastructure to support it. If people are interested, we could open a bouty and see how it goes. People can volunteer to claim the bounty too. I'm also willing to implement it if we reach the bounty target |
Beta Was this translation helpful? Give feedback.
-
I think "ignore In next block" like the following is safer than on/off toggle. export async function getFoo(client: PrismaClient): Promise<SomeType> {
const rawResult = await client.$execRawTyped(sqlStatement());
// biome-ignore-in lint/style/noNonNullAssertion: Prisma don't respect NOT NULL in rows in TypedSQL
return {
foo: rawResult.foo!, // row with NOT NULL
barBaz: rawResult:bar_baz!, // row with NOT NULL
qux: rawResult.qux!, // row with NOT NULL
};
// note: end of biome-ignore-in because it's the end of { ... } here
} |
Beta Was this translation helpful? Give feedback.
-
Closing in favour of #4569 |
Beta Was this translation helpful? Give feedback.
-
There are places where we just need to turn biome off for a routine or section of lines. Turning it off for a single line is great (ESLint has this), but it would be great to turn it off / on for a bunch of lines, eg:
// biome-rule-off
// biome-rule-on
Or some variation of the above
Beta Was this translation helpful? Give feedback.
All reactions