Skip to content

Instantly share code, notes, and snippets.

@makotot
Created February 20, 2015 09:07
Show Gist options
  • Save makotot/c06af8e74b7fd49f4f05 to your computer and use it in GitHub Desktop.
Save makotot/c06af8e74b7fd49f4f05 to your computer and use it in GitHub Desktop.
lint

BangFormat

!の前後に不適切なスペースがある時に警告

オプション 内容 初期値
space_before_bang !の前にスペースがあるべきか否か true
space_after_bang !の後ろにスペースがあるべきか否か false

BorderZero

border: noneではなくborder: 0を使うようにするか

オプション 内容 初期値
convention 0(zero)とnoneどちらを選択するか zero

ColorKeyword

16進カラーコードを使うようにするか

ColorVariable

色の指定を変数でしか許可しないようにするか

Comment

/* ... */ではなく//を使うようにするか

DebugStatement

@debugが残ってないか

DuplicateProperty

プロパティが重複していないか

ElsePlacement

@elseの前後の波括弧で改行しないか

オプション 内容 初期値
style 改行するか否か。new_lineで改行ありにできる same_line

EmptyLineBetweenBlocks

ブロックの前に1行あけるかどうか

オプション 内容 初期値
ignore_single_line_blocks 1行だけのブロックは無視するかどうか true

EmptyRule

空のルールセットは許可しない

FinalNewline

ファイルの最後の行が空行になっているか

オプション 内容 初期値
present 最後の行を空行にするか true

HexLength

16進カラーコードを短縮して書くことができるとき、短縮するか、しないか

オプション 内容 初期値
style 短縮して記述を許容ならshort、不可ならlong short

HexNotation

16進カラーコードが小文字で記述されているか

オプション 内容 初期値
style 小文字(lowercase)か大文字(uppercase)か lowercase

HexValidation

16進カラーコードが3桁か6桁であること

IdSelector

IDセレクタを使用しない

ImportantRule

!importantを使用しない

ImportPath

@importを使用するとき、_始まりにしないことと拡張子を含めないこと

オプション 内容 初期値
leading_underscore _はじまりを許可するか false
filename_extension 拡張子を許可するか false

Indentation

1インデント2スペースで

オプション 内容 初期値
allow_non_nested_indentation false
character インデントをtabにするかspaceにするか space
width インデント字数 2

LeadingZero

0始まりの小数点の値は、0を省略する

オプション 内容 初期値
style 0を含む(exclude_zero)・含まない(include_zero) exclude_zero

MergeableSelector

セレクタを重複して記述していないか

オプション 内容 初期値
force_nesting ネスト可能であれば必ずネストさせるか true

NameFormat

関数、ミックスイン、変数はハイフンつなぎの小文字で名前をつける

オプション 内容 初期値
arrow_leading_underscore _はじまりを許容する true
convention ハイフンつなぎの小文字かBEMか(hyphenated_lowercaseBEM)

NestingDepth

深すぎるネストを避ける

オプション 内容 初期値
max_depth ネストの深さ 3

PlaceholderInExtend

@extendのセレクタは常にプレースホルダーを利用する

PropertyCount

@charset 'utf-8';
.bang-format {
display: block !important;
// display: block! important;
}
.border-zero {
border: 0;
// border: none;
}
.color-keyword {
color: #f00;
}
.color-variable {
color: #ff0;
}
.comment {
// comment
}
//@debug 'debug..';
%declaration-order-placeholder {
float: left;
}
@mixin declaration-order-mixin {
overflow: hidden;
}
.declaration-order {
@extend %declaration-order-placeholder;
@include declaration-order-mixin;
display: block;
// @extend %declaration-order-placeholder;
// @include declaration-order-mixin;
}
.duplicate-property {
margin: 0;
// margin: 0;
}
$else-placement: 0;
@if $else-placement == 0 {
} @else {
}
.empty-line-between-blocks {
display: block;
> a {
color: #fff;
}
}
.ignore-single-line-blocks {&:before { content: '';} }
//.empty-rule {
//}
.final-new-line {
display: block;
}
.hex-length {
color: #ee0;
// color: #eeee00;
}
.hex-notation {
color: #ccc;
// color: #CCC;
}
.hex-validation {
color: #ccc;
// color: #cc;
}
.id-selector {
//#id-selector {
padding: 10px;
}
.important-rule {
position: absolute !important;
}
@import 'base/base';
.indentation {
text-align: center;
}
// .indentation--nested {
// background-color: #fdd;
// }
.leading-zero {
opacity: 0.5;
}
.mergable-selector {
padding: 0;
&.force-nesting {
float: right;
}
}
//.mergable-selector.force-nesting {
// float: right;
//}
//.mergable-selector {
// margin: 0;
//}
//$nameFormat: 100px;
$name-format: 100px;
$_arrow-leading-underscore: 0;
//.name-format__convention {
// font-weight: bold;
//}
.nest-depth {
> li {
> a {
text-decoration: underline;
// &:after {
// content: '';
// }
}
}
}
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BorderZero:
enabled: true
convention: 'none'
ColorKeyword:
enabled: true
ColorVariable:
enabled: true
Comment:
enabled: true
DebugStatement:
enabled: true
DeclarationOrder:
enabled: true
DuplicateProperty:
enabled: true
ElsePlacement:
enabled: true
style: same_line
EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: true
EmptyRule:
enabled: true
FinalNewline:
enabled: true
present: true
HexLength:
enabled: true
style: short
HexNotation:
enabled: true
style: lowercase
HexValidation:
enabled: true
IdSelector:
enabled: true
ImportantRule:
enabled: true
ImportPath:
enabled: true
leading_underscore: false
filename_extension: false
Indentation:
enabled: true
# allow_non_nested_indentation: true
character: space
width: 2
LeadingZero:
enabled: true
style: include_zero
MergeableSelector:
enabled: true
force_nesting: true
NameFormat:
enabled: true
allow_leading_underscore: true
# convention: BEM
NestingDepth:
enabled: true
max_depth: 3
PlaceholderInExtend:
enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment