본문 바로가기
개발/게임) 개발관련

문제해결) Error : Eslint Expeted indentation of 2 space but found 0 indent

by 테샤르 2022. 7. 6.

Error : Eslint Expeted indentation of 2 space but found 0 indent 

Firebase Funtion을 Deploy 하는 과정에서 발생한 이슈로

트러블 슈팅에 대한 기록 및 해결방법이다.

1차적으로 '들여쓰기'에서 문법에러가 나온다. 그럴경우에는  '.eslintrc.js'파일의 rule을 추가한다.

https://stackoverflow.com/questions/43301014/eslint-expected-indentation-of-1-tab-but-found-4-spaces-error

 

Eslint expected indentation of 1 tab but found 4 spaces error

I am using VScode with latest version of Eslint. It is my first time using a linter. I keep getting this linting error when using a tab as indentation: severity: 'Error' message: 'Expected

stackoverflow.com

 

 

반응형

ESLint indent 문서 : [ 링크 ]

 

indent - ESLint - Pluggable JavaScript Linter

A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

eslint.org

VSCode에서 편집을한다면 Extension MarketPlace 에서 'ESLint'를 설치하자.

설치하고 난 이후에 문제가되는 곳에 커서를 두개되면 다음과같이 Quick Fix 항목이 나오는데

Fix all auto-fixable promblems을 하게되면 자동으로 변경이된다,

 

최종결론으로는 Firebase function Deploy 에서 문제는 다음의 이슈였다.

firebase.json 파일의  Path경로가 문제였다. 다음과 같이 수정하고 Deploy 를 하니 정상적으로 동작했다.

{
  "functions": {
    "predeploy": [
      "npm --prefix %$RESOURCE_DIR% run lint",
      "npm --prefix %RESOURCE_DIR% run build"
    ],
    "source": "functions"
  }
}

 

해결 StackOverFlow : [링크]

 

Error deploying with firebase on npm --prefix $RESOURCE_DIR run lint

I have a fresh install of firebase tools (following this tutorial) and I'm trying to upload my first firebase function. I get this issue with the hello-world example that they initialise when you run

stackoverflow.com

 

★☆☆☆☆

 

반응형

댓글