Skip to content

Commit 80307ec

Browse files
committed
1 parent d6a8d5f commit 80307ec

32 files changed

+960
-438
lines changed

.codecov.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@ ignore:
8888
- src/types/
8989

9090
profiling:
91-
critical_files_paths: []
91+
critical_files_paths:
92+
- src/plugin.ts

.commitlintrc.cts .commitlintrc.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ import { scopes } from '@flex-development/commitlint-config'
1818
const config: UserConfig = {
1919
extends: ['@flex-development'],
2020
rules: {
21-
'scope-enum': [Severity.Error, 'always', scopes([
22-
'attacher',
23-
'grammar',
24-
'lexer',
25-
'parser',
26-
'reader'
27-
])]
21+
'scope-enum': [Severity.Error, 'always', scopes(['plugin'])]
2822
}
2923
}
3024

.dictionary.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cefc
44
codecov
55
commitlintrc
66
dedupe
7+
deno
78
dessant
89
docast
910
dohm
@@ -16,6 +17,7 @@ iife
1617
jchen
1718
jsdoc
1819
kaisugi
20+
lcov
1921
lintstagedrc
2022
mdast
2123
mkbuild

.dprint.jsonc

+2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"**/.temp/",
1111
"**/.vercel/",
1212
"**/__fixtures__/git/**/*.txt",
13+
"**/__tests__/benchmark.json",
1314
"**/__tests__/report.json",
15+
"**/__tests__/typecheck.json",
1416
"**/coverage/",
1517
"**/dist/",
1618
"**/node_modules",

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
**/*config.*.timestamp*
99
**/.DS_Store
1010
**/.temp/
11+
**/__tests__/benchmark.json
1112
**/__tests__/report.*
13+
**/__tests__/typecheck.json
1214
**/coverage/
1315
**/dist/
1416
**/node_modules/

.eslintrc.base.cjs

+73-18
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const fs = require('node:fs')
1616
*/
1717
const config = {
1818
env: {
19-
[require('./tsconfig.build.json').compilerOptions.target]: true,
19+
es2023: true,
2020
node: true
2121
},
2222
extends: [],
@@ -33,15 +33,8 @@ const config = {
3333
},
3434
parser: '@typescript-eslint/parser',
3535
parserOptions: {
36-
ecmaFeatures: {
37-
jsx: true
38-
},
3936
extraFileExtensions: [],
40-
project: [
41-
'**/tsconfig.json',
42-
'./tsconfig.cjs.json'
43-
],
44-
sourceType: require('./package.json').type,
37+
project: ['**/tsconfig.json'],
4538
tsconfigRootDir: process.cwd(),
4639
warnOnUnsupportedTypeScriptVersion: true
4740
},
@@ -630,7 +623,7 @@ const config = {
630623
2,
631624
{
632625
version: require('./package.json').engines?.node ??
633-
'>=' + fs.readFileSync('./.nvmrc', 'utf8')
626+
'>=' + fs.readFileSync('.nvmrc', 'utf8')
634627
}
635628
],
636629
'node/prefer-global/buffer': 2,
@@ -925,6 +918,68 @@ const config = {
925918
'@typescript-eslint/explicit-member-accessibility': 0
926919
}
927920
},
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+
},
928983
{
929984
files: '**/*.+(json|json5|jsonc)',
930985
parser: 'jsonc-eslint-parser',
@@ -981,14 +1036,6 @@ const config = {
9811036
React: false
9821037
},
9831038
parser: 'eslint-mdx',
984-
parserOptions: {
985-
ecmaFeatures: {
986-
impliedStrict: true,
987-
jsx: true
988-
},
989-
ecmaVersion: 'latest',
990-
sourceType: 'module'
991-
},
9921039
plugins: ['markdown', 'markdownlint', 'mdx'],
9931040
processor: 'mdx/remark',
9941041
rules: {
@@ -1257,6 +1304,14 @@ const config = {
12571304
}
12581305
}
12591306
],
1307+
parserOptions: {
1308+
ecmaFeatures: {
1309+
impliedStrict: true,
1310+
jsx: true
1311+
},
1312+
ecmaVersion: 'latest',
1313+
sourceType: require('./package.json').type
1314+
},
12601315
plugins: [],
12611316
reportUnusedDisableDirectives: true,
12621317
rules: {},

.eslintrc.cjs

-31
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,6 @@
1010
*/
1111
const config = {
1212
extends: ['./.eslintrc.base.cjs'],
13-
overrides: [
14-
...require('./.eslintrc.base.cjs').overrides,
15-
{
16-
files: ['__fixtures__/calculate.ts'],
17-
rules: {
18-
'@typescript-eslint/strict-boolean-expressions': 0,
19-
'unicorn/no-unreadable-array-destructuring': 0
20-
}
21-
},
22-
{
23-
files: ['__fixtures__/dbl-linear.ts', '__fixtures__/fibonacci.ts'],
24-
rules: {
25-
'@typescript-eslint/require-await': 0
26-
}
27-
},
28-
{
29-
files: ['src/parser-abstract.ts'],
30-
rules: {
31-
'@typescript-eslint/no-unused-vars': [
32-
2,
33-
{
34-
args: 'none',
35-
caughtErrors: 'all',
36-
ignoreRestSiblings: false,
37-
vars: 'all'
38-
}
39-
],
40-
'@typescript-eslint/no-useless-constructor': 0
41-
}
42-
}
43-
],
4413
root: true
4514
}
4615

