Skip to content

Commit 36cf8f3

Browse files
committed
docs: browser install
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 6c402a9 commit 36cf8f3

File tree

4 files changed

+173
-12
lines changed

4 files changed

+173
-12
lines changed

.eslintrc.base.cjs

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ const config = {
3333
},
3434
parser: '@typescript-eslint/parser',
3535
parserOptions: {
36-
ecmaFeatures: {
37-
jsx: true
38-
},
3936
extraFileExtensions: [],
4037
project: ['**/tsconfig.json'],
41-
sourceType: require('./package.json').type,
4238
tsconfigRootDir: process.cwd(),
4339
warnOnUnsupportedTypeScriptVersion: true
4440
},
@@ -922,6 +918,68 @@ const config = {
922918
'@typescript-eslint/explicit-member-accessibility': 0
923919
}
924920
},
921+
{
922+
files: ['**/*.html'],
923+
parser: '@html-eslint/parser',
924+
plugins: ['@html-eslint', 'html'],
925+
rules: {
926+
'@html-eslint/element-newline': 2,
927+
'@html-eslint/id-naming-convention': 2,
928+
'@html-eslint/indent': [2, 2],
929+
'@html-eslint/lowercase': 2,
930+
'@html-eslint/no-abstract-roles': 2,
931+
'@html-eslint/no-accesskey-attrs': 2,
932+
'@html-eslint/no-aria-hidden-body': 2,
933+
'@html-eslint/no-duplicate-attrs': 2,
934+
'@html-eslint/no-duplicate-id': 2,
935+
'@html-eslint/no-extra-spacing-attrs': 2,
936+
'@html-eslint/no-inline-styles': 2,
937+
'@html-eslint/no-multiple-empty-lines': 2,
938+
'@html-eslint/no-multiple-h1': 2,
939+
'@html-eslint/no-non-scalable-viewport': 2,
940+
'@html-eslint/no-obsolete-tags': 2,
941+
'@html-eslint/no-positive-tabindex': 2,
942+
'@html-eslint/no-restricted-attr-values': [
943+
2,
944+
{
945+
attrPatterns: [],
946+
attrValuePatterns: []
947+
}
948+
],
949+
'@html-eslint/no-restricted-attrs': [
950+
2,
951+
{
952+
attrPatterns: [],
953+
tagPatterns: []
954+
}
955+
],
956+
'@html-eslint/no-script-style-type': 2,
957+
'@html-eslint/no-skip-heading-levels': 2,
958+
'@html-eslint/no-target-blank': 2,
959+
'@html-eslint/no-trailing-spaces': 2,
960+
'@html-eslint/quotes': 2,
961+
'@html-eslint/require-attrs': [2],
962+
'@html-eslint/require-button-type': 2,
963+
'@html-eslint/require-closing-tags': [2, { selfClosing: 'always' }],
964+
'@html-eslint/require-doctype': 2,
965+
'@html-eslint/require-frame-title': 2,
966+
'@html-eslint/require-img-alt': 2,
967+
'@html-eslint/require-lang': 2,
968+
'@html-eslint/require-li-container': 2,
969+
'@html-eslint/require-meta-charset': 2,
970+
'@html-eslint/require-meta-description': 2,
971+
'@html-eslint/require-meta-viewport': 2,
972+
'@html-eslint/require-open-graph-protocol': 0,
973+
'@html-eslint/require-title': 2,
974+
'@html-eslint/sort-attrs': 2
975+
},
976+
settings: {
977+
html: {
978+
extensions: ['.html'],
979+
indent: '+2'
980+
}
981+
}
982+
},
925983
{
926984
files: '**/*.+(json|json5|jsonc)',
927985
parser: 'jsonc-eslint-parser',
@@ -978,14 +1036,6 @@ const config = {
9781036
React: false
9791037
},
9801038
parser: 'eslint-mdx',
981-
parserOptions: {
982-
ecmaFeatures: {
983-
impliedStrict: true,
984-
jsx: true
985-
},
986-
ecmaVersion: 'latest',
987-
sourceType: 'module'
988-
},
9891039
plugins: ['markdown', 'markdownlint', 'mdx'],
9901040
processor: 'mdx/remark',
9911041
rules: {
@@ -1254,6 +1304,14 @@ const config = {
12541304
}
12551305
}
12561306
],
1307+
parserOptions: {
1308+
ecmaFeatures: {
1309+
impliedStrict: true,
1310+
jsx: true
1311+
},
1312+
ecmaVersion: 'latest',
1313+
sourceType: require('./package.json').type
1314+
},
12571315
plugins: [],
12581316
reportUnusedDisableDirectives: true,
12591317
rules: {},

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ In Deno with [`esm.sh`][esmsh]:
6969
import { fromDocs } from 'https://esm.sh/@flex-development/docast-util-from-docs'
7070
```
7171

72+
In browsers with [`esm.sh`][esmsh]:
73+
74+
```html
75+
<script type="module">
76+
import { fromDocs } from 'https://esm.sh/@flex-development/docast-util-from-docs'
77+
</script>
78+
```
79+
7280
## Use
7381

7482
Say we have the following TypeScript file `fibonacci-sequence.ts`:

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
"@flex-development/mkbuild": "1.0.0-alpha.23",
102102
"@flex-development/mlly": "1.0.0-alpha.18",
103103
"@flex-development/pathe": "2.0.0",
104+
"@html-eslint/eslint-plugin": "0.23.1",
105+
"@html-eslint/parser": "0.23.0",
104106
"@types/chai": "4.3.11",
105107
"@types/chai-string": "1.4.5",
106108
"@types/eslint": "8.56.2",
@@ -125,6 +127,7 @@
125127
"eslint-import-resolver-typescript": "3.6.1",
126128
"eslint-mdx": "3.1.5",
127129
"eslint-plugin-chai-expect": "3.0.0",
130+
"eslint-plugin-html": "8.0.0",
128131
"eslint-plugin-import": "2.29.1",
129132
"eslint-plugin-jest-formatting": "3.1.0",
130133
"eslint-plugin-jsdoc": "48.1.0",

yarn.lock

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,8 @@ __metadata:
14241424
"@flex-development/mlly": "npm:1.0.0-alpha.18"
14251425
"@flex-development/pathe": "npm:2.0.0"
14261426
"@flex-development/tutils": "npm:6.0.0-alpha.25"
1427+
"@html-eslint/eslint-plugin": "npm:0.23.1"
1428+
"@html-eslint/parser": "npm:0.23.0"
14271429
"@types/chai": "npm:4.3.11"
14281430
"@types/chai-string": "npm:1.4.5"
14291431
"@types/eslint": "npm:8.56.2"
@@ -1449,6 +1451,7 @@ __metadata:
14491451
eslint-import-resolver-typescript: "npm:3.6.1"
14501452
eslint-mdx: "npm:3.1.5"
14511453
eslint-plugin-chai-expect: "npm:3.0.0"
1454+
eslint-plugin-html: "npm:8.0.0"
14521455
eslint-plugin-import: "npm:2.29.1"
14531456
eslint-plugin-jest-formatting: "npm:3.1.0"
14541457
eslint-plugin-jsdoc: "npm:48.1.0"
@@ -1892,6 +1895,22 @@ __metadata:
18921895
languageName: node
18931896
linkType: hard
18941897

1898+
"@html-eslint/eslint-plugin@npm:0.23.1":
1899+
version: 0.23.1
1900+
resolution: "@html-eslint/eslint-plugin@npm:0.23.1"
1901+
checksum: 10/f4a0e93914021da9982286b9b17fdd8fcf749d5bbda51c4d6cf425455c4bbf3fa927c607f278c4e45c83b3ff3d7db3ca559f17fe5834ccd70463202cb9ddfec4
1902+
languageName: node
1903+
linkType: hard
1904+
1905+
"@html-eslint/parser@npm:0.23.0":
1906+
version: 0.23.0
1907+
resolution: "@html-eslint/parser@npm:0.23.0"
1908+
dependencies:
1909+
es-html-parser: "npm:^0.0.9"
1910+
checksum: 10/063fed4d807b83e572c8e3ffca6e65fa1746d49e965e11dae083411fd5d10e57d45eeedb7d2d7bb3ae306c4d31475c24cc967a67150357a6c4239500a7b7c666
1911+
languageName: node
1912+
linkType: hard
1913+
18951914
"@humanwhocodes/config-array@npm:^0.11.13":
18961915
version: 0.11.14
18971916
resolution: "@humanwhocodes/config-array@npm:0.11.14"
@@ -4116,6 +4135,44 @@ __metadata:
41164135
languageName: node
41174136
linkType: hard
41184137

4138+
"dom-serializer@npm:^2.0.0":
4139+
version: 2.0.0
4140+
resolution: "dom-serializer@npm:2.0.0"
4141+
dependencies:
4142+
domelementtype: "npm:^2.3.0"
4143+
domhandler: "npm:^5.0.2"
4144+
entities: "npm:^4.2.0"
4145+
checksum: 10/e3bf9027a64450bca0a72297ecdc1e3abb7a2912268a9f3f5d33a2e29c1e2c3502c6e9f860fc6625940bfe0cfb57a44953262b9e94df76872fdfb8151097eeb3
4146+
languageName: node
4147+
linkType: hard
4148+
4149+
"domelementtype@npm:^2.3.0":
4150+
version: 2.3.0
4151+
resolution: "domelementtype@npm:2.3.0"
4152+
checksum: 10/ee837a318ff702622f383409d1f5b25dd1024b692ef64d3096ff702e26339f8e345820f29a68bcdcea8cfee3531776b3382651232fbeae95612d6f0a75efb4f6
4153+
languageName: node
4154+
linkType: hard
4155+
4156+
"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3":
4157+
version: 5.0.3
4158+
resolution: "domhandler@npm:5.0.3"
4159+
dependencies:
4160+
domelementtype: "npm:^2.3.0"
4161+
checksum: 10/809b805a50a9c6884a29f38aec0a4e1b4537f40e1c861950ed47d10b049febe6b79ab72adaeeebb3cc8fc1cd33f34e97048a72a9265103426d93efafa78d3e96
4162+
languageName: node
4163+
linkType: hard
4164+
4165+
"domutils@npm:^3.1.0":
4166+
version: 3.1.0
4167+
resolution: "domutils@npm:3.1.0"
4168+
dependencies:
4169+
dom-serializer: "npm:^2.0.0"
4170+
domelementtype: "npm:^2.3.0"
4171+
domhandler: "npm:^5.0.3"
4172+
checksum: 10/9a169a6e57ac4c738269a73ab4caf785114ed70e46254139c1bbc8144ac3102aacb28a6149508395ae34aa5d6a40081f4fa5313855dc8319c6d8359866b6dfea
4173+
languageName: node
4174+
linkType: hard
4175+
41194176
"dot-prop@npm:^5.1.0":
41204177
version: 5.3.0
41214178
resolution: "dot-prop@npm:5.3.0"
@@ -4250,6 +4307,13 @@ __metadata:
42504307
languageName: node
42514308
linkType: hard
42524309

4310+
"entities@npm:^4.2.0, entities@npm:^4.5.0":
4311+
version: 4.5.0
4312+
resolution: "entities@npm:4.5.0"
4313+
checksum: 10/ede2a35c9bce1aeccd055a1b445d41c75a14a2bb1cd22e242f20cf04d236cdcd7f9c859eb83f76885327bfae0c25bf03303665ee1ce3d47c5927b98b0e3e3d48
4314+
languageName: node
4315+
linkType: hard
4316+
42534317
"entities@npm:~3.0.1":
42544318
version: 3.0.1
42554319
resolution: "entities@npm:3.0.1"
@@ -4368,6 +4432,13 @@ __metadata:
43684432
languageName: node
43694433
linkType: hard
43704434

4435+
"es-html-parser@npm:^0.0.9":
4436+
version: 0.0.9
4437+
resolution: "es-html-parser@npm:0.0.9"
4438+
checksum: 10/b22a2a74debb3c64041fd47a449dee09f1b4ea92f122d6098ffd98d2024c120bf3b72ccb6372b8a07038ff0c7b5af7e98293b15ae75adcf3c320d96b0c8a1e40
4439+
languageName: node
4440+
linkType: hard
4441+
43714442
"es-set-tostringtag@npm:^2.0.1":
43724443
version: 2.0.1
43734444
resolution: "es-set-tostringtag@npm:2.0.1"
@@ -4761,6 +4832,15 @@ __metadata:
47614832
languageName: node
47624833
linkType: hard
47634834

4835+
"eslint-plugin-html@npm:8.0.0":
4836+
version: 8.0.0
4837+
resolution: "eslint-plugin-html@npm:8.0.0"
4838+
dependencies:
4839+
htmlparser2: "npm:^9.1.0"
4840+
checksum: 10/2c613ebb6506fcb42ad4f057223696c2e73cc737501794d7550f82de75e719b0d577b3daae092947cccd3dcfb0c74d0a8d22abd760b579a4e832f37f732c1c58
4841+
languageName: node
4842+
linkType: hard
4843+
47644844
"eslint-plugin-import@npm:2.29.1":
47654845
version: 2.29.1
47664846
resolution: "eslint-plugin-import@npm:2.29.1"
@@ -5822,6 +5902,18 @@ __metadata:
58225902
languageName: node
58235903
linkType: hard
58245904

5905+
"htmlparser2@npm:^9.1.0":
5906+
version: 9.1.0
5907+
resolution: "htmlparser2@npm:9.1.0"
5908+
dependencies:
5909+
domelementtype: "npm:^2.3.0"
5910+
domhandler: "npm:^5.0.3"
5911+
domutils: "npm:^3.1.0"
5912+
entities: "npm:^4.5.0"
5913+
checksum: 10/6352fa2a5495781fa9a02c9049908334cd068ff36d753870d30cd13b841e99c19646717567a2f9e9c44075bbe43d364e102f9d013a731ce962226d63746b794f
5914+
languageName: node
5915+
linkType: hard
5916+
58255917
"http-cache-semantics@npm:^4.1.0":
58265918
version: 4.1.1
58275919
resolution: "http-cache-semantics@npm:4.1.1"

0 commit comments

Comments
 (0)