|
1 | 1 | ---
|
2 | 2 | id: quality-control
|
3 | 3 | title: Static Quality Control
|
4 |
| -sidebar_label: Quality Control |
5 | 4 | ---
|
6 | 5 |
|
7 |
| -# XT Page Source Code Quality Config Package |
| 6 | +## Linting |
8 | 7 |
|
9 |
| -Package to unify code quality control configuration and rules across projects. No need to install those packages anymore in your projects and maintain them all separately. |
| 8 | +Config packages to unify code linting and typescript configuration and rules across projects. No need to install those packages anymore in your each project and maintain them all separately, thanks to monorepo structure. |
10 | 9 |
|
11 |
| -## Eslint Package |
12 |
| - |
13 |
| -To Install package <@xt-pagesource/eslint-config> |
14 |
| - |
15 |
| -```sh |
16 |
| -npm install @xt-pagesource/eslint-config-react |
17 |
| -``` |
18 |
| - |
19 |
| -#### Configure |
20 |
| - |
21 |
| -Create the file .eslintrc in your app root folder and extend rules. you can also add additional rules as per your desire. |
22 |
| - |
23 |
| -``` |
24 |
| -{ |
25 |
| - "extends":["@xt-pagesource/eslint-config-react"] |
26 |
| -} |
27 |
| -``` |
28 |
| - |
29 |
| -#### Note: |
30 |
| - You can extend or modify this rules in your project as is described on the documentation of eslint, the same way as you will do when extending eslint recommended rules. |
31 |
| - |
32 |
| -``` |
33 |
| -{ |
34 |
| - "extends":["@xt-pagesource/eslint-config-react"], |
35 |
| -
|
36 |
| - rules:{ |
37 |
| - your rules here |
38 |
| - } |
39 |
| -} |
40 |
| -``` |
41 |
| - |
42 |
| -### Usage |
43 |
| - |
44 |
| -Like you will do normally with eslint, this package is nothing else just a wrapper. - For just linting and to see the report, run: |
45 |
| - |
46 |
| -``` |
47 |
| -eslint path/to/folder |
48 |
| -``` |
49 |
| - |
50 |
| -For linting and autofix the problems, run: |
51 |
| - |
52 |
| -``` |
53 |
| -eslint --fix path/to/folder |
54 |
| -``` |
55 |
| - |
56 |
| -Recommended |
57 |
| -Add in your package.json at the scripts section the two following scripts: |
58 |
| - |
59 |
| -``` |
60 |
| -{ |
61 |
| - "scripts": { |
62 |
| - "lint:js": "eslint path/to/folder", |
63 |
| - "lint:fix": "eslint --fix path/to/folder" |
64 |
| - } |
65 |
| -} |
66 |
| -``` |
67 |
| - |
68 |
| ---- |
69 |
| - |
70 |
| -## Stylint Package |
71 |
| - |
72 |
| -To Install package <@xt-pagesource/stylelint-config> |
73 |
| - |
74 |
| -``` |
75 |
| -npm install @xt-pagesource/stylelint-config-react |
76 |
| -``` |
77 |
| - |
78 |
| -#### Configure |
79 |
| - |
80 |
| -Create the file .stylelintrc in your app root folder and extend rules. you can also add additional rules as per your desire. |
81 |
| - |
82 |
| -``` |
83 |
| -{ |
84 |
| - "extends":["@xt-pagesource/stylelint-config-react"] |
85 |
| -} |
86 |
| -``` |
87 |
| - |
88 |
| -#### Note: |
89 |
| -You can extend or modify this rules in your project as is described on the documentation of eslint, the same way as you will do when extending eslint recommended rules. |
90 |
| - |
91 |
| -``` |
92 |
| -{ |
93 |
| - "extends":["@xt-pagesource/stylelint-config-react"], |
94 |
| -
|
95 |
| - rules:{ |
96 |
| - your rules here |
97 |
| - } |
98 |
| -
|
99 |
| -} |
100 |
| -``` |
101 |
| - |
102 |
| -### Usage |
103 |
| - |
104 |
| -Like you will do normally with stylelint, this package is a wrapper. - For just linting and to see the report, run: |
105 |
| - |
106 |
| -``` |
107 |
| -stylelint path/to/folder |
108 |
| -``` |
109 |
| - |
110 |
| -For linting and autofix the problems, run: |
111 |
| - |
112 |
| -``` |
113 |
| -stylelint --fix path/to/folder |
114 |
| -``` |
115 |
| - |
116 |
| -Recommended |
117 |
| -Add in your package.json at the scripts section the two following scripts: |
118 |
| - |
119 |
| -``` |
120 |
| -{ |
121 |
| - "scripts": { |
122 |
| -
|
123 |
| - "lint:css": "stylelint path/to/folder", |
124 |
| - } |
125 |
| -} |
126 |
| -``` |
| 10 | + |
0 commit comments