.github/dependabot.yml

-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ updates:
4545
patterns:
4646
- '@vitest/*'
4747
- vitest*
48-
ignore:
49-
- dependency-name: unist-util-inspect
5048
labels:
5149
- scope:dependencies
5250
- type:build

.github/infrastructure.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ labels:
6565
- name: flag:needs-refactor
6666
description: code improvements required before being merged
6767
color: fbca04
68-
- name: scope:attacher
69-
description: unified attacher
70-
color: 74cefc
7168
- name: scope:dependencies
7269
description: dependency updates
7370
color: 74cefc
@@ -77,12 +74,12 @@ labels:
7774
- name: scope:install
7875
description: package install
7976
color: 74cefc
80-
- name: scope:parser
81-
description: file parser
82-
color: 74cefc
8377
- name: scope:patches
8478
description: patches
8579
color: 74cefc
80+
- name: scope:plugin
81+
description: unified plugin
82+
color: 74cefc
8683
- name: scope:release
8784
description: package release
8885
color: 74cefc
@@ -174,7 +171,7 @@ repository:
174171
automated_security_fixes: true
175172
default_branch: main
176173
delete_branch_on_merge: true
177-
description: unified compliant file parser for docast
174+
description: unified compliant parser for docast
178175
has_issues: true
179176
has_projects: true
180177
has_wiki: false

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ yarn-error.log*
4545
# Testing
4646
# ------------------------------------------------------------------------------
4747
**/*config.*.timestamp*
48+
**/__tests__/benchmark.json
4849
**/__tests__/report.*
50+
**/__tests__/typecheck.json
4951
**/coverage/
5052
**/tsconfig*temp.json
5153
*.lcov

.lintstagedrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"eslint --exit-on-fatal-error",
55
"cspell lint --color --no-progress --relative $@"
66
],
7-
"**/*.{cts,mts,ts}": "vitest run --changed --typecheck",
7+
"**/*.{cts,mts,ts}": "vitest run --changed --mode=typecheck --typecheck",
88
"**/yarn.lock": "yarn dedupe --check",
99
"src/**/*.ts": [
1010
"vitest run --changed --coverage",

README.md

+22-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![vitest](https://img.shields.io/badge/-vitest-6e9f18?style=flat&logo=vitest&logoColor=ffffff)](https://vitest.dev/)
1111
[![yarn](https://img.shields.io/badge/-yarn-2c8ebb?style=flat&logo=yarn&logoColor=ffffff)](https://yarnpkg.com/)
1212

13-
[**unified**][unified] compliant file parser for [**docast**][docast].
13+
[**unified**][unified] compliant parser for [**docast**][docast].
1414

1515
## Contents
1616

@@ -37,23 +37,34 @@ syntax tree][docast].
3737

3838
This package is [ESM only][esm].
3939

40-
```sh
41-
yarn add @flex-development/docast-parse @flex-development/docast @types/mdast @types/unist
42-
```
43-
44-
From Git:
40+
In Node.js (version 18+) with [yarn][yarn]:
4541

4642
```sh
47-
yarn add @flex-development/docast-parse@flex-development/docast-parse
43+
yarn add @flex-development/docast-parse
44+
yarn add -D @flex-development/docast @types/mdast @types/unist micromark-util-types
4845
```
4946

5047
<blockquote>
5148
<small>
52-
See <a href='https://yarnpkg.com/features/protocols#git'>Git - Protocols | Yarn</a>
53-
&nbsp;for details on requesting a specific branch, commit, or tag.
49+
See <a href='https://yarnpkg.com/protocol/git'>Git - Protocols | Yarn</a>
50+
&nbsp;for details regarding installing from Git.
5451
</small>
5552
</blockquote>
5653

54+
In Deno with [`esm.sh`][esmsh]:
55+
56+
```ts
57+
import docastParse from 'https://esm.sh/@flex-development/docast-parse'
58+
```
59+
60+
In browsers with [`esm.sh`][esmsh]:
61+
62+
```html
63+
<script type="module">
64+
import docastParse from 'https://esm.sh/@flex-development/docast-parse'
65+
</script>
66+
```
67+
5768
## Use
5869

5970
**TODO**: use
@@ -80,5 +91,7 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md).
8091

8192
[docast]: https://github.com/flex-development/docast
8293
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
94+
[esmsh]: https://esm.sh/
8395
[typescript]: https://www.typescriptlang.org
8496
[unified]: https://github.com/unifiedjs/unified
97+
[yarn]: https://yarnpkg.com

__fixtures__/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)