Skip to content

Commit 700ddfd

Browse files
authored
chore(deps): update dependency @biomejs/biome to v2 (#887)
* chore(deps): update dependency @biomejs/biome to v2 * chore(format): package.json and biome.json * chore(format): biome.json
1 parent 4de6211 commit 700ddfd

File tree

19 files changed

+133
-114
lines changed

19 files changed

+133
-114
lines changed

biome.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3-
"organizeImports": {
4-
"enabled": false
2+
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
3+
"assist": {
4+
"actions": {
5+
"source": {
6+
"organizeImports": "on"
7+
}
8+
}
59
},
610
"linter": {
711
"enabled": true,
@@ -19,7 +23,16 @@
1923
"enabled": true
2024
},
2125
"files": {
22-
"ignore": ["node_modules/", "coverage/", "dist/"]
26+
"includes": [
27+
"src/**",
28+
"examples/**",
29+
"dangerfile.ts",
30+
"biome.json",
31+
"package.json",
32+
"renovate.json",
33+
"tsconfig.json",
34+
"babel.config.js"
35+
]
2336
},
2437
"javascript": {
2538
"jsxRuntime": "reactClassic"

examples/react-native-marked-sample/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React, { type ReactNode } from "react";
22
import {
33
SafeAreaView,
4-
StyleSheet,
54
StatusBar,
6-
useColorScheme,
5+
StyleSheet,
76
Text,
87
type TextStyle,
8+
useColorScheme,
99
} from "react-native";
1010
import Markdown, {
11-
Renderer,
1211
MarkedTokenizer,
12+
Renderer,
1313
type RendererInterface,
1414
type Tokens,
1515
} from "react-native-marked";
1616
import { MD_STRING } from "./const";
1717

1818
class CustomTokenizer extends MarkedTokenizer {
1919
codespan(this: MarkedTokenizer, src: string): Tokens.Codespan | undefined {
20-
const match = src.match(/^\$+([^\$\n]+?)\$+/);
20+
const match = src.match(/^\$+([^$\n]+?)\$+/);
2121
if (match?.[1]) {
2222
return {
2323
type: "codespan",

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
"test:updateSnapshot": "jest --updateSnapshot",
3636
"reassure": "reassure"
3737
},
38-
"keywords": ["react-native", "markdown", "react-native markdown"],
38+
"keywords": [
39+
"react-native",
40+
"markdown",
41+
"react-native markdown"
42+
],
3943
"repository": "https://github.com/gmsgowtham/react-native-marked",
4044
"author": "Gowtham G <webappsbygowtham@gmail.com> (https://github.com/gmsgowtham)",
4145
"license": "MIT",
@@ -50,7 +54,7 @@
5054
"@babel/core": "7.27.4",
5155
"@babel/helper-explode-assignable-expression": "7.18.6",
5256
"@babel/preset-env": "7.27.2",
53-
"@biomejs/biome": "1.9.4",
57+
"@biomejs/biome": "2.0.5",
5458
"@commitlint/config-conventional": "19.8.1",
5559
"@evilmartians/lefthook": "1.11.14",
5660
"@react-native/babel-preset": "0.78.2",
@@ -93,7 +97,9 @@
9397
]
9498
},
9599
"commitlint": {
96-
"extends": ["@commitlint/config-conventional"],
100+
"extends": [
101+
"@commitlint/config-conventional"
102+
],
97103
"rules": {
98104
"type-enum": [
99105
2,

src/components/MDImage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import React, {
66
} from "react";
77
import {
88
ActivityIndicator,
9-
ImageBackground,
109
Image,
10+
ImageBackground,
1111
type ImageStyle,
1212
} from "react-native";
1313

@@ -34,10 +34,6 @@ const MDImage: FunctionComponent<MDImageProps> = ({
3434
aspectRatio: undefined,
3535
});
3636

37-
useEffect(() => {
38-
fetchOriginalSizeFromRemoteImage();
39-
}, []);
40-
4137
/**
4238
* Fetches image dimension
4339
* Sets aspect ratio if resolved
@@ -63,6 +59,10 @@ const MDImage: FunctionComponent<MDImageProps> = ({
6359
);
6460
};
6561

62+
useEffect(() => {
63+
fetchOriginalSizeFromRemoteImage();
64+
});
65+
6666
return (
6767
<ImageBackground
6868
source={{ uri: uri }}

src/components/MDSvg.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, {
2-
memo,
32
type FunctionComponent,
3+
memo,
44
useEffect,
5-
useState,
65
useRef,
6+
useState,
77
} from "react";
8-
import { ActivityIndicator, View, type LayoutChangeEvent } from "react-native";
8+
import { ActivityIndicator, type LayoutChangeEvent, View } from "react-native";
99
import { SvgFromXml } from "react-native-svg";
1010
import { getSvgDimensions } from "./../utils/svg";
1111

@@ -55,7 +55,7 @@ const MDSvg: FunctionComponent<MDSvgProps> = ({ uri, alt = "image" }) => {
5555
error: false,
5656
aspectRatio: width / height,
5757
});
58-
} catch (e) {
58+
} catch (_e) {
5959
setSvgState((state) => ({
6060
...state,
6161
error: true,

src/components/MDTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { memo, type FunctionComponent, type ReactNode } from "react";
2-
import { View, ScrollView, type ViewStyle } from "react-native";
3-
import { Table, TableWrapper, Cell } from "react-native-reanimated-table";
1+
import React, { type FunctionComponent, memo, type ReactNode } from "react";
2+
import { ScrollView, View, type ViewStyle } from "react-native";
3+
import { Cell, Table, TableWrapper } from "react-native-reanimated-table";
44

55
type MDTableProps = {
66
header: ReactNode[][];

src/hooks/useMarkdown.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { useMemo, type ReactNode } from "react";
21
import { lexer, type Tokenizer } from "marked";
3-
import type { MarkedStyles, UserTheme } from "./../theme/types";
2+
import { type ReactNode, useMemo } from "react";
3+
import type { ColorSchemeName } from "react-native";
44
import Parser from "../lib/Parser";
55
import Renderer from "../lib/Renderer";
6-
import getStyles from "./../theme/styles";
7-
import type { ColorSchemeName } from "react-native";
86
import type { RendererInterface } from "../lib/types";
7+
import getStyles from "./../theme/styles";
8+
import type { MarkedStyles, UserTheme } from "./../theme/types";
99

1010
export interface useMarkdownHookOptions {
1111
colorScheme?: ColorSchemeName;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Tokenizer as MarkedTokenizer, marked } from "marked";
21
import type { Token, Tokens } from "marked";
2+
import { Tokenizer as MarkedTokenizer, marked } from "marked";
3+
import useMarkdown, { type useMarkdownHookOptions } from "./hooks/useMarkdown";
34
import Markdown from "./lib/Markdown";
45
import Renderer from "./lib/Renderer";
5-
import useMarkdown, { type useMarkdownHookOptions } from "./hooks/useMarkdown";
66
import type {
77
MarkdownProps,
88
ParserOptions,

src/lib/Markdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { useCallback, type ReactElement, type ReactNode } from "react";
1+
import React, { type ReactElement, type ReactNode, useCallback } from "react";
22
import { FlatList, useColorScheme } from "react-native";
3-
import type { MarkdownProps } from "./types";
43
import useMarkdown from "../hooks/useMarkdown";
4+
import type { MarkdownProps } from "./types";
55

66
const Markdown = ({
77
value,

src/lib/Parser.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { ReactNode } from "react";
2-
import type { TextStyle, ViewStyle, ImageStyle } from "react-native";
3-
import type { Token, Tokens } from "marked";
41
import { decode } from "html-entities";
2+
import type { Token, Tokens } from "marked";
3+
import type { ReactNode } from "react";
4+
import type { ImageStyle, TextStyle, ViewStyle } from "react-native";
55
import type { MarkedStyles } from "../theme/types";
6-
import type { RendererInterface, ParserOptions } from "./types";
7-
import { getValidURL } from "./../utils/url";
86
import { getTableColAlignmentStyle } from "./../utils/table";
7+
import { getValidURL } from "./../utils/url";
8+
import type { ParserOptions, RendererInterface } from "./types";
99

1010
class Parser {
1111
private renderer: RendererInterface;

0 commit comments

Comments
 (0)