Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☂️ SolidJS eslint plugin rules #2438

Open
marvin-j97 opened this issue Apr 13, 2024 · 5 comments
Open

☂️ SolidJS eslint plugin rules #2438

marvin-j97 opened this issue Apr 13, 2024 · 5 comments
Assignees
Labels
S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@marvin-j97
Copy link
Contributor

marvin-j97 commented Apr 13, 2024

Description

no-react-specific-props

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-react-specific-props.md

Disallow React prop compatibility which was deprecated in Solid 1.4.0.

Implemented in #2427

components-return-once

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/components-return-once.md

Solid components only run once, and so conditionals should be inside JSX.

WIP #2439

prefer-show

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-show.md

Enforce using Solid's component for conditionally showing content. Solid's compiler covers this case, so it's a stylistic rule only.

prefer-for

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-for.md

Enforce using Solid's component for mapping an array to JSX elements. This rule is an error by default.

no-destructure

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-destructure.md

Disallow destructuring props. In Solid, props must be used with property accesses (props.foo) to preserve reactivity.

no-react-deps

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-react-deps.md

Disallow usage of dependency arrays in createEffect and createMemo.

style-prop

https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/style-prop.md

Require CSS properties in the style prop to be valid and kebab-cased (ex. 'font-size'), not camel-cased (ex. 'fontSize') like in React, and that property values with dimensions are strings, not numbers with implicit 'px' units.

@ematipico ematipico added S-Help-wanted Status: you're familiar with the code base and want to help the project S-Enhancement Status: Improve an existing feature labels Apr 18, 2024
@jer3m01
Copy link
Contributor

jer3m01 commented Apr 19, 2024

I'll take a jab at style-prop!

Does Biome already have a list of all known css rules?
eslint-plugin-solid imports a package with the list for fixing camel to kebab on known rules and erroring on unknown rules.

@ematipico
Copy link
Member

Does Biome already have a list of all known css rules?

Unfortunately, it doesn't.

@jer3m01
Copy link
Contributor

jer3m01 commented Apr 19, 2024

Unfortunately, it doesn't.

Should I paste a list somewhere or make it try to convert any camel to kebab (except all uppercase)?

@marvin-j97
Copy link
Contributor Author

@jer3m01 I already started working on style-prop, maybe you can take some stuff from my ugly WIP (I'd definitely change the Query to be Ast<JsxAttribute> instead):

marvin-j97@e9b06f6

@joshwilsonvu
Copy link

Good luck 🫡 feel free to drop an issue to the ESLint plugin if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

No branches or pull requests

4 participants