jscs (JavaScript Code Style)가 jshint와 동일한 동작을 수행하여 맨 위에 주석이있는 파일 당 특정 규칙을 무시하거나 시작 및 끝 주석이있는 줄당 방법을 찾고 있습니다.
파일의 특정 규칙을 무시하는 jshint 예제 :
/* jshint undef: false */
블록의 특정 규칙을 무시하는 jshint 예제 :
// Code here will be linted with JSHint.
/* jshint ignore:start */
// Code here will be linted with ignored by JSHint.
/* jshint ignore:end */
답변
jscs 1.6.0부터 사용할 수 있습니다.
파일 범위의 경우 :
모든 규칙을 무시하려면 이것을 파일 위에 놓으십시오.
// jscs:disable
특정 규칙을 무시하려면 파일 맨 위에 놓으십시오.
// jscs:disable specificRule
또한 전체 파일을 무시하기 위해 .jscsrc 에 추가하고 excludeFiles에 항목을 추가 할 수 있습니다 .
블록 범위의 경우 :
모든 규칙을 무시하려면
// Code here will be linted with JSCS.
// jscs:disable
// Code here will be ignored by JSCS.
// jscs:enable
특정 규칙을 무시하려면 :
// Code here will be linted with JSCS.
// jscs:disable specificRule
// Code here will be ignored by JSCS.
// jscs:enable specificRule
답변
한 줄에 대한 특정 규칙을 비활성화하려면
// jscs:ignore maximumLineLength
답변
전체 파일을 무시하려면 파일 맨 위에 다음 행을 추가하십시오.
// jscs:disable