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:
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.
Jump to solution
14 Replies
Solution
Favna
Favna11mo ago
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.
Songbird
SongbirdOP11mo ago
error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any:
private styleStore(store: Store<any>, last: boolean) {
error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any:
private styleStore(store: Store<any>, last: boolean) {
what's happening here? this is default sapphirecli code
Favna
Favna11mo ago
Are you sure it's that line. That has no explicit any
Lioness100
Lioness10011mo ago
yes it does Store<any>
Songbird
SongbirdOP11mo ago
yes its line 48:34 or something like that
Favna
Favna11mo ago
So remove the any replacing it with the proper type or disable the lint rule for that line 🤷
Songbird
SongbirdOP11mo ago
It’s not my code to fix. It’s from your package. I’ll just suppress it
Favna
Favna11mo ago
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
Songbird
SongbirdOP11mo ago
lol I’ll copy the full error then
Favna
Favna11mo ago
(as you should, always, from the beginning anyway)
Spinel
Spinel11mo ago
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)
Favna
Favna11mo ago
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
Favna
Favna11mo ago
also created https://github.com/sapphiredev/framework/pull/715 to improve that code further
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 ...
Songbird
SongbirdOP11mo ago
oh hey, thanks! I think I am using a different config, I’ll have to investigate
Want results from more Discord servers?
Add your server