From 7b9df0ec969a1afa487e6a9c4852370bbeff43cd Mon Sep 17 00:00:00 2001 From: FromTheLOLAshes <153381408+FromTheLOLAshes@users.noreply.github.com> Date: Tue, 21 May 2024 12:14:32 -0400 Subject: [PATCH] add eslint check (#409) Co-authored-by: Christopher Oliphant --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 11 +++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..36af219892 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 8368cf386b..d25f6c41ed 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "update:icons": "npm update @awesome.me/kit-fde2be5eb0", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "chromatic": "npx chromatic --project-token=chpt_0945f90d5d3626c" + "chromatic": "npx chromatic --project-token=chpt_0945f90d5d3626c", + "prepare": "husky install" }, "dependencies": { "@awesome.me/kit-fde2be5eb0": "^1.0.7", @@ -75,6 +76,8 @@ "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-storybook": "^0.8.0", + "husky": "^9.0.11", + "lint-staged": "^15.2.2", "node-sass": "^9.0.0", "postcss": "^8.4.37", "postcss-import": "^16.0.1", @@ -91,5 +94,9 @@ "engines": { "node": ">=18.0.0" }, - "version": "" + "version": "", + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,css,md}": "prettier --write" + } }