Comments (13)
I think, in our case, the word "lone" can be dropped. I suggest noUselessBlock
from biome.
I think, in our case, the word "lone" can be dropped. I suggest
noUselessBlock
Not sure, because the rule concerns only "lone" block statements, i.e. block statements that are not attached to a if
, else
, while
, function
, ...
EDIT: The rule prohibits lone blocks that don't include any variables declaration.
Example of incorrect code:
{
f();
}
{}
Example of correct ode:
{
let x = 1;
}
// This is not a lone block
if (cond) {}
from biome.
Thank you for clarifying! I would still remove "statement" from the word :) it's not beginner friendly
from biome.
Hey there. I've been using Biome so would love to contribute. I'm fairly new to Rust, but willing to give this a go if you're ok with that?
from biome.
Go ahead @emab , feel free to use this issue to ask any question, or even a draft pr
from biome.
Great! Thank you.
from biome.
Hi @ematipico, please can I check if I'm on the right path?
from biome.
I wasn't sure how to check for strict mode in one of my functions...
from biome.
Please open a PR so that we can add comments :)
from biome.
Opened, link above!
from biome.
@Conaclos may I ask how I can have multiple valid / invalid test files? I want to include ones which are a module (by adding exports {}
) and ones which are not in order to properly test the detection of functions in block statements.
from biome.
@emab simply add other files, for example invalidXXXX.js
.
For esm use js
or ts
extension. For script file (non-strict mode) you can use cjs
extension.
from biome.
@emab simply add other files, for example
invalidXXXX.js
.For esm use
js
orts
extension. For script file (non-strict mode) you can usecjs
extension.
Brilliant thank you, have updated the PR.
from biome.
Related Issues (20)
- 📎 LSP: support for Workspaces
- 💅 lint/suspicious/noArrayIndexKey false negative in template literals HOT 1
- lint/style/noParameterAssign should cover all or more cases HOT 2
- 🐛 Issue with 'ignore' functionality in version 1.5 HOT 10
- 🐛 Multiple entries in the list of formatters HOT 23
- 📝 Comment's above the `from 'blah'` in a multi-line-export do not have whitespace preserved, moved to same line as `from` HOT 4
- Organize imports incorrect, deleted one and duplicate one HOT 3
- 🐛 biome_deserialize does not process escapes
- 💅 Biome throw useExhaustiveDependencies error when useRef type is defined using type assertion
- 🐛 Incompatibility with wireit HOT 2
- 🐛 no-multiple-empty-lines is not working HOT 2
- 🐛 IgnoreUnknown resulting in additional file being formatted
- Use strict mode in arrow function HOT 4
- 🐛 <TITLE> HOT 2
- Misconfigured config leads to using all the default settings HOT 1
- 🐛 Failed to parse const modifier.
- 📎 Biome should report the syntax error when trying formatting an invalid code
- 📎 Biome should report the location of the error in an invalid configuration file
- 🐛 VS Code extension: Poor support for multi-folder workspaces HOT 1
- 📚 VSCode extension settings documentation is for VSCode 1.82- HOT 1
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 biome.