Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ updates:
labels:
- dependencies
groups:
remark:
dependency-type: "development"
patterns:
- "remark*"
types:
dependency-type: "development"
patterns:
Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/dependabot/classify.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ function fixture() {
const manifest = {
name: 'project',
dependencies: { runtime: '^1' },
devDependencies: { 'remark-cli': '^1', typescript: '^1' }
devDependencies: { 'dev-tool': '^1', typescript: '^1' }
};
const lock = { __metadata: { version: 8 } };
function entry(name, dependencies = {}) {
lock[`${name}@npm:^1`] = { version: '1.0.0', resolution: `${name}@npm:1.0.0`, dependencies };
}
lock['project@workspace:.'] = {
resolution: 'project@workspace:.',
dependencies: { runtime: 'npm:^1', 'remark-cli': 'npm:^1', typescript: 'npm:^1' }
dependencies: { runtime: 'npm:^1', 'dev-tool': 'npm:^1', typescript: 'npm:^1' }
};
entry('runtime', { shared: 'npm:^1' });
entry('shared');
entry('remark-cli', { socks: 'npm:^1', shared: 'npm:^1' });
entry('dev-tool', { socks: 'npm:^1', shared: 'npm:^1' });
entry('socks', { 'ip-address': 'npm:^1' });
entry('ip-address');
entry('typescript');
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ jobs:
- name: Test dependency label assignment
run: node --test .github/scripts/dependabot/classify.test.cjs

- name: Check code style (formatting, imports, and lint)
run: yarn run lint:ts

- name: Lint Markdown
run: yarn run lint:md
- name: Check code and Markdown (formatting, imports, and lint)
run: yarn run lint

- name: Build with source maps
run: yarn run build:dev
Expand Down
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Contributing

## Code style
## Code and documentation style

Biome defines code style in `biome.jsonc`, and CI enforces it.
Biome defines code and Markdown style in `biome.jsonc`, and CI enforces it.
Run `yarn fix` to apply formatting, organize imports, and apply safe lint fixes.
Run `yarn lint:ts` to check the result. Some lint errors require manual changes.
Run `yarn lint` to check the result. Some lint errors require manual changes.
The `lint:ts` and `lint:ts:fix` scripts remain compatibility aliases for these commands.

Markdown uses GitHub Flavored Markdown, preserves prose wrapping, and formats
supported fenced code blocks. Documents should have one top-level heading;
the README may place project badges before it. Embedded examples are formatted,
but not linted as standalone source files.

Biome does not replace Remark's checks for undefined, duplicate, or unused link
reference definitions. Review those references and rendered Markdown manually.

## Development

Run `yarn build` to compile the library and tests, `yarn test` to run the test suite,
and `yarn lint:md` to check Markdown.
and `yarn lint` to check code and Markdown.

PR descriptions should state which issue is resolved. Leave test validation details to CI.
24 changes: 24 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
"lineWidth": 120,
"lineEnding": "lf"
},
"markdown": {
"formatter": {
"enabled": true,
"proseWrap": "preserve"
},
"linter": {
"enabled": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
Expand All @@ -32,6 +41,10 @@
"noUnusedVariables": "error"
},
"preset": "recommended",
"nursery": {
"useSingleTopLevelHeading": "error",
"useTopLevelHeading": "error"
},
"complexity": {
"noForEach": "off"
},
Expand Down Expand Up @@ -80,6 +93,17 @@
"includes": ["**", "!**/*.d.ts"]
},
"overrides": [
{
// The README intentionally starts with project badges.
"includes": ["README.md"],
"linter": {
"rules": {
"nursery": {
"useTopLevelHeading": "off"
}
}
}
},
{
"includes": ["test/**/*", ".github/scripts/**/*", "lib/index.ts", "lib/FileTokenizer.ts"],
"linter": {
Expand Down
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@
"build": "yarn run clean && yarn run compile",
"build:dev": "yarn run clean && yarn run compile-test && yarn run compile-src:dev && yarn run test:types",
"prepublishOnly": "yarn run build",
"eslint": "eslint lib test",
"lint:md": "remark -u preset-lint-recommended .",
"lint:ts": "biome check",
"lint": "yarn run lint:md && yarn run lint:ts",
"fix": "yarn run lint:ts:fix",
"lint:ts": "yarn run lint",
"lint": "biome check",
"fix": "biome check --write",
"test": "mocha",
"test:types": "tsc -p test/types && tsc -p test/types/tsconfig.browser.json",
"bun:test": "bun run --bun test",
"test-coverage": "c8 yarn run test",
"start": "yarn run compile && yarn run lint && yarn run cover-test",
"update-biome": "yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write",
"lint:ts:fix": "biome check --write",
"lint:ts:fix": "yarn run fix",
"deps:refresh": "yarn up -R '**' && yarn dedupe"
},
"engines": {
Expand Down Expand Up @@ -73,8 +71,6 @@
"del-cli": "^8.0.1",
"mocha": "^11.8.0",
"node-readable-to-web-readable-stream": "^0.4.2",
"remark-cli": "^12.0.1",
"remark-preset-lint-recommended": "^7.0.1",
"token-types": "^6.2.0",
"tsx": "^4.23.15",
"typescript": "^7.0.2",
Expand Down
Loading
Loading