Skip to content

add .ts extension for import statements #1746

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

Merged
merged 2 commits into from
Aug 7, 2024
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
7 changes: 6 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"ignore": ["./out", "./coverage"]
},
"linter": {
"enabled": true
"enabled": true,
"rules": {
"nursery": {
"useImportExtensions": "error"
}
}
},
"formatter": {
"enabled": true
Expand Down
2 changes: 1 addition & 1 deletion src/block/CodeBlock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Row } from "./Row";
import type { Row } from "./Row.ts";

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

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

export interface LinePack {
type: "line";
Expand Down
12 changes: 6 additions & 6 deletions src/block/Pack.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ParserOption } from "../parse";
import type { CodeBlockPack } from "./CodeBlock";
import type { LinePack } from "./Line";
import type { Row } from "./Row";
import type { TablePack } from "./Table";
import type { TitlePack } from "./Title";
import type { ParserOption } from "../parse.ts";
import type { CodeBlockPack } from "./CodeBlock.ts";
import type { LinePack } from "./Line.ts";
import type { Row } from "./Row.ts";
import type { TablePack } from "./Table.ts";
import type { TitlePack } from "./Title.ts";

export type Pack = TitlePack | CodeBlockPack | TablePack | LinePack;

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

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

export interface TablePack {
type: "table";
Expand Down
2 changes: 1 addition & 1 deletion src/block/Title.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Row } from "./Row";
import type { Row } from "./Row.ts";

export interface TitlePack {
type: "title";
Expand Down
18 changes: 9 additions & 9 deletions src/block/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { convertToCodeBlock } from "./CodeBlock";
import { convertToLine } from "./Line";
import { convertToTable } from "./Table";
import { convertToTitle } from "./Title";
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";
import type { Line } from "./Line";
import type { Pack } from "./Pack";
import type { Table } from "./Table";
import type { Title } from "./Title";
import type { CodeBlock } from "./CodeBlock.ts";
import type { Line } from "./Line.ts";
import type { Pack } from "./Pack.ts";
import type { Table } from "./Table.ts";
import type { Title } from "./Title.ts";

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

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

const blankRegExp = /\[\s+\]/;

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

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

const codeRegExp = /`.*?`/;

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

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

const commandLineRegExp = /^[$%] .+$/;

Expand Down
12 changes: 6 additions & 6 deletions src/block/node/DecorationNode.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createPlainNode } from "./PlainNode";
import { createNodeParser } from "./creator";
import { convertToNodes } from "./index";
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";
import { convertToNodes } from "./index.ts";

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

