Coder Social home page Coder Social logo

Comments (2)

davidcalhoun avatar davidcalhoun commented on May 14, 2024

Thanks for using the plugin! Just a heads up that the case insensitivity is intentional, as HTML tag and attribute names are case insensitive:

Attribute names for HTML elements may be written with any mix of lowercase and uppercase letters that are a case-insensitive match for the names of the attributes given in the HTML elements section of this document; that is, attribute names are case-insensitive.
(emphasis mine)

from eslint-plugin-test-selectors.

levaleks avatar levaleks commented on May 14, 2024

I believe that https://www.w3.org/TR/REC-xml/#NT-Name is more relevant in that case. Global_attributes has a section with recommendations where among others stated that "The name should not contain any capital letters, as XML is all lowercase."

Also, RTL warns when using non-lowercase data-testid:
"Warning: React does not recognize the data-testId prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase data-testid instead. If you accidentally passed it from a parent component, remove it from the DOM element."

The main problem for us is that we use testing-library/consistent-data-testid in conjunction with your plugin which is case sensitive.
So if someone would add data-testId (or data-TeStiD as an exaggerated example) consistent-data-testid validations will not be applied.

from eslint-plugin-test-selectors.

Related Issues (16)

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.