Comments (2)
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.
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)
- Inline fns not recognized HOT 2
- Update readme
- Don't error for `readonly` or `disabled` by default HOT 3
- Errors vs warnings
- Bug with testAttribute error messages HOT 1
- Test selector is not working in angular projects. HOT 4
- CI: run tests on changes HOT 1
- This package doesn't work? HOT 1
- Allow multiple selectors HOT 4
- Allow data-testid HOT 2
- why use data-testids instead of ARIA? HOT 1
- customise auto-generated attributes HOT 1
- Remove auto-fix HOT 1
- How to ignore empty value for `data-test-id`?
- test-data-ids for static content, useful when asserting.
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 eslint-plugin-test-selectors.