const decorationRegExp = /\[[!"#%&'()*+,\-./{|}<>_~]+ (?:\[[^[\]]+\]|[^\]])+\]/;

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

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

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

import type { NodeCreator } from "./creator";
import type { FormulaNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { FormulaNode, PlainNode } from "./type.ts";

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

import type { NodeCreator } from "./creator";
import type { GoogleMapNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { GoogleMapNode, PlainNode } from "./type.ts";

const placeFirstGoogleMapRegExp =
/\[([^\]]*[^\s])\s+([NS]\d+(?:\.\d+)?,[EW]\d+(?:\.\d+)?(?:,Z\d+)?)\]/;
Expand Down
8 changes: 4 additions & 4 deletions src/block/node/HashTagNode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createPlainNode } from "./PlainNode";
import { createNodeParser } from "./creator";
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";

import type { NodeCreator } from "./creator";
import type { HashTagNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { HashTagNode, PlainNode } from "./type.ts";

const hashTagRegExp = /(?:^|\s)#\S+/;

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

import type { NodeCreator } from "./creator";
import type { HelpfeelNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { HelpfeelNode, PlainNode } from "./type.ts";

const helpfeelRegExp = /^\? .+$/;

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

import type { NodeCreator } from "./creator";
import type { IconNode, PlainNode, StrongIconNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { IconNode, PlainNode, StrongIconNode } from "./type.ts";

const iconRegExp = /\[[^[\]]*\.icon(?:\*[1-9]\d*)?\]/;

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

import type { NodeCreator } from "./creator";
import type { ImageNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { ImageNode, PlainNode } from "./type.ts";

const srcFirstStrongImageRegExp =
/\[https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)(?:\?[^\]\s]+)?(?:\s+https?:\/\/[^\s\]]+)?\]/i;
Expand Down
6 changes: 3 additions & 3 deletions src/block/node/InternalLinkNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createNodeParser } from "./creator";
import { createNodeParser } from "./creator.ts";

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

const internalLinkRegExp = /\[\/?[^[\]]+\]/;

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

import type { NodeCreator } from "./creator";
import type { NumberListNode, PlainNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { NumberListNode, PlainNode } from "./type.ts";

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

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

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

export const createPlainNode: NodeCreator<PlainNode> = (raw) => [
{
Expand Down
10 changes: 5 additions & 5 deletions src/block/node/QuoteNode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createPlainNode } from "./PlainNode";
import { createNodeParser } from "./creator";
import { convertToNodes } from "./index";
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";
import { convertToNodes } from "./index.ts";

import type { NodeCreator } from "./creator";
import type { PlainNode, QuoteNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { PlainNode, QuoteNode } from "./type.ts";

const quoteRegExp = /^>.*$/;

Expand Down
4 changes: 2 additions & 2 deletions src/block/node/StrongIconNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateIconNodeCreator } from "./IconNode";
import { createNodeParser } from "./creator";
import { generateIconNodeCreator } from "./IconNode.ts";
import { createNodeParser } from "./creator.ts";

const strongIconRegExp = /\[\[[^[\]]*\.icon(?:\*\d+)?\]\]/;

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

import type { NodeCreator } from "./creator";
import type { PlainNode, StrongImageNode } from "./type";
import type { NodeCreator } from "./creator.ts";
import type { PlainNode, StrongImageNode } from "./type.ts";

const strongImageRegExp = /\[\[https?:\/\/[^\s\]]+\.(?:png|jpe?g|gif|svg)\]\]/i;
const strongGyazoImageRegExp =
Expand Down
12 changes: 6 additions & 6 deletions src/block/node/StrongNode.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createPlainNode } from "./PlainNode";
import { createNodeParser } from "./creator";
import { convertToNodes } from "./index";
import { createPlainNode } from "./PlainNode.ts";
import { createNodeParser } from "./creator.ts";
import { convertToNodes } from "./index.ts";

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

const strongRegExp = /\[\[(?:[^[]|\[[^[]).*?\]*\]\]/;

Expand Down
6 changes: 3 additions & 3 deletions src/block/node/creator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { convertToNodes } from "./index";
import { convertToNodes } from "./index.ts";

import type { NodeParser, NodeParserOption } from "./index";
import type { Node } from "./type";
import type { NodeParser, NodeParserOption } from "./index.ts";
import type { Node } from "./type.ts";

export type NodeCreator<T extends Node> = (
target: string,
Expand Down
38 changes: 19 additions & 19 deletions src/block/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { BlankNodeParser } from "./BlankNode";
import { CodeNodeParser } from "./CodeNode";
import { CommandLineNodeParser } from "./CommandLineNode";
import { DecorationNodeParser } from "./DecorationNode";
import { ExternalLinkNodeParser } from "./ExternalLinkNode";
import { FormulaNodeParser } from "./FormulaNode";
import { GoogleMapNodeParser } from "./GoogleMapNode";
import { HashTagNodeParser } from "./HashTagNode";
import { HelpfeelNodeParser } from "./HelpfeelNode";
import { IconNodeParser } from "./IconNode";
import { ImageNodeParser } from "./ImageNode";
import { InternalLinkNodeParser } from "./InternalLinkNode";
import { NumberListNodeParser } from "./NumberListNode";
import { PlainNodeParser } from "./PlainNode";
import { QuoteNodeParser } from "./QuoteNode";
import { StrongIconNodeParser } from "./StrongIconNode";
import { StrongImageNodeParser } from "./StrongImageNode";
import { StrongNodeParser } from "./StrongNode";
import { BlankNodeParser } from "./BlankNode.ts";
import { CodeNodeParser } from "./CodeNode.ts";
import { CommandLineNodeParser } from "./CommandLineNode.ts";
import { DecorationNodeParser } from "./DecorationNode.ts";
import { ExternalLinkNodeParser } from "./ExternalLinkNode.ts";
import { FormulaNodeParser } from "./FormulaNode.ts";
import { GoogleMapNodeParser } from "./GoogleMapNode.ts";
import { HashTagNodeParser } from "./HashTagNode.ts";
import { HelpfeelNodeParser } from "./HelpfeelNode.ts";
import { IconNodeParser } from "./IconNode.ts";
import { ImageNodeParser } from "./ImageNode.ts";
import { InternalLinkNodeParser } from "./InternalLinkNode.ts";
import { NumberListNodeParser } from "./NumberListNode.ts";
import { PlainNodeParser } from "./PlainNode.ts";
import { QuoteNodeParser } from "./QuoteNode.ts";
import { StrongIconNodeParser } from "./StrongIconNode.ts";
import { StrongImageNodeParser } from "./StrongImageNode.ts";
import { StrongNodeParser } from "./StrongNode.ts";

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

export interface NodeParserOption {
nested: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/block/node/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Decoration } from "./DecorationNode";
import type { Decoration } from "./DecorationNode.ts";

interface BaseNode {
raw: string;
Expand Down
Loading
Loading