Giter VIP home page Giter VIP logo

Comments (13)

ematipico avatar ematipico commented on May 19, 2024

I think, in our case, the word "lone" can be dropped. I suggest noUselessBlock

from biome.

Conaclos avatar Conaclos commented on May 19, 2024

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.

ematipico avatar ematipico commented on May 19, 2024

Thank you for clarifying! I would still remove "statement" from the word :) it's not beginner friendly

from biome.

emab avatar emab commented on May 19, 2024

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.

ematipico avatar ematipico commented on May 19, 2024

Go ahead @emab , feel free to use this issue to ask any question, or even a draft pr

from biome.

emab avatar emab commented on May 19, 2024

Great! Thank you.

from biome.

emab avatar emab commented on May 19, 2024

Hi @ematipico, please can I check if I'm on the right path?

emab@62e85fe

from biome.

emab avatar emab commented on May 19, 2024

I wasn't sure how to check for strict mode in one of my functions...

from biome.

Conaclos avatar Conaclos commented on May 19, 2024

Please open a PR so that we can add comments :)

from biome.

emab avatar emab commented on May 19, 2024

Opened, link above!

from biome.

emab avatar emab commented on May 19, 2024

@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.

Conaclos avatar Conaclos commented on May 19, 2024

@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 avatar emab commented on May 19, 2024

@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.

Brilliant thank you, have updated the PR.

from biome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.