pixiebrix / eslint-config-pixiebrix

Custom eslint config, to be used with Prettier
MIT License
1 stars 1 forks source link

Move some custom rules from the extension to the shared config #229

Open fregante opened 7 months ago

fregante commented 7 months ago

I think someone suggested this before but I can't find it. Maybe it was just me?

I don’t think any of these rules is extension-specific, so it can be shared with other repos

https://github.com/pixiebrix/pixiebrix-extension/blob/main/eslint-local-rules/

    "local-rules/noNullRtkQueryArgs": "error",
    "local-rules/noInvalidDataTestId": "error",
    "local-rules/noExpressionLiterals": "error",
    "local-rules/notBothLabelAndLockableProps": "error",
    "local-rules/preferNullish": "warn",
    "local-rules/preferNullishable": "warn",

Only persistBackgroundData and noCrossBoundaryImports are really specific to the extension I think.

cc @grahamlangford @fungairino

Related

grahamlangford commented 7 months ago

I'm curious why we have our own version of https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/consistent-data-testid.md

fregante commented 7 months ago

cc @BLoe for https://github.com/pixiebrix/pixiebrix-extension/pull/5466

Probably because we hadn't added the Testing Library ESLint plugin yet

BLoe commented 7 months ago

Yeah we either didn't know a rule existed already or we just had not added that plugin yet 🤷‍♂️