Skip to content

Update Biome to v2.0 beta #1822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
34 changes: 32 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": { "enabled": true },
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"files": {
"ignore": ["./out", "./coverage"]
"includes": ["**", "!out", "!coverage"]
},
"linter": {
"enabled": true,
"rules": {
"style": {
"useLiteralEnumMembers": "error",
"noCommaOperator": "error",
"useNodejsImportProtocol": "error",
"useAsConstAssertion": "error",
"useNumericLiterals": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useConst": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"useExponentiationOperator": "error",
"useTemplate": "error",
"noParameterAssign": "error",
"noNonNullAssertion": "error",
"useDefaultParameterLast": "error",
"noArguments": "error",
"useImportType": "error",
"useExportType": "error",
"noUselessElse": "error",
"useShorthandFunctionType": "error"
},
"correctness": {
"useImportExtensions": "error"
}
Expand Down
73 changes: 36 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "9.2.0",
"type": "module",
"description": "parse Scrapbox notation to JavaScript Object",
"files": ["out"],
"files": [
"out"
],
"main": "./out/index.cjs",
"module": "./out/index.mjs",
"types": "./out/index.d.ts",
Expand Down Expand Up @@ -37,15 +39,18 @@
"type": "git",
"url": "git+https://github.com/progfay/scrapbox-parser.git"
},
"keywords": ["scrapbox", "parser"],
"keywords": [
"scrapbox",
"parser"
],
"author": "progfay",
"license": "MIT",
"bugs": {
"url": "https://github.com/progfay/scrapbox-parser/issues"
},
"homepage": "https://github.com/progfay/scrapbox-parser#readme",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@biomejs/biome": "2.0.0-beta.1",
"npm-run-all2": "7.0.2",
"typescript": "5.8.2",
"vite": "6.2.3"
Expand Down
3 changes: 1 addition & 2 deletions src/block/Line.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { convertToNodes } from "./node/index.ts";

import type { Row } from "./Row.ts";
import type { Node } from "./node/type.ts";
import type { Row } from "./Row.ts";

export interface LinePack {
type: "line";
Expand Down
3 changes: 1 addition & 2 deletions src/block/Table.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { convertToNodes } from "./node/index.ts";

import type { Row } from "./Row.ts";
import type { Node } from "./node/type.ts";
import type { Row } from "./Row.ts";

export interface TablePack {
type: "table";
Expand Down
9 changes: 4 additions & 5 deletions src/block/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { convertToCodeBlock } from "./CodeBlock.ts";
import { convertToLine } from "./Line.ts";
import { convertToTable } from "./Table.ts";
import { convertToTitle } from "./Title.ts";

import type { CodeBlock } from "./CodeBlock.ts";
import { convertToCodeBlock } from "./CodeBlock.ts";
import type { Line } from "./Line.ts";
import { convertToLine } from "./Line.ts";
import type { Pack } from "./Pack.ts";
import type { Table } from "./Table.ts";
import { convertToTable } from "./Table.ts";
import type { Title } from "./Title.ts";
import { convertToTitle } from "./Title.ts";

/**
* Scrapbox block type
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/BlankNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { BlankNode, PlainNode } from "./type.ts";

const blankRegExp = /\[\s+\]/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/CodeNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { CodeNode, PlainNode } from "./type.ts";

const codeRegExp = /`.*?`/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/CommandLineNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { CommandLineNode, PlainNode } from "./type.ts";

const commandLineRegExp = /^[$%] .+$/;
Expand Down
7 changes: 3 additions & 4 deletions src/block/node/DecorationNode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";
import { convertToNodes } from "./index.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { convertToNodes } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { DecorationNode, PlainNode } from "./type.ts";

const decorationRegExp = /\[[!"#%&'()*+,\-./{|}<>_~]+ (?:\[[^[\]]+\]|[^\]])+\]/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/ExternalLinkNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { LinkNode, PlainNode } from "./type.ts";

const hrefFirstUrlRegExp = /\[https?:\/\/[^\s\]]+\s+[^\]]*[^\s]\]/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/FormulaNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { FormulaNode, PlainNode } from "./type.ts";

const formulaWithTailHalfSpaceRegExp = /\[\$ .+? \]/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/GoogleMapNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { GoogleMapNode, PlainNode } from "./type.ts";

const placeFirstGoogleMapRegExp =
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/HashTagNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { HashTagNode, PlainNode } from "./type.ts";

const hashTagRegExp = /(?:^|\s)#\S+/;
Expand Down
5 changes: 2 additions & 3 deletions src/block/node/HelpfeelNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { HelpfeelNode, PlainNode } from "./type.ts";

const helpfeelRegExp = /^\? .+$/;
Expand Down
2 changes: 1 addition & 1 deletion src/block/node/IconNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createNodeParser } from "./creator.ts";
import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import type { IconNode } from "./type.ts";

Expand Down
5 changes: 2 additions & 3 deletions src/block/node/ImageNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { ImageNode, PlainNode } from "./type.ts";

const srcFirstStrongImageRegExp =
Expand Down
3 changes: 1 addition & 2 deletions src/block/node/InternalLinkNode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import type { NodeParser } from "./index.ts";
import type { LinkNode } from "./type.ts";

Expand Down
7 changes: 3 additions & 4 deletions src/block/node/NumberListNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";
import { type NodeParser, convertToNodes } from "./index.ts";

import type { NodeCreator } from "./creator.ts";
import { createNodeParser } from "./creator.ts";
import { convertToNodes, type NodeParser } from "./index.ts";
import { createPlainNode } from "./PlainNode.ts";
import type { NumberListNode, PlainNode } from "./type.ts";

const numberListRegExp = /^[0-9]+\. .*$/;
Expand Down
Loading
Loading