eslint-plugin-validate-jsx-nesting
validate-html-nesting
eslint-plugin-validate-jsx-nesting | validate-html-nesting | |
---|---|---|
4 | 2 | |
58 | 29 | |
- | - | |
1.7 | 2.4 | |
about 1 year ago | about 1 year ago | |
TypeScript | JavaScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
eslint-plugin-validate-jsx-nesting
-
Introducing react.dev: the new React docs site!
I just looked and found eslint-plugin-validate-jsx-nesting that specifically checks nesting, but it doesn't look very popular or active.
- I created an ESLint plugin to find invalid HTML nestings in JSX
- I created an ESLint Plugin to Find Invalid HTML Nestings
- Show HN: I Created ESLint Plugin That Finds Invalid HTML Nestings in JSX
validate-html-nesting
-
I created an ESLint plugin to find invalid HTML nestings in JSX
The problem is not the Invalid HTML, but that the browser fixes it and so framework's code to update the DOM ends up updating the wrong DOM nodes and may even throw error. Example
-
Show HN: I Created ESLint Plugin That Finds Invalid HTML Nestings in JSX
Invalid HTML Nestings such as a
inside a
is invalid and browser automatically fixes it by putting the
outside the parent
and so the DOM ends up rendering different structure than JSX. There are a lot of such invalid nestings. See [this](https://github.com/MananTank/validate-html-nesting/blob/main...) For Example.
This is problematic and creates all sorts of bugs in Frameworks. Most Frameworks that use JSX (such as React, SolidJS, Preact) checks for invalid HTML Nestings at runtime and logs an error. ( Though this runtime checks are not very comprehensive - React has decent list of checks but is still missing quite a few )
Until now there was no way to check for such invalid Nestings without running the code. So I've created this ESLint Plugin to do just that.
This does not mean that we get rid of runtime invalid nesting checking, because This ESLint plugin can not predict what your component's top level element will be - because that would require running the code. So consider this as a tool to catch 99% of the invalid nestings without running the code.
What are some alternatives?
hydroxide - Next Generation Reactive JavaScript Framework
eslint-plugin-project-structure - Eslint plugin that allows you to enforce rules on project structure to keep your repository consistent even in large teams.
babel-plugin-validate-jsx-nesting - compile time JSX nesting validation
lit - Lit is a simple library for building fast, lightweight web components.
eslint-plugin-jsx-a11y - Static AST checker for a11y rules on JSX elements.
reactjs.org - The React documentation website [Moved to: https://github.com/reactjs/react.dev]
Svelte - Cybernetically enhanced web apps