@entva/styleguide 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +14 -0
- package/LICENSE +21 -0
- package/README.md +88 -0
- package/css/README.md +385 -0
- package/css/packages/stylelint/LICENSE +21 -0
- package/css/packages/stylelint/README.md +27 -0
- package/css/packages/stylelint/eslint.config.js +3 -0
- package/css/packages/stylelint/index.js +84 -0
- package/css/packages/stylelint/package-lock.json +4042 -0
- package/css/packages/stylelint/package.json +42 -0
- package/html/README.md +98 -0
- package/javascript/README.md +3255 -0
- package/javascript/packages/eslint-base/LICENSE +21 -0
- package/javascript/packages/eslint-base/README.md +27 -0
- package/javascript/packages/eslint-base/eslint.config.js +3 -0
- package/javascript/packages/eslint-base/index.js +1084 -0
- package/javascript/packages/eslint-base/package-lock.json +2653 -0
- package/javascript/packages/eslint-base/package.json +36 -0
- package/javascript/packages/eslint-react/LICENSE +21 -0
- package/javascript/packages/eslint-react/README.md +27 -0
- package/javascript/packages/eslint-react/eslint.config.js +3 -0
- package/javascript/packages/eslint-react/index.js +526 -0
- package/javascript/packages/eslint-react/package-lock.json +3035 -0
- package/javascript/packages/eslint-react/package.json +42 -0
- package/package.json +15 -0
- package/react/README.md +726 -0
- package/scripts/for-each-package +12 -0
- package/test/css.js +36 -0
- package/test/index.js +7 -0
- package/test/js.js +35 -0
- package/test/utils.js +63 -0
- package/tooling/packages/biome/LICENSE +21 -0
- package/tooling/packages/biome/README.md +27 -0
- package/tooling/packages/biome/biome.json +1285 -0
- package/tooling/packages/biome/package-lock.json +183 -0
- package/tooling/packages/biome/package.json +38 -0
- package/tsconfig.json +31 -0
- package/typescript/README.md +66 -0
- package/typescript/packages/eslint-typescript-base/LICENSE +21 -0
- package/typescript/packages/eslint-typescript-base/README.md +27 -0
- package/typescript/packages/eslint-typescript-base/eslint.config.js +3 -0
- package/typescript/packages/eslint-typescript-base/index.js +272 -0
- package/typescript/packages/eslint-typescript-base/package-lock.json +3215 -0
- package/typescript/packages/eslint-typescript-base/package.json +41 -0
- package/typescript/packages/eslint-typescript-base/tsconfig.json +30 -0
- package/typescript/packages/eslint-typescript-react/LICENSE +21 -0
- package/typescript/packages/eslint-typescript-react/README.md +27 -0
- package/typescript/packages/eslint-typescript-react/eslint.config.js +3 -0
- package/typescript/packages/eslint-typescript-react/index.js +75 -0
- package/typescript/packages/eslint-typescript-react/package-lock.json +3630 -0
- package/typescript/packages/eslint-typescript-react/package.json +41 -0
- package/typescript/packages/eslint-typescript-react/tsconfig.json +30 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stylelint-config-entva",
|
|
3
|
+
"description": "Shareable entva styleguide config for stylelint",
|
|
4
|
+
"author": "Max Degterev <max@degterev.me>",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"readmeFilename": "README.md",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/entva/styleguide"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/entva/styleguide/issues",
|
|
12
|
+
"version": "2.1.0",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"linter",
|
|
15
|
+
"config",
|
|
16
|
+
"stylelint"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "index.js",
|
|
20
|
+
"files": [
|
|
21
|
+
"index.js"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"reinstall": "rm -rf node_modules package-lock.json && npm install",
|
|
25
|
+
"test": "node ../../../test ./test css",
|
|
26
|
+
"prepublishOnly": "npm test"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"eslint": "^9.16.0",
|
|
30
|
+
"eslint-config-entva-base": "^2.1.0",
|
|
31
|
+
"stylelint": "^16.11.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"stylelint-config-standard": "^36.0.1",
|
|
35
|
+
"stylelint-config-standard-scss": "^14.0.0",
|
|
36
|
+
"stylelint-order": "^6.0.3",
|
|
37
|
+
"stylelint-scss": "^6.10.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"stylelint": "^16.x.x"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/html/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# HTML Style Guide
|
|
2
|
+
|
|
3
|
+
Write your HTML with taste! If you have any doubts, clear them up on this website: [http://html5doctor.com](http://html5doctor.com)
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [General formatting](general-formatting)
|
|
7
|
+
- [Boolean attributes](boolean-attributes)
|
|
8
|
+
- [Lean markup](lean-markup)
|
|
9
|
+
- [Forms](forms)
|
|
10
|
+
- [Tables](tables)
|
|
11
|
+
|
|
12
|
+
## General formatting
|
|
13
|
+
|
|
14
|
+
- Use double quotes for attributes. This is the HTML way.
|
|
15
|
+
- Use semantically appropriate tags
|
|
16
|
+
- Paragraphs of text should always be placed in a `<p>` tag. Never use multiple `<br>` tags.
|
|
17
|
+
- Items in a list should always be in `<ul>`, `<ol>`, or `<dl>`. Never use a set of `<div>` or `<p>`.
|
|
18
|
+
- Every form input that has text attached should utilize a `<label>` tag. Especially radio or checkbox elements.
|
|
19
|
+
- Even though quotes around attributes is optional, always put quotes around attributes for readability.
|
|
20
|
+
- Avoid writing closing tag comments, like `<!-- /.element -->`.
|
|
21
|
+
- Always add trailing slashes in self-closing tags. For example, `<br />`, `<hr />`, `<img />`, and `<input />`.
|
|
22
|
+
- Don't set `tabindex` manually unless specifically requested — rely on the browser to set the order.
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<p class="specialClass">This is my paragraph of special text.</p>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**[⬆ back to top](#table-of-contents)**
|
|
29
|
+
|
|
30
|
+
## Boolean attributes
|
|
31
|
+
|
|
32
|
+
Many attributes don't require a value to be set, like disabled or checked, so don't set it.
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<input type="text" disabled />
|
|
36
|
+
|
|
37
|
+
<input type="checkbox" value="1" checked />
|
|
38
|
+
|
|
39
|
+
<select>
|
|
40
|
+
<option value="1" selected>1</option>
|
|
41
|
+
</select>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**[⬆ back to top](#table-of-contents)**
|
|
45
|
+
|
|
46
|
+
## Lean markup
|
|
47
|
+
|
|
48
|
+
Whenever possible, avoid superfluous parent elements when writing HTML. For example:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
|
|
52
|
+
<!-- Not so great -->
|
|
53
|
+
<span class="avatar">
|
|
54
|
+
<img src="...">
|
|
55
|
+
</span>
|
|
56
|
+
|
|
57
|
+
<!-- Better -->
|
|
58
|
+
<img class="avatar" src="...">
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**[⬆ back to top](#table-of-contents)**
|
|
63
|
+
|
|
64
|
+
## Forms
|
|
65
|
+
|
|
66
|
+
- Wrap radio and checkbox inputs and their text in `<label>`s. No need for `for` attributes here — the wrapping automatically associates the two.
|
|
67
|
+
- The primary form button must come first in the DOM, especially for forms with multiple submit buttons. The visual order should be preserved with float: right; on each button (this affects tabindex).
|
|
68
|
+
|
|
69
|
+
**[⬆ back to top](#table-of-contents)**
|
|
70
|
+
|
|
71
|
+
## Tables
|
|
72
|
+
|
|
73
|
+
Make use of `<thead>`, `<tfoot>`, `<tbody>`, and `<th>` tags (and scope attribute) when appropriate. (Note: `<tfoot>` goes above `<tbody>` for speed reasons. You want the browser to load the footer before a table full of data.)
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<table summary="This is a chart of invoices for 2011.">
|
|
77
|
+
<thead>
|
|
78
|
+
<tr>
|
|
79
|
+
<th scope="col">Table header 1</th>
|
|
80
|
+
<th scope="col">Table header 2</th>
|
|
81
|
+
</tr>
|
|
82
|
+
</thead>
|
|
83
|
+
<tfoot>
|
|
84
|
+
<tr>
|
|
85
|
+
<td>Table footer 1</td>
|
|
86
|
+
<td>Table footer 2</td>
|
|
87
|
+
</tr>
|
|
88
|
+
</tfoot>
|
|
89
|
+
<tbody>
|
|
90
|
+
<tr>
|
|
91
|
+
<td>Table data 1</td>
|
|
92
|
+
<td>Table data 2</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</tbody>
|
|
95
|
+
</table>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**[⬆ back to top](#table-of-contents)**
|