-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathlint-staged.config.js
More file actions
73 lines (63 loc) · 2.26 KB
/
lint-staged.config.js
File metadata and controls
73 lines (63 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module.exports = {
'**/*.{ts?(x),?(m)js,json,css,html}': (files) => {
const filteredFiles = files.filter((file) => {
// Exclude quantic and create-atomic-template packages
if (file.includes('/packages/quantic/')) return false;
if (file.includes('/packages/create-atomic-template/')) return false;
if (file.includes('/packages/create-atomic-component/template/'))
return false;
if (file.includes('/packages/create-atomic-component-project/template/'))
return false;
// Exclude root deployment config
if (file.endsWith('.deployment.config.json')) return false;
if (file.endsWith('package-lock.json')) return false;
// Exclude atomic package cypress, tsx (except stories), and d.ts files
if (
file.includes('/packages/atomic/') &&
(file.includes('/cypress/') ||
(file.endsWith('.tsx') && !file.endsWith('.stories.tsx')) ||
file.endsWith('.d.ts'))
)
return false;
// Exclude atomic-angular stencil-generated
if (
file.includes('/packages/atomic-angular/') &&
file.includes('/stencil-generated/')
)
return false;
// Exclude atomic-react stencil-generated
if (
file.includes('/packages/atomic-react/') &&
file.includes('/stencil-generated/')
)
return false;
// Exclude documentation assets
if (
file.includes('/packages/documentation/') &&
file.includes('/assets/')
)
return false;
// Exclude headless coveo.analytics
if (
file.includes('/packages/headless/') &&
file.includes('/coveo.analytics/')
)
return false;
// Exclude atomic-stencil-samples d.ts
if (file.includes('/packages/samples/stencil/') && file.endsWith('.d.ts'))
return false;
// Exclude tailwind css files
if (file.endsWith('.tw.css')) return false;
return true;
});
if (filteredFiles.length === 0) {
return 'echo "No files to process with Biome"';
}
return `biome check --write --error-on-warnings ${filteredFiles.join(' ')}`;
},
'**/*.md': (files) => {
return `cspell --no-progress --show-suggestions --show-context --no-must-find-files ${files.join(
' '
)}`;
},
};