Skip to content

Commit

Permalink
chore: add lint-staged to git hook
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseVSeb committed Jan 18, 2024
1 parent 1bf32a4 commit ee41c15
Show file tree
Hide file tree
Showing 6 changed files with 2,623 additions and 984 deletions.
13 changes: 7 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["pnpm-lock.yaml"],
"rules": {
"prefer-const": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "ignoreRestSiblings": true },
],
{ "ignoreRestSiblings": true }
]
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": true,
"warnOnUnsupportedTypeScriptVersion": true
},
"env": {
"browser": true,
"node": true,
"es2024": true,
"jest": true,
},
"jest": true
}
}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint
npx lint-staged
9 changes: 8 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"useTabs": false
"useTabs": false,
"endOfLine": "auto",
"overrides": [
{
"files": [".eslintrc", ".prettierrc"],
"options": { "parser": "json" }
}
]
}
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
"author": "Jose V Sebastian",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"start": "tsx ./src/cli",
"build": "rollup -c",
"test": "jest --watch",
"lint": "eslint --quiet --fix",
"prepare": "husky install"
},
"lint-staged": {
"*": [
"prettier --ignore-unknown --write",
"eslint --quiet"
]
},
"bin": "dist/cli.js",
"main": "dist/react/index.js",
"typings": "dist/react/index.d.ts",
Expand All @@ -13,13 +26,6 @@
"engines": {
"node": ">=20"
},
"scripts": {
"start": "tsx ./src/cli",
"build": "rollup -c",
"test": "jest --watch",
"lint": "eslint ./src/**/*.{js,jsx,ts,tsx} --quiet --fix",
"prepare": "husky install"
},
"dependencies": {
"@optimize-lodash/rollup-plugin": "^4.0.4",
"cheerio": "1.0.0-rc.12",
Expand All @@ -46,6 +52,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
"rollup": "^4.9.5",
"rollup-plugin-analyzer": "^4.0.0",
Expand Down
Loading

0 comments on commit ee41c15

Please sign in to comment.