eslint config

This commit is contained in:
zadam 2023-04-09 23:08:24 +02:00
parent fbc79eae62
commit ee60652746
9 changed files with 1216 additions and 6 deletions

16
.eslintrc.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
}
}

View File

@ -1,7 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JSUnfilteredForInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />

6
.idea/jsLinters/eslint.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>

1190
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -99,6 +99,7 @@
"electron-builder": "23.6.0",
"electron-packager": "17.1.1",
"electron-rebuild": "3.2.9",
"eslint": "^8.38.0",
"esm": "3.2.25",
"jasmine": "4.5.0",
"jsdoc": "4.0.1",

View File

@ -74,7 +74,7 @@ function getOptions() {
}
}
resultMap['isPasswordSet'] = !!optionMap['passwordVerificationHash'] ? 'true' : 'false';
resultMap['isPasswordSet'] = optionMap['passwordVerificationHash'] ? 'true' : 'false';
return resultMap;
}

View File

@ -471,7 +471,7 @@ function BackendScriptApi(currentNote, apiParams) {
if (opts.type === 'script' && !opts.scriptNoteId) { throw new Error("scriptNoteId is mandatory for launchers of type 'script'"); }
if (opts.type === 'customWidget' && !opts.widgetNoteId) { throw new Error("widgetNoteId is mandatory for launchers of type 'customWidget'"); }
const parentNoteId = !!opts.isVisible ? '_lbVisibleLaunchers' : '_lbAvailableLaunchers';
const parentNoteId = opts.isVisible ? '_lbVisibleLaunchers' : '_lbAvailableLaunchers';
const noteId = 'al_' + opts.id;
const launcherNote =

View File

@ -125,7 +125,7 @@ function getScriptBundle(note, root = true, scriptEnv = null, includedNoteIds =
}
if (root) {
scriptEnv = !!backendOverrideContent
scriptEnv = backendOverrideContent
? 'backend'
: note.getScriptEnv();
}

View File

@ -5,6 +5,7 @@ function lex(str) {
const fulltextTokens = [];
const expressionTokens = [];
/** @type {boolean|string} */
let quotes = false; // otherwise contains used quote - ', " or `
let fulltextEnded = false;
let currentWord = '';