Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
Husky & Prettier [error] No se puede leer la propiedad '' de nulo

Configuré un gancho fornido para una aplicación de reacción, para eslint y más bonito, aunque cuando me comprometo y se ejecuta el script más bonito, aparece este error:

 > eslint --fix src/**/*.js > prettier src/**/*.js --write. --config ./.prettierrc [error] Cannot read property '' of null > husky - pre-commit hook exited with code 1 (error)

Revisé toda la aplicación en busca de esta "condición nula", aunque no encontré nada.

.prettierrc

 { "arrowParens": "always", "bracketSpacing": true, "embeddedLanguageFormatting": "auto", "htmlWhitespaceSensitivity": "css", "insertPragma": false, "jsxSingleQuote": false, "proseWrap": "preserve", "quoteProps": "as-needed", "requirePragma": false, "semi": true, "singleQuote": false, "trailingComma": "es5", "useTabs": false, "vueIndentScriptAndStyle": false, "printWidth": 150, "tabWidth": 4, "rangeStart": 0 }

paquete.json

 "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "lint": "eslint --fix src/**/*.js", "format": "prettier src/**/*.js --write. --config ./.prettierrc", "prepare": "husky install" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "husky": { "hooks": { "pre-commit": "npm run lint && npm run format" } }, "devDependencies": { "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.27.1", "eslint-plugin-react-hooks": "^4.3.0", "husky": "^7.0.4", "prettier": "^2.5.1" }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hay un error tipográfico en el script de formato, puede ponerlo como

"format": "prettier src/**/*.js --write"

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!