Skip to content

Commit 30763ae

Browse files
committed
ci: update docs
1 parent 6792ecf commit 30763ae

4 files changed

Lines changed: 4 additions & 41 deletions

File tree

lint-staged.common.mjs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import path from 'path';
2-
import { quote } from 'shell-quote';
3-
4-
const isWin = process.platform === 'win32';
52

63
const eslintGlobalRulesForFix = [
74
// react-hooks/eslint and react in general is very strict about exhaustively
@@ -62,19 +59,3 @@ export const getEslintFixCmd = ({
6259
].join(' ');
6360
return `eslint ${args}`;
6461
};
65-
66-
/**
67-
* Concatenate and escape a list of filenames that can be passed as args to prettier cli
68-
*
69-
* Prettier has an issue with special characters in filenames,
70-
* such as the ones uses for nextjs dynamic routes (ie: [id].tsx...)
71-
*
72-
* @link https://github.com/okonet/lint-staged/issues/676
73-
*
74-
* @param {string[]} filenames
75-
* @returns {string} Return concatenated and escaped filenames
76-
*/
77-
export const concatFilesForPrettier = (filenames) =>
78-
filenames
79-
.map((filename) => `"${isWin ? filename : quote([filename])}"`)
80-
.join(' ');

lint-staged.config.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import { fileURLToPath } from 'node:url';
55
* A good practice is to override this base configuration in each package and/or application
66
* where we are able to add customization depending on the nature of the project (eslint...).
77
*/
8-
import {
9-
concatFilesForPrettier,
10-
getEslintFixCmd,
11-
} from './lint-staged.common.mjs';
8+
import { getEslintFixCmd } from './lint-staged.common.mjs';
129

1310
/**
1411
* @type {Record<string, (filenames: string[]) => string | string[] | Promise<string | string[]>>}
@@ -26,11 +23,6 @@ const rules = {
2623
files: filenames,
2724
});
2825
},
29-
'**/*.{json,md,mdx,css,html,yml,yaml,scss,ts,js,tsx,jsx,mjs}': (
30-
filenames
31-
) => {
32-
return [`prettier --write ${concatFilesForPrettier(filenames)}`];
33-
},
3426
};
3527

3628
export default rules;

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"lint-staged-files": "lint-staged --allow-empty",
5454
"changeset": "changeset",
5555
"release": "yarn build && changeset publish",
56-
"cz": "cz"
56+
"cz": "cz",
57+
"postinstall": "is-ci || husky"
5758
},
5859
"config": {
5960
"commitizen": {
@@ -71,7 +72,6 @@
7172
"@commitlint/config-conventional": "19.2.2",
7273
"@hyperse/eslint-config-hyperse": "^1.0.4",
7374
"@types/node": "^20.12.12",
74-
"@types/shell-quote": "1.7.5",
7575
"commitizen": "4.3.0",
7676
"cz-conventional-changelog": "3.3.0",
7777
"eslint": "^9.3.0",
@@ -80,7 +80,6 @@
8080
"lint-staged": "15.2.5",
8181
"npm-run-all": "^4.1.5",
8282
"postcss": "^8.4.38",
83-
"shell-quote": "1.8.1",
8483
"tsup": "^8.0.2",
8584
"typescript": "^5.4.5",
8685
"vite": "^5.2.11",

yarn.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,6 @@ __metadata:
943943
"@hyperse/eslint-config-hyperse": "npm:^1.0.4"
944944
"@hyperse/ts-node-paths": "npm:^1.0.3"
945945
"@types/node": "npm:^20.12.12"
946-
"@types/shell-quote": "npm:1.7.5"
947946
commitizen: "npm:4.3.0"
948947
cz-conventional-changelog: "npm:3.3.0"
949948
eslint: "npm:^9.3.0"
@@ -953,7 +952,6 @@ __metadata:
953952
lint-staged: "npm:15.2.5"
954953
npm-run-all: "npm:^4.1.5"
955954
postcss: "npm:^8.4.38"
956-
shell-quote: "npm:1.8.1"
957955
tsup: "npm:^8.0.2"
958956
typescript: "npm:^5.4.5"
959957
vite: "npm:^5.2.11"
@@ -1475,13 +1473,6 @@ __metadata:
14751473
languageName: node
14761474
linkType: hard
14771475

1478-
"@types/shell-quote@npm:1.7.5":
1479-
version: 1.7.5
1480-
resolution: "@types/shell-quote@npm:1.7.5"
1481-
checksum: 10/32b4d697c7d23dbadf40713692c47f1595f083a3b3deea76cb18e30a05d197aa9205d2b87f6d92edb60cda120b51e35d32bda96ed9b0a7e32921eed2deb4559e
1482-
languageName: node
1483-
linkType: hard
1484-
14851476
"@types/supports-color@npm:^8.0.0":
14861477
version: 8.1.3
14871478
resolution: "@types/supports-color@npm:8.1.3"
@@ -7987,7 +7978,7 @@ __metadata:
79877978
languageName: node
79887979
linkType: hard
79897980

7990-
"shell-quote@npm:1.8.1, shell-quote@npm:^1.6.1":
7981+
"shell-quote@npm:^1.6.1":
79917982
version: 1.8.1
79927983
resolution: "shell-quote@npm:1.8.1"
79937984
checksum: 10/af19ab5a1ec30cb4b2f91fd6df49a7442d5c4825a2e269b3712eded10eedd7f9efeaab96d57829880733fc55bcdd8e9b1d8589b4befb06667c731d08145e274d

0 commit comments

Comments
 (0)