Change no-undef from off to error
This commit is contained in:
parent
cb6e8d07d0
commit
4629fb3639
@ -23,7 +23,8 @@
|
||||
"no-case-declarations": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-condition": "off",
|
||||
"no-undef": "off",
|
||||
"no-global-assign": "error",
|
||||
"no-undef": "error",
|
||||
"no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}],
|
||||
"no-unused-expressions": "error",
|
||||
"no-var": "error",
|
||||
@ -32,5 +33,37 @@
|
||||
"quotes": ["error", "single", "avoid-escape"],
|
||||
"require-atomic-updates": "off",
|
||||
"semi": "error"
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.js"],
|
||||
"excludedFiles": ["ext/mixed/js/core.js"],
|
||||
"globals": {
|
||||
"yomichan": "readonly",
|
||||
"errorToJson": "readonly",
|
||||
"jsonToError": "readonly",
|
||||
"logError": "readonly",
|
||||
"isObject": "readonly",
|
||||
"hasOwn": "readonly",
|
||||
"toIterable": "readonly",
|
||||
"stringReverse": "readonly",
|
||||
"promiseTimeout": "readonly",
|
||||
"stringReplaceAsync": "readonly",
|
||||
"EventDispatcher": "readonly",
|
||||
"EXTENSION_IS_BROWSER_EDGE": "readonly"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["ext/mixed/js/core.js"],
|
||||
"globals": {
|
||||
"chrome": "writable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["ext/bg/js/settings/*.js"],
|
||||
"env": {
|
||||
"jquery": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global requestJson*/
|
||||
|
||||
/*
|
||||
* AnkiConnect
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsStringEntirelyKana, audioGetFromSources*/
|
||||
|
||||
const audioUrlBuilders = new Map([
|
||||
['jpod101', async (definition) => {
|
||||
|
@ -16,6 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global optionsSave, utilIsolate
|
||||
conditionsTestValue, profileConditionsDescriptor, profileOptionsGetDefaultFieldTemplates
|
||||
handlebarsRenderDynamic, handlebarsRenderStatic
|
||||
requestText, requestJson, optionsLoad
|
||||
dictConfigured, dictTermsSort, dictEnabledSet, dictNoteFormat
|
||||
audioGetUrl, audioInject
|
||||
jpConvertReading, jpDistributeFuriganaInflected, jpKatakanaToHiragana
|
||||
Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema*/
|
||||
|
||||
class Backend {
|
||||
constructor() {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiCommandExec, apiGetEnvironmentInfo, apiOptionsGet*/
|
||||
|
||||
function showExtensionInfo() {
|
||||
const node = document.getElementById('extension-info');
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global dictFieldSplit, dictTagSanitize, JSZip*/
|
||||
|
||||
class Database {
|
||||
constructor() {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global utilSetEqual, utilSetIntersection, apiTemplateRender*/
|
||||
|
||||
function dictEnabledSet(options) {
|
||||
const dictionaries = {};
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsCharCodeKanji, jpDistributeFurigana, Handlebars*/
|
||||
|
||||
function handlebarsEscape(text) {
|
||||
return Handlebars.Utils.escapeExpression(text);
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global wanakana*/
|
||||
|
||||
const JP_HALFWIDTH_KATAKANA_MAPPING = new Map([
|
||||
['ヲ', 'ヲヺ-'],
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global utilStringHashCode*/
|
||||
|
||||
/*
|
||||
* Generic options functions
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGet*/
|
||||
|
||||
async function searchFrontendSetup() {
|
||||
const optionsContext = {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiTermsFind, apiOptionsSet, apiTextParse, apiTextParseMecab, apiTemplateRender, TextScanner*/
|
||||
|
||||
class QueryParser extends TextScanner {
|
||||
constructor(search) {
|
||||
|
@ -16,6 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsStringPartiallyJapanese, apiOptionsSet, apiTermsFind, apiClipboardGet, apiGetEnvironmentInfo
|
||||
Display, QueryParser*/
|
||||
|
||||
class DisplaySearch extends Display {
|
||||
constructor() {
|
||||
super(document.querySelector('#spinner'), document.querySelector('#content'));
|
||||
|
@ -16,6 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
|
||||
profileOptionsGetDefaultFieldTemplates, ankiGetFieldMarkers, ankiGetFieldMarkersHtml, dictFieldFormat
|
||||
apiOptionsGet, apiTermsFind*/
|
||||
|
||||
function onAnkiFieldTemplatesReset(e) {
|
||||
e.preventDefault();
|
||||
|
@ -16,6 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
|
||||
utilBackgroundIsolate, utilAnkiGetDeckNames, utilAnkiGetModelNames, utilAnkiGetModelFieldNames
|
||||
onFormOptionsChanged*/
|
||||
|
||||
// Private
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global toIterable*/
|
||||
|
||||
class AudioSourceUI {
|
||||
static instantiateTemplate(templateSelector) {
|
||||
|
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
|
||||
AudioSourceUI, audioGetTextToSpeechVoice*/
|
||||
|
||||
let audioSourceUI = null;
|
||||
|
||||
|
@ -16,6 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGetFull, apiGetEnvironmentInfo
|
||||
utilBackend, utilIsolate, utilBackgroundIsolate, utilReadFileArrayBuffer
|
||||
optionsGetDefault, optionsUpdateVersion
|
||||
profileOptionsGetDefaultFieldTemplates*/
|
||||
|
||||
// Exporting
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global conditionsNormalizeOptionValue*/
|
||||
|
||||
class ConditionsUI {
|
||||
static instantiateTemplate(templateSelector) {
|
||||
|
@ -16,6 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull
|
||||
utilBackgroundIsolate, utilDatabaseDeleteDictionary, utilDatabaseGetDictionaryInfo, utilDatabaseGetDictionaryCounts
|
||||
utilDatabasePurge, utilDatabaseImport
|
||||
storageUpdateStats, storageEstimate
|
||||
PageExitPrevention*/
|
||||
|
||||
let dictionaryUI = null;
|
||||
|
||||
|
@ -16,6 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, apiOptionsSave
|
||||
utilBackend, utilIsolate, utilBackgroundIsolate
|
||||
ankiErrorShown, ankiFieldsToDict
|
||||
ankiTemplatesUpdateValue, onAnkiOptionsChanged, onDictionaryOptionsChanged
|
||||
appearanceInitialize, audioSettingsInitialize, profileOptionsSetup, dictSettingsInitialize
|
||||
ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize
|
||||
*/
|
||||
|
||||
function getOptionsMutable(optionsContext) {
|
||||
return utilBackend().getOptions(
|
||||
utilBackgroundIsolate(optionsContext)
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGet, Popup, PopupProxyHost, Frontend, TextSourceRange*/
|
||||
|
||||
class SettingsPopupPreview {
|
||||
constructor() {
|
||||
|
@ -16,6 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull
|
||||
utilBackgroundIsolate, formWrite
|
||||
conditionsClearCaches, ConditionsUI, profileConditionsDescriptor*/
|
||||
|
||||
let currentProfileIndex = 0;
|
||||
let profileConditionsContainer = null;
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetEnvironmentInfo*/
|
||||
|
||||
function storageBytesToLabeledString(size) {
|
||||
const base = 1000;
|
||||
|
@ -16,6 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global requestJson
|
||||
dictTermsMergeBySequence, dictTagBuildSource, dictTermsMergeByGloss, dictTermsSort, dictTagsSort
|
||||
dictEnabledSet, dictTermsGroup, dictTermsCompressTags, dictTermsUndupe, dictTagSanitize
|
||||
jpDistributeFurigana, jpConvertHalfWidthKanaToFullWidth, jpConvertNumericTofullWidth
|
||||
jpConvertAlphabeticToKana, jpHiraganaToKatakana, jpKatakanaToHiragana, jpIsCharCodeJapanese
|
||||
Database, Deinflector*/
|
||||
|
||||
class Translator {
|
||||
constructor() {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiAudioGetUrl*/
|
||||
|
||||
class TextToSpeechAudio {
|
||||
constructor(text, voice) {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetDisplayTemplatesHtml*/
|
||||
|
||||
class DisplayGenerator {
|
||||
constructor() {
|
||||
|
@ -16,6 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global docRangeFromPoint, docSentenceExtract
|
||||
apiKanjiFind, apiTermsFind, apiNoteView, apiOptionsGet, apiDefinitionsAddable, apiDefinitionAdd
|
||||
apiScreenshotGet, apiForward
|
||||
audioPrepareTextToSpeech, audioGetFromSources
|
||||
DisplayGenerator, WindowScroll, DisplayContext, DOM*/
|
||||
|
||||
class Display {
|
||||
constructor(spinner, container) {
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global docRangeFromPoint, TextSourceRange, DOM*/
|
||||
|
||||
class TextScanner {
|
||||
constructor(node, ignoreNodes, ignoreElements, ignorePoints) {
|
||||
|
Loading…
Reference in New Issue
Block a user