mightyiam / eslint-config-love

A TypeScript ESLint config that loves you
MIT License
757 stars 65 forks source link

Relax @typescript-eslint/no-magic-numbers #1786

Open darkbasic opened 1 day ago

darkbasic commented 1 day ago

Simple tasks like initializing a loop variable to zero with @typescript-eslint/no-magic-numbers current expects that you should create a separate const for zero. This doesn't happen with @typescript-eslint/no-magic-numbers by default: https://typescript-eslint.io/play/#ts=5.5.2&fileType=.tsx&code=MYewdgzgLgBAsgQQBowLwwIwAYsG4BQ%2BAZiAE4wAUANgKawCWaMeMjAPPMrqwNQ8CUMAN74YMKAAtSIAO4wwNOQFFS00hX4EAvkA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oFsBDAc0plaTWNwBGiaKgyQA7r2hNI4MAF8QaoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

I don't think the current eslint-config-love defaults for that rule are acceptable and apparently I'm not the only one that thinks so:

image

mightyiam commented 1 day ago

Sorry and thank you. Will take a look.