react-codemirror-runmode 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-highlighter.js +2 -1
- package/eslint.config.js +45 -0
- package/package.json +18 -18
- package/src/react-highlighter.tsx +2 -1
- package/tsconfig.json +1 -1
- package/.eslintignore +0 -1
- package/.eslintrc.yml +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect, useState } from 'react';
|
|
3
|
-
import { highlightCode } from './highlight';
|
|
3
|
+
import { highlightCode } from './highlight.js';
|
|
4
4
|
export const Highlighter = memo((props) => {
|
|
5
5
|
const { lang, children: code, theme } = props;
|
|
6
6
|
const [highlightedCode, setHighlightedCode] = useState(null);
|
|
@@ -11,3 +11,4 @@ export const Highlighter = memo((props) => {
|
|
|
11
11
|
}, [lang, code, theme]);
|
|
12
12
|
return _jsx(_Fragment, { children: highlightedCode || code });
|
|
13
13
|
});
|
|
14
|
+
Highlighter.displayName = 'Highlighter';
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import eslintTs from 'typescript-eslint'
|
|
3
|
+
import eslintReact from 'eslint-plugin-react'
|
|
4
|
+
|
|
5
|
+
export default eslintTs.config(
|
|
6
|
+
{ ignores: ['dist'] },
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
eslintTs.configs.recommended,
|
|
9
|
+
eslintReact.configs.flat.recommended,
|
|
10
|
+
eslintReact.configs.flat['jsx-runtime'],
|
|
11
|
+
{
|
|
12
|
+
plugins: {
|
|
13
|
+
'@typescript-eslint': eslintTs.plugin
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
// TypeScript
|
|
17
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
18
|
+
'@typescript-eslint/no-unused-vars': [
|
|
19
|
+
'warn',
|
|
20
|
+
{
|
|
21
|
+
argsIgnorePattern: '^_',
|
|
22
|
+
varsIgnorePattern: '^_',
|
|
23
|
+
caughtErrorsIgnorePattern: '^_'
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
27
|
+
'@typescript-eslint/no-this-alias': 'off',
|
|
28
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
29
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
30
|
+
|
|
31
|
+
// JavaScript and React rules
|
|
32
|
+
'no-useless-escape': 0,
|
|
33
|
+
'prefer-const': 2,
|
|
34
|
+
'no-unused-vars': 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
settings: {
|
|
40
|
+
react: {
|
|
41
|
+
version: '19'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-codemirror-runmode",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Syntax highlighting for react, utilizing CodeMirror's parser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,30 +31,30 @@
|
|
|
31
31
|
"url": "https://github.com/craftzdog/react-codemirror-runmode.git"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@codemirror/language": "^6.
|
|
34
|
+
"@codemirror/language": "^6.11.0",
|
|
35
35
|
"@codemirror/language-data": "^6.5.1",
|
|
36
|
-
"@lezer/common": "^1.2.
|
|
37
|
-
"@lezer/highlight": "^1.2.
|
|
36
|
+
"@lezer/common": "^1.2.3",
|
|
37
|
+
"@lezer/highlight": "^1.2.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">= 18"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
44
|
-
"@testing-library/react": "^
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"@types/react": "^
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"eslint": "^
|
|
51
|
-
"
|
|
52
|
-
"jsdom": "^24.0.0",
|
|
44
|
+
"@testing-library/react": "^16.2.0",
|
|
45
|
+
"@types/node": "^22.13.10",
|
|
46
|
+
"@types/react": "^19.0.12",
|
|
47
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
48
|
+
"eslint": "^9.22.0",
|
|
49
|
+
"eslint-config-prettier": "^10.1.1",
|
|
50
|
+
"eslint-plugin-react": "^7.37.4",
|
|
51
|
+
"jsdom": "^26.0.0",
|
|
53
52
|
"npm-run-all": "^4.1.5",
|
|
54
|
-
"prettier": "^3.
|
|
55
|
-
"react": "^
|
|
56
|
-
"typescript": "^5.
|
|
57
|
-
"
|
|
58
|
-
"
|
|
53
|
+
"prettier": "^3.5.3",
|
|
54
|
+
"react": "^19.0.0",
|
|
55
|
+
"typescript": "^5.8.2",
|
|
56
|
+
"typescript-eslint": "^8.27.0",
|
|
57
|
+
"vite": "^6.2.2",
|
|
58
|
+
"vitest": "^3.0.9"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useEffect, useState } from 'react'
|
|
2
|
-
import { highlightCode } from './highlight'
|
|
2
|
+
import { highlightCode } from './highlight.js'
|
|
3
3
|
import type { Highlighter as LezerHighlighter } from '@lezer/highlight'
|
|
4
4
|
|
|
5
5
|
export type HighlighterProps = {
|
|
@@ -31,3 +31,4 @@ export const Highlighter = memo<HighlighterProps>((props: HighlighterProps) => {
|
|
|
31
31
|
|
|
32
32
|
return <>{highlightedCode || code}</>
|
|
33
33
|
})
|
|
34
|
+
Highlighter.displayName = 'Highlighter'
|
package/tsconfig.json
CHANGED
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist
|
package/.eslintrc.yml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
root: true
|
|
2
|
-
extends:
|
|
3
|
-
- plugin:@typescript-eslint/eslint-recommended
|
|
4
|
-
- plugin:@typescript-eslint/recommended
|
|
5
|
-
- prettier
|
|
6
|
-
parser: '@typescript-eslint/parser'
|
|
7
|
-
parserOptions:
|
|
8
|
-
ecmaVersion: 2022
|
|
9
|
-
sourceType: 'module'
|
|
10
|
-
rules:
|
|
11
|
-
no-useless-escape: 0
|
|
12
|
-
'@typescript-eslint/no-explicit-any': 0
|
|
13
|
-
'@typescript-eslint/no-unused-vars':
|
|
14
|
-
- 2
|
|
15
|
-
- argsIgnorePattern: ^_
|
|
16
|
-
varsIgnorePattern: ^_
|
|
17
|
-
'@typescript-eslint/ban-ts-comment': 0
|
|
18
|
-
'@typescript-eslint/no-this-alias': 0
|
|
19
|
-
'@typescript-eslint/no-var-requires': 0
|