Skip to content

Commit

Permalink
feat: each individual rule file inside the library folder can now be …
Browse files Browse the repository at this point in the history
…loaded individually
  • Loading branch information
rodoabad committed Apr 3, 2016
1 parent dca1d03 commit 81aa833
Show file tree
Hide file tree
Showing 27 changed files with 254 additions and 202 deletions.
52 changes: 26 additions & 26 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@ const valueListRules = require('./lib/value-list');
const rules = {
rules: Object.assign(
{},
atRuleRules,
blockRules,
colorRules,
commentRules,
customMediaRules,
customPropertyRules,
declarationRules,
declarationBlockRules,
fontFamilyRules,
fontWeightRules,
functionRules,
generalRules,
mediaFeatureRules,
mediaQueryRules,
mediaQueryListRules,
numberRules,
propertyRules,
rootRuleRules,
ruleRules,
selectorRules,
selectorListRules,
stringRules,
timeRules,
unitRules,
valueRules,
valueListRules
atRuleRules.rules,
blockRules.rules,
colorRules.rules,
commentRules.rules,
customMediaRules.rules,
customPropertyRules.rules,
declarationRules.rules,
declarationBlockRules.rules,
fontFamilyRules.rules,
fontWeightRules.rules,
functionRules.rules,
generalRules.rules,
mediaFeatureRules.rules,
mediaQueryRules.rules,
mediaQueryListRules.rules,
numberRules.rules,
propertyRules.rules,
rootRuleRules.rules,
ruleRules.rules,
selectorRules.rules,
selectorListRules.rules,
stringRules.rules,
timeRules.rules,
unitRules.rules,
valueRules.rules,
valueListRules.rules
)
};

