'Apply eslint rules in Next JS while compilation time

I created an application in NextJs. I have my eslint configuration:

{
  "extends": "next/core-web-vitals",
  "rules": {
    "react/no-unescaped-entities": "off",
    "@next/next/no-page-custom-font": "off",
    "prefer-const": "warn"
  }
}

The rules are aplied when i run npm run lint, but i need to apply the rules when i type the code in the editor like when i will type this line: let a = 2; to get the warning at once in my editor. Warning: 'a' is never reassigned. Use 'const' instead. prefer-const.
Question: What configuration i need to add to get what i described above?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source