////
Search
📝

NextJS + ESLint 설정 문제

(base) krsy0411@isiyeong-ui-MacBookAir frontend % npm run lint > frontend@0.1.0 lint > next lint Invalid Options: - Unknown options: useEslintrc, extensions, resolvePluginsRelativeTo, rulePaths, ignorePath, reportUnusedDisableDirectives - 'extensions' has been removed. - 'resolvePluginsRelativeTo' has been removed. - 'ignorePath' has been removed. - 'rulePaths' has been removed. Please define your rules using plugins. - 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead. npm error Lifecycle script `lint` failed with error: npm error code 1 npm error path /Users/krsy0411/Desktop/portfolio/KraftonJungle/panopticon/frontend npm error workspace frontend@0.1.0 npm error location /Users/krsy0411/Desktop/portfolio/KraftonJungle/panopticon/frontend npm error command failed npm error command sh -c next lint (base) krsy0411@isiyeong-ui-MacBookAir frontend % (base) krsy0411@isiyeong-ui-MacBookAir frontend % cd /Users/krsy0411/Desktop /portfolio/KraftonJungle/panopticon/frontend && rm -f .eslintrc.json (base) krsy0411@isiyeong-ui-MacBookAir frontend % (base) krsy0411@isiyeong-ui-MacBookAir frontend % cd /Users/krsy0411/Desktop/portfolio/KraftonJungle/panopticon/fronte nd && npm install npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
Shell
복사
npm run lint 명령어를 실행하면 계속 이런 에러가 나고 있습니다.
인터넷 글을 찾아보니 ESLint v9를 사용하려고 해도, Next.js 14.2.15는 ESLint v8과 더 잘 호환된다고 합니다. 왜냐하면 ESLint에서는 useEslintrc, extensions, resolvePluginsRelativeTo 옵션 등을 v9에서 제거했다고 하네요. 또한 이유는 모르겠는데 eslint, eslint-config-next 패키지가 누락되었다고 합니다.
따라서 다음과 같은 해결책을 적용했습니다.
eslint, eslint-config-next 패키지 추가
패키지를 추가하고 버전을 수정하고 나니, 다음과 같이 설정 오류가 아닌 린트 검사 에러가 정상적으로 출력되는 것을 확인할 수 있었습니다.