From 316ac023ff91fafca94cddfb59f4d0bce98612cf Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 9 Sep 2024 12:58:56 +0800 Subject: chore: Improve eslint --- eslint.config.js | 2 +- src/dumbymap.mjs | 1 + src/editor.mjs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index b2a1c54..ac88ddf 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -21,7 +21,7 @@ export default [ node: nodePlugin, }, rules: { - 'no-unused-vars': ['error', { 'varsIgnorePattern': '^_' }], + 'no-unused-vars': ['warn', { 'varsIgnorePattern': '^_' }], 'import/no-unresolved': 'error', 'no-console': ["error", { allow: ["info", "warn", "error"] }], 'eqeqeq': ['error', 'always'], diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 6095f9c..a6029a5 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs @@ -240,6 +240,7 @@ export const generateMaps = async (container) => { Object.assign(result, { markers: markersFromLinks }) return result }) + /* eslint-disable no-unused-vars */ } catch (_) { console.warn('Fail to parse yaml config for element', target) } diff --git a/src/editor.mjs b/src/editor.mjs index f1c90ed..04b4125 100644 --- a/src/editor.mjs +++ b/src/editor.mjs @@ -215,7 +215,7 @@ const getSuggestionsFromAliases = (option) => Object.entries(aliasesForMapOption // }}} const handleTypingInCodeBlock = (currentLine, selection) => { const text = currentLine.textContent - if (text.match(/^\s\+$/) && text.length % 2 != 0) { + if (text.match(/^\s\+$/) && text.length % 2 !== 0) { // TODO Completion for even number of spaces } else if (text.match(/^-/)){ // TODO Completion for YAML doc separator -- cgit v1.2.3-70-g09d2