강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

김주일님의 프로필 이미지
김주일

작성한 질문수

한 입 크기로 잘라먹는 Next.js(v15)

↳ Next.js 15.0.3 버전부터 주의하셔야 할 점

eslint.config.mjs 내 rules 어떻게 설정 하나요?

작성

·

19

·

수정됨

0

import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
  ...nextVitals,
  ...nextTs,
  // Override default ignores of eslint-config-next.
  globalIgnores([
    // Default ignores of eslint-config-next:
    ".next/**",
    "out/**",
    "build/**",
    "next-env.d.ts",
    
  ]),  
]);

export default eslintConfig;

위 와 같이 구성 되어 있는데,

 "@typescript-eslint/no-unused-vars: "warn"

"@typescript-eslint/no-explicit-any": "off"

이 두가지 옵션을 어디에 입력해야 될지 모르겠어요

 

제미나이 답변으로는 아래 처럼 하라는데, 맞을까요?

import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
  ...nextVitals,
  ...nextTs,
  // Override default ignores of eslint-config-next.

  {
    rules: {
      "@typescript-eslint/no-unused-vars": "warn",
      "@typescript-eslint/no-explicit-any": "off",
    },
  },

  globalIgnores([
    // Default ignores of eslint-config-next:
    ".next/**",
    "out/**",
    "build/**",
    "next-env.d.ts",
  ]),
]);

export default eslintConfig;

답변 1

0

이정환 Winterlood님의 프로필 이미지
이정환 Winterlood
지식공유자

안녕하세요 김주일님 이정환입니다.

넵! 고렇게 작성하시면 됩니다 😀

김주일님의 프로필 이미지
김주일

작성한 질문수

질문하기