@nethru/ui 2.1.41 → 2.1.42
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/base/editor/Editor.js +3 -2
- package/package.json +1 -1
package/base/editor/Editor.js
CHANGED
|
@@ -46,7 +46,7 @@ export default function Editor({
|
|
|
46
46
|
const highlight = useMemo(() => makeHighlight(), []);
|
|
47
47
|
// eslint-disable-next-line
|
|
48
48
|
const styles = useMemo(() => makeStyle(restrictWidth, ref.current), [restrictWidth, ref.current]);
|
|
49
|
-
const eslintLinter = useMemo(() => makeEslinter(format, eslintRules, onEslintUpdate, customVariables), [format, eslintRules, onEslintUpdate, customVariables]);
|
|
49
|
+
const eslintLinter = useMemo(() => makeEslinter(format, eslintRules, onEslintUpdate, customVariables, readOnly), [format, eslintRules, onEslintUpdate, customVariables, readOnly]);
|
|
50
50
|
const languageExtension = useMemo(() => getLanguageExtension(format), [format]);
|
|
51
51
|
const keymapExtension = useMemo(() => getKeymapExtension(keymap), [keymap]);
|
|
52
52
|
const extensionList = useMemo(() => makeExtensions(languageExtension, eslintLinter, highlight.extension, keymapExtension, extensions, onScroll), [languageExtension, eslintLinter, highlight.extension, keymapExtension, extensions, onScroll]);
|
|
@@ -209,7 +209,8 @@ function makeHighlight() {
|
|
|
209
209
|
extension: extension
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function makeEslinter(format, eslintRules, onEslintUpdate, customVariables) {
|
|
212
|
+
function makeEslinter(format, eslintRules, onEslintUpdate, customVariables, readOnly) {
|
|
213
|
+
if (readOnly) return;
|
|
213
214
|
const regex = /\{\{([^}]+)\}\}/g;
|
|
214
215
|
if (format === 'javascript') {
|
|
215
216
|
return linter(view => {
|