Skip to content

Commit

Permalink
ci: setup lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
indaco committed Nov 3, 2023
1 parent 954e8f9 commit e084ab2
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 75 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,ts,svelte}": ["pnpm format --", "pnpm lint --"],
"*.json": "prettier --write --ignore-path ./.prettierignore --"
}
8 changes: 7 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"plugins": ["prettier-plugin-svelte", "prettier-plugin-packagejson"],
"overrides": [
{
"files": ["*.svelte"],
"options": {
"bracketSameLine": false,
"parser": "svelte"
}
},
{
"files": ["package.json"],
"options": {
"useTabs": false
}
}
]
}
150 changes: 76 additions & 74 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,78 @@
{
"name": "@indaco/svelte-iconoir",
"version": "6.0.3",
"type": "module",
"packageManager": "pnpm@8.10.1",
"author": "indaco <github@mircoveltri.me>",
"description": "Iconoir SVG icons as Svelte components.",
"license": "MIT",
"keywords": [
"iconoir",
"icons",
"icons-set",
"svelte",
"svelte components",
"sveltekit",
"svg-icons"
],
"repository": {
"type": "git",
"url": "https://github.com/indaco/svelte-iconoir"
},
"bugs": {
"url": "https://github.com/indaco/svelte-iconoir/issues"
},
"peerDependencies": {
"svelte": "^3.59.1 || ^4.0.0"
},
"devDependencies": {
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/kit": "^1.27.2",
"@sveltejs/package": "^2.2.2",
"@types/cli-progress": "^3.11.4",
"@types/svg-parser": "^2.0.5",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"cli-progress": "^3.12.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.34.0",
"hast-util-to-html": "^9.0.0",
"husky": "^8.0.0",
"picocolors": "1.0.0",
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"publint": "^0.2.5",
"rimraf": "^5.0.5",
"scule": "^1.0.0",
"svelte-check": "^3.5.2",
"svg-parser": "^2.0.4",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.5.0"
},
"scripts": {
"build": "rimraf dist && pnpm sync && svelte-package",
"check": "pnpm sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "pnpm sync && svelte-check --tsconfig ./tsconfig.json --watch",
"clean": "rimraf dist && pnpm compile && node build/scripts/cleanAll.js",
"commitlint": "commitlint --edit",
"compile": "tsc --outDir build/scripts",
"cpfiles": "node build/scripts/cpFiles.js",
"dev": "pnpm sync && vite dev",
"format": "prettier --write --plugin prettier-plugin-svelte --ignore-path ./.prettierignore .",
"generate:icons": "pnpm compile && pnpm clean && node build/scripts/buildIconsDataset.js",
"generate:pkgjson": "pnpm compile && node build/scripts/makeProdPkg.js",
"lint": "prettier --check . && eslint .",
"postbuild": "pnpm generate:pkgjson && pnpm cpfiles && pnpm exec publint ./dist",
"prepare": "husky install",
"preview": "vite preview",
"sync": "svelte-kit sync"
},
"sideEffects": false,
"svelte": "./index.js"
"name": "@indaco/svelte-iconoir",
"version": "6.0.3",
"description": "Iconoir SVG icons as Svelte components.",
"keywords": [
"iconoir",
"icons",
"icons-set",
"svelte",
"svelte components",
"sveltekit",
"svg-icons"
],
"bugs": {
"url": "https://github.com/indaco/svelte-iconoir/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/indaco/svelte-iconoir"
},
"license": "MIT",
"author": "indaco <github@mircoveltri.me>",
"sideEffects": false,
"type": "module",
"svelte": "./index.js",
"scripts": {
"build": "rimraf dist && pnpm sync && svelte-package",
"postbuild": "pnpm generate:pkgjson && pnpm cpfiles && pnpm exec publint ./dist",
"check": "pnpm sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "pnpm sync && svelte-check --tsconfig ./tsconfig.json --watch",
"clean": "rimraf dist && pnpm compile && node build/scripts/cleanAll.js",
"commitlint": "commitlint --edit",
"compile": "tsc --outDir build/scripts",
"cpfiles": "node build/scripts/cpFiles.js",
"dev": "pnpm sync && vite dev",
"format": "prettier --write --plugin prettier-plugin-svelte --ignore-path ./.prettierignore .",
"generate:icons": "pnpm compile && pnpm clean && node build/scripts/buildIconsDataset.js",
"generate:pkgjson": "pnpm compile && node build/scripts/makeProdPkg.js",
"lint": "prettier --check . && eslint .",
"prepare": "husky install",
"preview": "vite preview",
"sync": "svelte-kit sync"
},
"devDependencies": {
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/kit": "^1.27.2",
"@sveltejs/package": "^2.2.2",
"@types/cli-progress": "^3.11.4",
"@types/svg-parser": "^2.0.5",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"cli-progress": "^3.12.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.34.0",
"hast-util-to-html": "^9.0.0",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"picocolors": "1.0.0",
"prettier": "^3.0.3",
"prettier-plugin-packagejson": "^2.4.6",
"prettier-plugin-svelte": "^3.0.3",
"publint": "^0.2.5",
"rimraf": "^5.0.5",
"scule": "^1.0.0",
"svelte-check": "^3.5.2",
"svg-parser": "^2.0.4",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.5.0"
},
"peerDependencies": {
"svelte": "^3.59.1 || ^4.0.0"
},
"packageManager": "pnpm@8.10.1"
}
Loading

0 comments on commit e084ab2

Please sign in to comment.