Expand Down
22 changes: 12 additions & 10 deletions lib/at-rule.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module.exports = {
'at-rule-empty-line-before': [
'always',
{
except: [
'blockless-group'
]
}
],
'at-rule-no-vendor-prefix': true,
'at-rule-semicolon-newline-after': 'always'
rules: {
'at-rule-empty-line-before': [
'always',
{
except: [
'blockless-group'
]
}
],
'at-rule-no-vendor-prefix': true,
'at-rule-semicolon-newline-after': 'always'
}
};
22 changes: 12 additions & 10 deletions lib/block.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module.exports = {
'block-closing-brace-newline-after': 'always',
'block-closing-brace-newline-before': 'always',
'block-closing-brace-space-after': 'always-single-line',
'block-closing-brace-space-before': 'always-single-line',
'block-no-empty': true,
'block-no-single-line': true,
'block-opening-brace-newline-after': 'always',
'block-opening-brace-newline-before': null,
'block-opening-brace-space-after': 'always-single-line',
'block-opening-brace-space-before': 'always'
rules: {
'block-closing-brace-newline-after': 'always',
'block-closing-brace-newline-before': 'always',
'block-closing-brace-space-after': 'always-single-line',
'block-closing-brace-space-before': 'always-single-line',
'block-no-empty': true,
'block-no-single-line': true,
'block-opening-brace-newline-after': 'always',
'block-opening-brace-newline-before': null,
'block-opening-brace-space-after': 'always-single-line',
'block-opening-brace-space-before': 'always'
}
};
12 changes: 7 additions & 5 deletions lib/color.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
'color-hex-case': 'lower',
'color-hex-length': 'short',
'color-named': 'always-where-possible',
'color-no-hex': null,
'color-no-invalid-hex': true
rules: {
'color-hex-case': 'lower',
'color-hex-length': 'short',
'color-named': 'always-where-possible',
'color-no-hex': null,
'color-no-invalid-hex': true
}
};
6 changes: 4 additions & 2 deletions lib/comment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
'comment-empty-line-before': 'always',
'comment-whitespace-inside': 'always'
rules: {
'comment-empty-line-before': 'always',
'comment-whitespace-inside': 'always'
}
};
4 changes: 3 additions & 1 deletion lib/custom-media.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
'custom-media-pattern': /^([a-z]+-+?)*([a-z]+)$/
rules: {
'custom-media-pattern': /^([a-z]+-+?)*([a-z]+)$/
}
};
6 changes: 4 additions & 2 deletions lib/custom-property.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
'custom-property-no-outside-root': true,
'custom-property-pattern': /^.([a-z](-[a-z])?)+(__([a-z](-[a-z])?)+)?(--([a-z](-[a-z])?)+)?$/
rules: {
'custom-property-no-outside-root': true,
'custom-property-pattern': /^.([a-z](-[a-z])?)+(__([a-z](-[a-z])?)+)?(--([a-z](-[a-z])?)+)?$/
}
};
102 changes: 52 additions & 50 deletions lib/declaration-block.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
module.exports = {
'declaration-block-no-duplicate-properties': true,
'declaration-block-no-shorthand-property-overrides': true,
'declaration-block-properties-order': [
[
rules: {
'declaration-block-no-duplicate-properties': true,
'declaration-block-no-shorthand-property-overrides': true,
'declaration-block-properties-order': [
[
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'color',
'background'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'top',
'right',
'bottom',
'left'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'margin-top',
'margin-right',
'margin-bottom',
'margin-left'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'padding-top',
'padding-right',
'padding-bottom',
'padding-left'
]
}
],
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'color',
'background'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'top',
'right',
'bottom',
'left'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'margin-top',
'margin-right',
'margin-bottom',
'margin-left'
]
},
{
order: 'strict',
emptyLineBefore: 'always',
properties: [
'padding-top',
'padding-right',
'padding-bottom',
'padding-left'
]
unspecified: 'bottomAlphabetical'
}
],
{
unspecified: 'bottomAlphabetical'
}
],
'declaration-block-semicolon-newline-after': 'always',
'declaration-block-semicolon-newline-before': 'never-multi-line',
'declaration-block-semicolon-space-after': 'always-single-line',
'declaration-block-semicolon-space-before': 'never',
'declaration-block-single-line-max-declarations': 1,
'declaration-block-trailing-semicolon': 'always'
'declaration-block-semicolon-newline-after': 'always',
'declaration-block-semicolon-newline-before': 'never-multi-line',
'declaration-block-semicolon-space-after': 'always-single-line',
'declaration-block-semicolon-space-before': 'never',
'declaration-block-single-line-max-declarations': 1,
'declaration-block-trailing-semicolon': 'always'
}
};
14 changes: 8 additions & 6 deletions lib/declaration.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
'declaration-bang-space-after': 'never',
'declaration-bang-space-before': 'always',
'declaration-colon-newline-after': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
'declaration-no-important': true
rules: {
'declaration-bang-space-after': 'never',
'declaration-bang-space-before': 'always',
'declaration-colon-newline-after': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
'declaration-no-important': true
}
};
4 changes: 3 additions & 1 deletion lib/font-family.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
'font-family-name-quotes': 'single-unless-keyword'
rules: {
'font-family-name-quotes': 'single-unless-keyword'
}
};
4 changes: 3 additions & 1 deletion lib/font-weight.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
'font-weight-notation': 'named-where-possible'
rules: {
'font-weight-notation': 'named-where-possible'
}
};
26 changes: 14 additions & 12 deletions lib/function.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module.exports = {
'function-blacklist': null,
'function-calc-no-unspaced-operator': true,
'function-comma-newline-after': 'always-multi-line',
'function-comma-newline-before': 'never-multi-line',
'function-comma-space-after': 'always-single-line',
'function-comma-space-before': 'never-single-line',
'function-linear-gradient-no-nonstandard-direction': true,
'function-parentheses-newline-inside': 'always-multi-line',
'function-parentheses-space-inside': 'never-single-line',
'function-url-quotes': 'single',
'function-whitelist': null,
'function-whitespace-after': 'always'
rules: {
'function-blacklist': null,
'function-calc-no-unspaced-operator': true,
'function-comma-newline-after': 'always-multi-line',
'function-comma-newline-before': 'never-multi-line',
'function-comma-space-after': 'always-single-line',
'function-comma-space-before': 'never-single-line',
'function-linear-gradient-no-nonstandard-direction': true,
'function-parentheses-newline-inside': 'always-multi-line',
'function-parentheses-space-inside': 'never-single-line',
'function-url-quotes': 'single',
'function-whitelist': null,
'function-whitespace-after': 'always'
}
};
48 changes: 25 additions & 23 deletions lib/general.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
module.exports = {
'indentation': 4,
'max-empty-lines': 1,
'max-line-length': 120,
'max-nesting-depth': 5,
'no-browser-hacks': [
true,
{
browsers: [
'> 1%',
'last 2 versions',
'Firefox ESR'
]
}
],
'no-descending-specificity': true,
'no-duplicate-selectors': true,
'no-eol-whitespace': true,
'no-indistinguishable-colors': true,
'no-invalid-double-slash-comments': true,
'no-missing-eof-newline': true,
'no-unknown-animations': true,
'no-unsupported-browser-features': null,
'stylelint-disable-reason': 'always-after'
rules: {
'indentation': 4,
'max-empty-lines': 1,
'max-line-length': 120,
'max-nesting-depth': 5,
'no-browser-hacks': [
true,
{
browsers: [
'> 1%',
'last 2 versions',
'Firefox ESR'
]
}
],
'no-descending-specificity': true,
'no-duplicate-selectors': true,
'no-eol-whitespace': true,
'no-indistinguishable-colors': true,
'no-invalid-double-slash-comments': true,
'no-missing-eof-newline': true,
'no-unknown-animations': true,
'no-unsupported-browser-features': null,
'stylelint-disable-reason': 'always-after'
}
};
14 changes: 8 additions & 6 deletions lib/media-feature.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
'media-feature-colon-space-after': 'always',
'media-feature-colon-space-before': 'never',
'media-feature-name-no-vendor-prefix': true,
'media-feature-no-missing-punctuation': true,
'media-feature-range-operator-space-after': 'always',
'media-feature-range-operator-space-before': 'always'
rules: {
'media-feature-colon-space-after': 'always',
'media-feature-colon-space-before': 'never',
'media-feature-name-no-vendor-prefix': true,
'media-feature-no-missing-punctuation': true,
'media-feature-range-operator-space-after': 'always',
'media-feature-range-operator-space-before': 'always'
}
};
10 changes: 6 additions & 4 deletions lib/media-query-list.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
'media-query-list-comma-newline-after': 'always-multi-line',
'media-query-list-comma-newline-before': 'never-multi-line',
'media-query-list-comma-space-after': 'always-single-line',
'media-query-list-comma-space-before': 'never'
rules: {
'media-query-list-comma-newline-after': 'always-multi-line',
'media-query-list-comma-newline-before': 'never-multi-line',
'media-query-list-comma-space-after': 'always-single-line',
'media-query-list-comma-space-before': 'never'
}
};
Loading

0 comments on commit 81aa833

Please sign in to comment.