전단 자바스크립트 코딩에는 JSLint라는 좋은 도구가 있습니다. JSLint의 오류 표시가 무엇을 의미하는지 확인하기 위해 코드의 규격화를 검사할 수 있습니다.
Missing semicolon. : 에 단호가 없어. , , , , , , , , , , , , , , , , , , , , , , , , , ,
Use the function form of use strict .: 는 표준화된 정의된 함수를 사용한다.
Unexpected space after -. : - 뒤에 빈 공간이 없어야 합니다. , -, -, -, -, -, -.
Expected a JSON value. : JSON 값을 입력하세요.
Mixed spaces and tabs. : 빈 공간과 TAB가 반복된다. ,
Unsafe character. : 안전하지 않은 캐릭터. .
Line too long. : 본 줄의 문자는 설정된 최대 길이를 초과했습니다. ,
Trailing whitespace.: 이 글의 끝에는 빈 공간이 너무 많아요.
Script URL.: 스크립트 URL.,
Unexpected {a} in {b} . : 은 {b} 에서 나오지 않아야 한다. , , , ,
Unexpected .: 이 여기 있을 필요는 없어요 .
Strings must use doublequote. : 문자열은 이중 인용문자를 사용해야 합니다.
Unnecessary escapement. : 은 을 바꾸지 않아도 됩니다.
Control character in string: {a}. : 는 문자열에 Control의 문자열을 나타냅니다.
“Avoid <unk>: 피하세요.\”,
“Avoid \v. : 피하기\v”,
“Avoid \x. : 피하기\x-”,
Bad escapement. : 잘못된 번역 문자,
Bad number {a}. : 잘못된 숫자 {a}.
() () () () () () () ()
Don’t use extra leading zeros {a}. Don’t use extra leading zeros {a}. Don’t use extra leading zeros {a}.
Avoid 0x-. {a}. : 은 0x-. {a}. 을 사용하지 않는 것이 좋습니다.
A trailing decimal point can be confused with a dot {a} . : 은 {a} 에서 점과 함께 소수점 을 사용한다.
Unexpected comment. : 여기 댓글 안 써야지, 여기 댓글 안 써야지.
Unescaped . : 무역 ,
Unxpected control character in regular expression. : 은 정규 표현식에서 이라는 컨트롤 캐릭터가 나타납니다.
Unexpected escaped character {a} in regular expression. : 은 정규 표현식에서 번역되지 않은 문자 {a} 로 나타납니다.
Expected {a} and instead saw {b}
Spaces are hard to count. Use {{a}}. : 공간은 계산하기 어렵기 때문에 {{a}}를 사용하세요.
“안전하지 않은 엄마” “안전하지 않은 엄마”
Empty class. : 텅 빈 클래스, 텅 빈 클래스.
Expected a number and instead saw {a}.
(a) 는 (b) 보다 크지 않아야 합니다.
hasOwnProperty is a really bad name. : hasOwnProperty은 정말 나쁜 이름입니다.
{a} was used before it was defined. : {a}이 정의되지 않은 상태에서 사용되었다.
{a} is already defined. : {a} 은 이미 정의되어 있습니다.
A dot following a number can be confused with a decimal point. : 숫자의 뒤에 있는 한 점이 의 소수점으로 오해될 수 있다.
Confusing minusses : 은 을 헷갈릴 수 있는 음수 표현 - ,
Confusing plusses. : 은 을 + 을 + 을 + 을 + 을 + 을 + 을 + 을 + 을 + 을
Unmatched . : 에 맞지 않는 . : 에 맞지 않는 .
Expected {a} to match {b} from line {c} and instead saw {d} . : 은 라인 {c} 에서 {a} 과 {b} 로 일치해야 하며, {d} 대신 사용된다.
예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램 조기 종료 예기치 않은 프로그램
A leading decimal point can be confused with a dot: .{a} .: {a} 앞의 지점은 소수점으로 혼동될 수 있다.
“Use the array literal notation [].:은 배열의 기호를 사용한다.[]“,
Expected an operator and instead saw {a} . : 은 {a} 을 대신하는 기호를 사용해야 하고, {a} 을 대신하는 기호를 사용해야 한다.
() () () () () () () () ()
{a} 이전에는 빈칸이 표시되지 않습니다.
Bad line breaking before {a}. : {a} 전에 잘못된 선이 깨진 , {a} 전에 잘못된 선이 깨진 ,
Expected {a} to have an indentation at {b} instead at {c}. : {a}은 을 는 대신 을 는 대신 을 는 대신 을 을 을 을 을 을 을 을 을 을 을 을 을 을 을 을 을
Line breaking error {a} . : 라인 브레이킹 에러 {a} .
Unexpected use of {a}. : 여기서는 {a}을 사용할 수 없습니다.
Bad operand. : 의 잘못된 연산수 ,
Use the isNaN function to compare with NaN. : 는 NaN과 비교하기 위해 isNaN을 사용한다.
Confusing use of {a}. : 을 혼동하기 쉬운 {a}의 사용
Read only. : Read only의 속성은 ,
{a} is a function. : {a}은 함수입니다.
Bad assignment. : 잘못된 배정, 잘못된 배정, 잘못된 배정.
Do not assign to the exception parameter. : 추가적인 변수를 부여하지 마십시오.
Expected an identifier in an assignment and instead saw a function invocation. : 은 임의의 호출 이 아닌, 임의의 호출 이 있어야 합니다.
Expected an identifier and instead saw {a} (a reserved word). : 에는 식별자가 필요하고, {a} (예약된 문자) 대신 {a} 을 보았다.
Missing name in function declaration. : 메소드 선언에서 이름 이 없어서,
Expected an identifier and instead saw {a} . : 은 식별자가 필요했고, 대신 {a} 이 필요했다.
Inner functions should be listed at the top of the outer function. : 내부 함수의 선언은 이 함수의 꼭대기에 배치되어야 한다.
Unreachable {a} after {b} . : {b} 이후 {a} 을 얻을 수 없습니다.
Unnecessary semicolon. : 불필요한 반점 ,
Label {a} on {b} statement. : 은 {a} 을 의 진술에 넣고,
Label {a} looks like a javascript url. : {a} 은 js의 링크 처럼 보이는데,
Expected an assignment or function call and instead saw an expression : 은 표현식 대신 할당 또는 함수 호출을 기대했다.
Do not use new for side effects. : new의 부작용에 대해 new을 사용하지 마십시오.
Unnecessary <unk>use strict<unk>. : 불필요한 <unk>use strict<unk>.
Missing <unk>use strict<unk> statement. : 이 빠진 <unk>use strict<unk>의 선언문 , 이 빠진 <unk>use strict<unk>의 선언문 ,
Empty block. : 텅 빈 블록, 텅 빈 블록, 텅 빈 블록.
“Unexpected /*member {a}.: 은 나오지 않아 /*원소 (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 {b} . : 은 {a} 과 {b} 을 비교하기 위해 을 사용한다.
Variables should not be deleted. : 변수는 삭제되어서는 안 됩니다.
Use the object literal notation {}. : 은 객체의 문자 기호를 {} 로 사용한다.
Do not use {a} as a constructor. : {a} 를 구성 객체로 사용하지 마십시오.
“The Function constructor is eval.”:“The Function constructor is eval.”,
A constructor name should start with an uppercase letter. : 구성 객체의 이름은 대문자로 시작해야 한다.
Bad constructor.: 은 잘못된 구성 객체 , 은 잘못된 구성 객체 ,
Weird construction. Delete new. : 구성 객체 오류, new를 삭제하십시오.
Missing ((() invoking a constructor. : 에는 괄호가 없어서 ,
Avoid arguments.{a}.
document.write can be a form of eval. : document.write는 eval의 한 형태입니다.
eval is evil. : : : : : :
Math is not a function. : Math은 함수 이 아닙니다.
Missing new prefix when invoking a constructor. : 여기에는 new이 빠진데,
Missing radix parameter. : 은 이 없어서 이 없어서 이 없어서 이 없어서 이 없어서 이 없어서 이 없어서
Implied eval is evil. Pass a function instead of a string. : 함수를 전달하는 문자열이 아닌 함수입니다.
Bad invocation. : 잘못된 부름,
“[‘{a}’] is better written in dot notation.”:“[‘{a}‘는 점.
Extra comma.: 여분의 코마 ,
Don’t make functions within a loop. : 함수 을 순환 방식으로 만들지 마세요.
Unexpected parameter {a} in get {b} function. : 은 {a} 을 get {b} 방법에서 사용하지 않아야 합니다.
Duplicate member {a} . : 이 반복되는 {a} ,
Expected to see a statement and instead saw a block. : 이 문장에는 성명서를 보려고 했는데, 대신 블록을 봤습니다.
Too many var statements. : 너무 많은 var의 진술 ,
{a}의 재정립
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 .: 이 스위치 은 if . 이어야 합니다.
All debugger statements should be removed. : debugger 의 문장들은 삭제되어야 합니다.
{a} is not a statement label. : {a} 은 진술표지이 아닙니다.
Expected an assignment or function call and instead saw an expression. : 은 문장이나 함수 호출을 원했고, 표현식 이 아니라 을 원했다.
Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function. : 함수의 선언은 if와 같은 블록에 놓아서는 안되며, 외부 함수의 꼭대기에 놓아야 한다.
1 [W099]:Mixed spaces and tabs
이 오류는 가장 흔한 것으로, 같은 줄에서, 공백과 Tab 축축이 혼합되어 사용되었다는 것을 의미한다. 수정하는 것은 매우 간단하며, 일반적으로 Tab 축축을 삭제하고, 모두 공백으로 변경한다. 편의를 위해, 우리는 편집기의 Tab 축축을 2개 또는 4개의 공백으로 설정하여, 원래의 축축을 대체할 수 있다.
이 오류는 좀 이상한데, 저는 index-1 ? index = 0:index = index - 1 라는 오류를 입력했습니다. 이것은 쉼표 표현식입니다. 하지만 JSLInt는 이 표현식은 함수여야 한다고 생각했어요. 그래서, 이 오류에 대해 정말 걱정한다면, if else 문장으로 바꾸세요.
이 오류는 우리가 이 표현의 양쪽의 데이터 타입이 일치하는 경우, 이 표현의 양쪽의 데이터 타입이 일치하는 경우, 이 표현의 양쪽의 데이터 타입이 일치하는 경우, 이 표현의 양쪽의 데이터 타입이 일치하는 경우,
결함 점수; 이것은 일반적으로 자신이 잊은 글자입니다, 하지만 주의해야 할 점은, 단 한 문장의 구조에 대해, 뒤에 점수도 써야 한다는 것입니다. 예를 들어: if(index) {index=tcount-1} 이 코드 문장은, 올바른 글쓰기는 if(index) {index=tcount-1;} 입니다, 나는 종종 여기서 점수를 쓰는 것을 잊고, 汗…
이 글은 http://www.zystudios.cn/blog/post/70.Shtml 조이의 블로그에서 가져온 것입니다.