jslint中常見的錯誤

本章來自轉(zhuǎn)載,轉(zhuǎn)載出自前端工程化指南
(https://www.kancloud.cn/csnikey/fepro-guide/507932)
僅作保存使用泽腮,如有侵犯,請聯(lián)系刪除

常見格式錯誤枚舉

“Missing semicolon.” : “缺少分號.”,
“Use the function form of \”use strict\”.” : “使用標(biāo)準(zhǔn)化定義function.”,
“Unexpected space after ‘-’.” : “在’-'后面不應(yīng)出現(xiàn)空格.”,
“Expected a JSON value.” : “請傳入一個json的值.”,
“Mixed spaces and tabs.”: “空格和TAB重復(fù).”,
“Unsafe character.” : “不安全的字符.”,
“Line too long.”: “本行中的字符超過設(shè)定的最大長度.”,
“Trailing whitespace.”: “本行末尾有過多無用空格.”,
“Script URL.” : “腳本URL.”,
“Unexpected {a} in ‘’.” : “在 ‘签财’ 中不該出現(xiàn) {a}.”,
“Unexpected ‘{a}’.” : “不該在此出現(xiàn)’{a}’.”,
“Strings must use doublequote.” : “字符串需要用雙引號”,
“Unnecessary escapement.” : “不需要轉(zhuǎn)義”,
“Control character in string: {a}.” : “在字符串中出現(xiàn)了Control的字符”,
“Avoid \’.” : “避免 \”,
“Avoid \v.” : “避免 \v”,
“Avoid \x-.” : “避免 \x-”,
“Bad escapement.” : “錯誤的轉(zhuǎn)義字符”,
“Bad number ‘{a}’.” : “錯誤的數(shù)字 ‘{a}’”,
“Missing space after ‘{a}’.” : “在’{a}’之后缺少空格”,
“Don’t use extra leading zeros ‘{a}’.” : “不要再’{a}’的前面用多余的0″,
“Avoid 0x-. ‘{a}’.” : “避免使用 0x-. ‘{a}’.”,
“A trailing decimal point can be confused with a dot ‘{a}’.” : “在’{a}’中使用點尾隨小數(shù)點”,
“Unexpected comment.” : “不該在此處出現(xiàn)注釋”,
“Unescaped ‘{a}’.” : “沒有轉(zhuǎn)義 ‘{a}’”,
“Unexpected control character in regular expression.” : “在正則表達式中出現(xiàn)了control字符”,
“Unexpected escaped character ‘{a}’ in regular expression.” : “在正則表達式中出現(xiàn)了沒有轉(zhuǎn)義的字符 ‘{a}’”,
“Expected ‘{a}’ and instead saw ‘’.” : “應(yīng)該用 ‘{a}’代替’偏塞’”,
“Spaces are hard to count. Use {{a}}.” : “空格難以統(tǒng)計唱蒸,請使用 {{a}}”,
“Insecure ‘{a}’.” : “不安全的 ‘{a}’”,
“Empty class.” : “空的class”,
“Expected a number and instead saw ‘{a}’.”:“應(yīng)該用數(shù)字代替’{a}’”,
“‘{a}’ should not be greater than ‘’.”:“‘{a}’不應(yīng)該比’灸叼’大”,
“‘hasOwnProperty’ is a really bad name.”: “‘hasOwnProperty’是關(guān)鍵字”,
“‘{a}’ was used before it was defined.”:“‘{a}’未定義就已經(jīng)使用了.”,
“‘{a}’ is already defined.”:“‘{a}’被重復(fù)定義”,
“A dot following a number can be confused with a decimal point.”:“數(shù)字后面的一個點會被誤認為是十進制的小數(shù)點”,
“Confusing minusses” : “容易混淆的負數(shù)表達-”,
“Confusing plusses.” : “容易混淆的正數(shù)表達+”,
“Unmatched ‘{a}’.” : “無法匹配的’{a}’”,
“Expected ‘{a}’ to match ‘神汹’ from line {c} and instead saw ‘axfnzq5’.”:“在行{c}中需要用’{a}’和’’匹配古今,用來代替’5xmby2s’”,
“Unexpected early end of program.”:“程序不可預(yù)期的提前終止”,
“A leading decimal point can be confused with a dot: ‘.{a}’.”:“‘{a}’前的點容易混淆成小數(shù)點”,
“Use the array literal notation [].”:“使用數(shù)組的符號 []“,
“Expected an operator and instead saw ‘{a}’.”:“需要用一個符號來代替’{a}’”,
“Unexpected space after ‘{a}’.”:“在’{a}’之后不能出現(xiàn)空格”,
“Unexpected space before ‘{a}’.”:“在’{a}’之前不能出現(xiàn)空格”,
“Bad line breaking before ‘{a}’.”:“在’{a}’之前錯誤的換行”,
“Expected ‘{a}’ to have an indentation at 屁魏 instead at {c}.”:“‘{a}’需要在{c}而不是處縮進”,
“Line breaking error ‘{a}’.”:“換行錯誤 ‘{a}’”,
“Unexpected use of ‘{a}’.”:“此處不能用’{a}’”,
“Bad operand.”:“錯誤的操作數(shù)”,
“Use the isNaN function to compare with NaN.”:“使用isNaN來與NaN比較”,
“Confusing use of ‘{a}’.”:“容易混淆的’{a}’的使用”,
“Read only.”:“只讀的屬性”,
“‘{a}’ is a function.”:“‘{a}’是一個函數(shù)”,
‘Bad assignment.’:“錯誤的賦值”,
“Do not assign to the exception parameter.”:“不要給額外的參數(shù)賦值”,
“Expected an identifier in an assignment and instead saw a function invocation.”:“在賦值的語句中需要有一個標(biāo)識符捉腥,而不是一個方法的調(diào)用”,
“Expected an identifier and instead saw ‘{a}’ (a reserved word).”:“需要有一個標(biāo)識符氓拼,而不是’{a}’(保留字符)”,
“Missing name in function declaration.”:“在方法聲明中缺少名稱”,
“Expected an identifier and instead saw ‘{a}’.”:“需要有一個標(biāo)識符,而不是’{a}’”,
“Inner functions should be listed at the top of the outer function.”:“內(nèi)部函數(shù)的聲明應(yīng)該放在此函數(shù)的頂部抵碟√已”,
“Unreachable ‘{a}’ after ‘’.”:“在’拟逮’之后無法獲取’{a}’”,
“Unnecessary semicolon.”:“不必要的分號”,
“Label ‘{a}’ on 撬统 statement.”:“將’{a}’放在的聲明中”,
“Label ‘{a}’ looks like a javascript url.”:“‘{a}’看上去像一個js的鏈接”,
“Expected an assignment or function call and instead saw an expression”:“需要一個賦值或者一個函數(shù)調(diào)用唱歧,而不是一個表達式.”,
“Do not use ‘new’ for side effects.”:“不要用’new’語句.”,
“Unnecessary \”use strict\”.”:“不必要的\”use strict\”.”,
“Missing \”use strict\” statement.”:“缺少\”use strict\”的聲明”,
“Empty block.”:“空的模塊”,
“Unexpected /*member ‘{a}’.”:“不應(yīng)出現(xiàn) /*元素 ‘{a}’.”,
“‘{a}’ is a statement label.”:“‘{a}’是一個聲明”,
“‘{a}’ used out of scope.”:“‘{a}’使用超出范圍”,
“‘{a}’ is not allowed.”:“不允許使用’{a}’”,
“‘{a}’ is not defined.”:“‘{a}’沒有被定義”,
“Use ‘{a}’ to compare with ‘宪摧’.”:“使用’{a}’與’粒竖’相比”,
“Variables should not be deleted.”:“變量需要被刪除”,
“Use the object literal notation {}.”:“使用對象的文字符號 {}”,
“Do not use {a} as a constructor.”:“不要使用{a}作為一個構(gòu)造對象”,
“The Function constructor is eval.”:“The Function constructor is eval.”,
“A constructor name should start with an uppercase letter.”:“一個構(gòu)造對象的名稱必須用大寫字母開頭.”,
“Bad constructor.”:“錯誤的構(gòu)造對象”,
“Weird construction. Delete ‘new’.”:“構(gòu)造對象有誤颅崩,請刪除’new’”,
“Missing ‘()’ invoking a constructor.”:“缺少括號()”,
“Avoid arguments.{a}.”:“避免參數(shù).{a}.”,
“document.write can be a form of eval.”:“document.write是eval的一種形式”,
‘eval is evil.’:“盡量不要使用eval”,
“Math is not a function.”:“Math不是一個函數(shù)”,
“Missing ‘new’ prefix when invoking a constructor.”:“此處缺少了’new’”,
“Missing radix parameter.”:“缺少參數(shù)”,
“Implied eval is evil. Pass a function instead of a string.”:“傳遞一個函數(shù),而不是一個字符串”,
“Bad invocation.”:“錯誤的調(diào)用”,
“['{a}'] is better written in dot notation.”:“['{a}']最好用點.的方式”,
“Extra comma.”:“多余的逗號”,
“Don’t make functions within a loop.”:“不要用循環(huán)的方式創(chuàng)建函數(shù)”,
“Unexpected parameter ‘{a}’ in get 蕊苗 function.”:“在沿后方法中不該用到參數(shù)’{a}’”,
“Duplicate member ‘{a}’.”:“重復(fù)的’{a}’”,
“Expected to see a statement and instead saw a block.”:“此處應(yīng)該是語句聲明.”,
“Too many var statements.”:“過多var的聲明”,
“Redefinition of ‘{a}’.”:“‘{a}’被重復(fù)定義”,
“It is not necessary to initialize ‘{a}’ to ‘undefined’.”:“無需將’{a}’初始化為’undefined’”,
“Expected a conditional expression and instead saw an assignment.”:“此處需要一個表達式,而不是賦值語句”,
“Expected a ‘break’ statement before ‘case’.”:“在’case’之前需要有’break’.”,
“Expected a ‘break’ statement before ‘default’.”:“在’default’之前需要有’break’.”,
“This ‘switch’ should be an ‘if’.”:“此處’switch’應(yīng)該是’if’.”,
“All ‘debugger’ statements should be removed.”:“請刪除’debugger’的語句”,
“‘{a}’ is not a statement label.”:“‘{a}’不是一個聲明標(biāo)簽.”,
“Expected an assignment or function call and instead saw an expression.”:“需要一個語句或者一個函數(shù)調(diào)用朽砰,而不是一個表達式”,
“Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.”:“函數(shù)的聲明不能放在類似if的塊中尖滚,需要放在外部函數(shù)的頂部.”
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市瞧柔,隨后出現(xiàn)的幾起案子漆弄,更是在濱河造成了極大的恐慌,老刑警劉巖造锅,帶你破解...
    沈念sama閱讀 219,490評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件撼唾,死亡現(xiàn)場離奇詭異,居然都是意外死亡哥蔚,警方通過查閱死者的電腦和手機倒谷,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,581評論 3 395
  • 文/潘曉璐 我一進店門蛛蒙,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人渤愁,你說我怎么就攤上這事牵祟。” “怎么了抖格?”我有些...
    開封第一講書人閱讀 165,830評論 0 356
  • 文/不壞的土叔 我叫張陵诺苹,是天一觀的道長。 經(jīng)常有香客問我他挎,道長筝尾,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,957評論 1 295
  • 正文 為了忘掉前任办桨,我火速辦了婚禮筹淫,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘呢撞。我一直安慰自己损姜,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,974評論 6 393
  • 文/花漫 我一把揭開白布殊霞。 她就那樣靜靜地躺著摧阅,像睡著了一般。 火紅的嫁衣襯著肌膚如雪绷蹲。 梳的紋絲不亂的頭發(fā)上棒卷,一...
    開封第一講書人閱讀 51,754評論 1 307
  • 那天,我揣著相機與錄音祝钢,去河邊找鬼比规。 笑死,一個胖子當(dāng)著我的面吹牛拦英,可吹牛的內(nèi)容都是我干的蜒什。 我是一名探鬼主播,決...
    沈念sama閱讀 40,464評論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼疤估,長吁一口氣:“原來是場噩夢啊……” “哼灾常!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起铃拇,我...
    開封第一講書人閱讀 39,357評論 0 276
  • 序言:老撾萬榮一對情侶失蹤钞瀑,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后慷荔,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體雕什,經(jīng)...
    沈念sama閱讀 45,847評論 1 317
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,995評論 3 338
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了监徘。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片晋修。...
    茶點故事閱讀 40,137評論 1 351
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖凰盔,靈堂內(nèi)的尸體忽然破棺而出墓卦,到底是詐尸還是另有隱情,我是刑警寧澤户敬,帶...
    沈念sama閱讀 35,819評論 5 346
  • 正文 年R本政府宣布落剪,位于F島的核電站,受9級特大地震影響尿庐,放射性物質(zhì)發(fā)生泄漏忠怖。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,482評論 3 331
  • 文/蒙蒙 一抄瑟、第九天 我趴在偏房一處隱蔽的房頂上張望凡泣。 院中可真熱鬧,春花似錦皮假、人聲如沸鞋拟。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,023評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽贺纲。三九已至,卻和暖如春褪测,著一層夾襖步出監(jiān)牢的瞬間猴誊,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,149評論 1 272
  • 我被黑心中介騙來泰國打工侮措, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留懈叹,地道東北人。 一個月前我還...
    沈念sama閱讀 48,409評論 3 373
  • 正文 我出身青樓萝毛,卻偏偏與公主長得像项阴,于是被迫代替她去往敵國和親滑黔。 傳聞我的和親對象是個殘疾皇子笆包,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,086評論 2 355