Skip to content

Commit 5e9c309

Browse files
authored
Update git hooks setup, add knip (#608)
1 parent 2281df3 commit 5e9c309

File tree

14 files changed

+2310
-1126
lines changed

14 files changed

+2310
-1126
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged --concurrent true

knip.jsonc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@next/schema.json",
3+
"entry": ["src/index.ts!"],
4+
"project": ["src/**/*.{ts,tsx,mdx}!", ".storybook/**/*.js", "jest.config.js"],
5+
"ignoreDependencies": [
6+
// False-positives
7+
"identity-obj-proxy",
8+
"react-copy-to-clipboard",
9+
"lodash",
10+
"lodash.clonedeep",
11+
"@types/lodash.clonedeep",
12+
"storybook",
13+
// Can be listed explicitly in the future
14+
"@jest/types",
15+
"@types/eslint"
16+
],
17+
"rules": {
18+
"enumMembers": "warn"
19+
},
20+
"ignore": ["**/*.d.ts", "**/__mockups__"]
21+
}

lint-staged.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* Copyright (c) 2021-2023 Nordcloud Oy or its affiliates. All Rights Reserved. */
2+
3+
module.exports = {
4+
"*.{ts,tsx,js}": ["prettier --write", "eslint --fix", "stylelint"],
5+
"*.{json,json5,jsonc,md,mdx,yaml,yml,css,html}": ["prettier --write"],
6+
};

0 commit comments

Comments
 (0)