ESLint too strict
Unanswered
Crazy ant posted this in #help-forum
Crazy antOP
the new create-next-app will configure nextjs with very strict eslint, the unused locals and params causes build error, sure it is good to detect something like this, but it isn't necessary all the time.
i'm trying to set my unused locals and params strict settings in tsconfig.json seems did not fix this, any idea?
i'm trying to set my unused locals and params strict settings in tsconfig.json seems did not fix this, any idea?
11 Replies
Asian black bear
eslint is not configured using the tsconfig.json file. You need to disable or soften the rules causing the errors.
Chum salmon
I think it's a good practice to keep the code clean. If you don't use something (yet), just comment it out is a better way.
Crazy antOP
yeah, but is there any way of soften it a little bit? making it as a warning instead of error
Asian black bear
By changing the rule to warn instead of erroring using the eslint config, yes.
@Asian black bear eslint is not configured using the tsconfig.json file. You need to disable or soften the rules causing the errors.
Crazy antOP
do you know how? the new create-next-app use eslint.config.mjs, not .eslint.json
Asian black bear
I don't use eslint, but it's likely just a
"rule-name": "warn"
in the rules
section, that shouldn't have changed drastically.Crazy antOP
i'm confuse with this, all stackoverflow mentioning .eslint.json while i dont want to use "vibe coding" way by asking chatgpt for this
@Asian black bear I don't use eslint, but it's likely just a `"rule-name": "warn"` in the `rules` section, that shouldn't have changed drastically.
Crazy antOP
here's the actual file for it
https://github.com/BanDroid/next-pocketbase-auth/blob/main/eslint.config.mjs
it was an array, not object, so very confusing on how the new one works
https://github.com/BanDroid/next-pocketbase-auth/blob/main/eslint.config.mjs
it was an array, not object, so very confusing on how the new one works
Asian black bear
You just add a new unnamed object into the array.
Here's an arbitrary example from the docs:
// eslint.config.js
export default [
{
files: ["**/*.js"],
rules: {
"jsdoc/require-description": "error",
"jsdoc/check-values": "error",
},
},
];
Crazy antOP
ah ok, will try it