This week I used ESlint to resolve over 150 issues in a game I created, GeoAsteroids. You can see the work in this PR. I also use a pre-commit hook to lint and format code pushing to remote. All I had to do was install a tool called Husky, and add a pre-commit file in the .github folder. pre-commit runs:

npm run lint-fix

which is defined in my package.json file,

// package.json
"scripts": {
  ...
  "lint": "eslint . --ext .js,.ts",
  "lint-fix": "eslint . --fix --ext .js,.ts",
},

lint-fix is run in the pre-commit hook and lint is run during the CI build process with Git Actions. This way, I fix the issues locally before the code is committed, and it's rechecked before it makes it into a remote branch.

Add a linter to your codebase today!

Comments

Back to Home
John Solly Profile Picture
John Solly Profile Picture

John Solly

Hi, I'm John, a Software Engineer with a decade of experience building, deploying, and maintaining cloud-native geospatial solutions. I currently serve as a senior software engineer at HazardHub (A Guidewire Offering), where I work on a variety of infrastructure and application development projects.

Throughout my career, I've built applications on platforms like Esri and Mapbox while also leveraging open-source GIS technologies such as OpenLayers, GeoServer, and GDAL. This blog is where I share useful articles with the GeoDev community. Check out my portfolio to see my latest work!