eslint는 devDependency가 아니라 프로젝트의 종속성에 나열되어야 합니다.
이해가 안 가는 것도dependencies
대.devDependencies
노드 100%에서 아직 그렇지 않으면 여기서 eslint가 잘못되었을 뿐입니다(이를 정확하게 분석할 수 없음).
3:1 error 'chai' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
4:1 error 'chai-enzyme' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
5:1 error 'enzyme' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
7:1 error 'sinon' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
9:1 error 'redux-mock-store' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
이런 것들이 검사 종속성인데 왜 이런 것들을 기재해야 한다고 하는 것입니까?dependencies
?
추가 참고 사항:저희는 트래비스를 CI로 사용하고 있기 때문에 그것도 차이가 있을지 모르겠습니다.
이것을 내 것에 추가해서 해결했습니다..eslintrc
:
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]
이 사용자의 답변에 따라:
테스트 폴더의 .eslintrc에서 devDependencies: true 옵션을 설정할 수 있습니다.
규칙: 가져오기/외부 종속성 없음: [error, {devDependency: true}] 그러면 종속성 또는 devDependency가 포함되지 않은 패키지에 대한 보고서가 표시됩니다.그러면 비활성화 주석에서 노이즈가 발생하지 않고 규칙의 장점을 얻을 수 있습니다.
그게 도움이 될 것 같은데요?테스트 코드가 테스트 디렉토리로 분리되어 있기 때문에 이 규칙을 사용할 수 있습니다.
또한 이 게시물은 내가 이것들 중 일부를 내 부양가족 목록에 원하지 않을 정도로 미친 것이 아니라는 것을 확인하는 데 도움이 되었습니다.공유 가능한 ESLint 구성
다음의 가져오기를 허용하려면devDependencies
테스트 파일에서만 사용할 수 있습니다.array of globs
, 의 문서로서no-extraneous-dependencies
상태:
glob의 배열을 사용할 때 linting되는 파일 이름이 배열의 단일 glob과 일치하면 true(오류 보고되지 않음)로 설정되고 그렇지 않으면 false로 설정됩니다.
다음 설정은 테스트 파일에 대해서만 lint를 비활성화합니다.
"import/no-extraneous-dependencies":[
"error",
{
"devDependencies":[
"**/*.test.ts",
"**/*.test.tsx"
]
}
]
그런 식으로 수입은devDependencies
여전히 오류로 보고됩니다.
사용해서 고쳤습니다.
'import/no-extraneous-dependencies': [
'error',
{
projectDependencies: false,
},
],
나는 다음을 추가함으로써 수정했습니다.
"import/no-extraneous-dependencies": "off"
누락된 패키지(내 경우 타이프스크립트와 스토리북)를 내 것에 추가하여 해결할 수 있었습니다.plugins
디렉토리 인.eslintrc
.
이 게시물에 자세한 내용을 알려드립니다. ESLint 오류: '@storybook/react'는 devDependency가 아닌 프로젝트의 종속성에 나열되어야 합니다.
언급URL : https://stackoverflow.com/questions/44939304/eslint-should-be-listed-in-the-projects-dependencies-not-devdependencies
'programing' 카테고리의 다른 글
어떻게 두 개의 다른 컴퓨터에 있는 같은 파일이 다른 결과를 줄 수 있습니까? (0) | 2023.09.25 |
---|---|
JQuery / JavaScript와 연결할 메일 호출 / 클릭 (0) | 2023.09.25 |
서버 시스템 이름을 ASP로 가져옵니다.NET MVC? (0) | 2023.09.25 |
우커머스는 액션 훅을 제거합니다. (0) | 2023.09.25 |
Android List행별로 다른 레이아웃을 가진 보기 (0) | 2023.09.25 |