사실 웹 팩 구성 파일이 있는데, 이는 공장 기능입니다 (react-universally
상용구).eslint - webpack 별칭
나는 resolve
옵션을 추가했습니다 그것은 다음과 같습니다 : 나는 import config from 'Config'
처럼 감속기에 액세스 할 수있어이 설정으로
resolve: {
// These extensions are tried when resolving a file.
extensions: config('bundleSrcTypes').map(ext => `.${ext}`),
// This is required for the modernizr-loader
// @see https://github.com/peerigon/modernizr-loader
alias: {
modernizr$: path.resolve(appRootDir.get(), './.modernizrrc'),
Config: path.resolve(appRootDir.get(), './config'),
},
},
,하지만 내 린터 나에게 오류를 던지고있다 :
'Config' should be listed in the project's dependencies. Run 'npm i -S Config' to add it (import/no-extraneous-dependencies)
'Config' should be listed in the project's dependencies. Run 'npm i -S Config' to add it (import/no-extraneous-dependencies)
Missing file extension for "Config" (import/extensions)
을
내 eslinter 구성에 별칭을 추가하려면 어떻게합니까? 이 문제에 대한 상위 Google 결과에 나열된 여러 패키지를 시도했지만 작동하지 않습니다. 별칭을 수동으로 .eslintrc
에 추가 할 수 있습니까? 는 config 가져 오기가 특별한 예외이기 때문에
네,하지만 내가 프로젝트에있는 파일의 양을 해제에
, 그냥 악몽이다. – Ancinek
불행히도'import/no-extraneous-dependencies' 규칙에는 특정 패키지에 대한 화이트리스트 또는 블랙리스트 옵션이없는 것처럼 보입니다. Github에서 플러그인에 대한 문제를 열려고 할 수 있습니다. – Sidney