나는 다음과 같은 eslint 오류가 발생합니다 :는 반작용 기본 앱 ES 린트에서 글로벌로 웹 소켓을 정의
42:21 error 'WebSocket' is not defined no-undef
당신은 그것을 글로벌 때문에 react-native
에서 웹 소켓을 가져올 수는 없지만 나는에 전역으로 웹 소켓을 추가 할 때 내
globals:
WebSocket: true
가 어떻게이 반작용 기본 앱 ES 린트의 세계로 웹 소켓을 정의합니까 : .eslintrc.yml
이 오류의 결과를 변경하지 않는 이유는 무엇입니까?
이 문제를 해결할 수 있습니까?
env:
browser: false
es6: true
commonjs: true
node: true
extends: 'airbnb'
parser: babel-eslint
globals:
WebSocket: true
parserOptions:
ecmaFeatures:
experimentalObjectRestSpread: true
jsx: true
sourceType: module
plugins:
- react
- react-native
rules:
indent:
- error
- tab
- {"SwitchCase": 1}
linebreak-style:
- error
- unix
quotes:
- error
- double
semi:
- error
- never
no-tabs: off
max-len: off
no-console: off
no-plusplus: off
global-require: off
import/no-unresolved: off
import/extensions: off
class-methods-use-this: off
react/jsx-no-bind: off
react/forbid-prop-types: off
react/prefer-stateless-function: off
react/jsx-indent: [2, 'tab']
react/jsx-indent-props: [2, 'tab']
react/jsx-filename-extension: [1, { extensions: ['.js', '.jsx'] }]
react/jsx-uses-react: error
react/jsx-uses-vars: error
react-native/no-unused-styles: 2
react-native/split-platform-components: 2
react-native/no-inline-styles: off
react-native/no-color-literals: off
나는 내가 에어 비앤비 eslint에서 상속하지 않는 경우
/* globals WebSocket:true */
또한 인라인 주석을 사용하여 제거 할 수 있지만, 그럴 수 없어 그림 : 현재 내 .eslintrc은 다음과 같습니다 Airbnb에서 어떤 보푸라기 규칙이 이것을 막을 책임이 있습니다.
어떻게 eslint를 실행합니까? 또한'.eslintrc.yml' 파일이 eslint를 실행할 때 사용되는지 확인 하시겠습니까? – Gyandeep