Giter Site home page Giter Site logo

Comments (10)

macklinu avatar macklinu commented on May 19, 2024

We could provide an option that allows for ignoring the check for describe().

{
  "jest/lowercase-name": ["error", {
    "ignore": ["describe"]
  }]
}

I'm also wondering if lowercase-name should check describe() at all, or if only checking it() and test() is more valuable. 🤔

from eslint-plugin-jest.

nevir avatar nevir commented on May 19, 2024

from eslint-plugin-jest.

SimenB avatar SimenB commented on May 19, 2024

I like the idea of a regex (and an ignore array). PR welcome for both!

from eslint-plugin-jest.

macklinu avatar macklinu commented on May 19, 2024

This code introduced in #74 could be a starting point for introducing an ignore option to the lowercase-name rule.

const whitelistedHookNames = (
context.options[0] || { allow: [] }
).allow.reduce((hashMap, value) => {
hashMap[value] = true;
return hashMap;
}, Object.create(null));

from eslint-plugin-jest.

with-heart avatar with-heart commented on May 19, 2024

I submitted a PR to add the ignore option for this rule. I started to do some work on regex but it doesn't really feel like the description message regex belongs in the lowercase-name rule. Thoughts?

from eslint-plugin-jest.

nevir avatar nevir commented on May 19, 2024

maybe rename the rule to name, naming-style or something along those lines?

from eslint-plugin-jest.

SimenB avatar SimenB commented on May 19, 2024

Renaming it is a breaking change... We have a few breaking changes lined up anyways, so not a blocker. Worth it, though?

from eslint-plugin-jest.

nevir avatar nevir commented on May 19, 2024

Unsure! could maybe duplicate it into the new name & deprecate old, if you want a smoother transition (but a bit more annoying to maintain)

from eslint-plugin-jest.

SimenB avatar SimenB commented on May 19, 2024

This should be covered by the new option, agreed @nevir?

Might be worth opening up a new issues for renaming the option. My vote is for a new major once node 4 is EOL in April anyways 🙂

from eslint-plugin-jest.

SimenB avatar SimenB commented on May 19, 2024

🎉 This issue has been resolved in version 21.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from eslint-plugin-jest.

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.