Proper way to setup ESLint
what's the proper way to setup ESLint? I'm attempting to look at the github repo for gemboard and I am unable to figure it out by looking at the configs.
Solution:Jump to solution
gemboard has it in the package.json but you can also just create an eslintrc file. See https://eslint.org/docs/latest/use/configure/ for more info.
Configure ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
14 Replies
Solution
gemboard has it in the package.json but you can also just create an eslintrc file. See https://eslint.org/docs/latest/use/configure/ for more info.
Configure ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
what's happening here?
this is default sapphirecli code
Are you sure it's that line. That has no explicit any
yes it does
Store<any>
yes its line 48:34 or something like that
So remove the any replacing it with the proper type or disable the lint rule for that line 🤷
It’s not my code to fix. It’s from your package. I’ll just suppress it
it's not because eslint doesn't run on code in node_modules by default
and there are no open eslint warnings in the sapphire code
and on top of that we sure as heck do not have a styleStore
lol I’ll copy the full error then
(as you should, always, from the beginning anyway)
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stack traces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. ❯ For an excellent video that shows how not to ask technical questions, watch this YouTube video by LiveOverflow. ❯ Asking technical questions (Clarkson) ❯ How to ask questions the smart way (Raymond)
Okay so I see where the confusion comes from here
the code is in the examples repo which is pulled in with the CLI
after the CLI generated the code however I do not really consider it Sapphire's code in the traditional sense because the user becomes responsible for it
It's fixed as per the last commit (see https://github.com/sapphiredev/examples/commit/35b99f47932e8d6a337aac3c748b22cdf92e511a#diff-832c95156b6ca0b771f0d0a263bc312eae4e3edf2b6a2f0df2e3f06866da4b8aL47 for the change) however it should be noted that by default that particular eslint rule is disabled in the @sapphire/eslint-config so either you enabled it yourself, or you're using a different eslint config. Both are perfectly fine things to do, but at that point you're also the one responsible for the results of that. See: https://github.com/sapphiredev/utilities/blob/c1384954108c3466a49ab0355633c203289ea3e8/packages/eslint-config/src/index.ts#L89C1-L89C1
GitHub
fix: re-export more types from @sapphire/pieces by favna · Pull Req...
Some of these really should've always been there (like AliesPieceJSON and PieceJSON) but I noticed this when trying to import StoreRegistryValue which is the type of store in:
for (const store ...
oh hey, thanks! I think I am using a different config, I’ll have to investigate