Skip to content

Commit cfabdc0

Browse files
committed
add JSCS and SCSS lint
1 parent ba6d404 commit cfabdc0

File tree

37 files changed

+515
-409
lines changed

37 files changed

+515
-409
lines changed

.jscsrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"preset": "idiomatic",
3+
"validateIndentation": 4,
4+
"requireCamelCaseOrUpperCaseIdentifiers": false,
5+
"disallowKeywordsOnNewLine": [],
6+
"requireKeywordsOnNewLine": [
7+
"else"
8+
],
9+
"requirePaddingNewLinesAfterBlocks": false,
10+
"safeContextKeyword": "self",
11+
"disallowMultipleLineStrings": false,
12+
"requirePaddingNewLinesBeforeLineComments": false,
13+
"requireSpaceBeforeBinaryOperators": [
14+
"=", "+", "-", "*", "/", "%",
15+
"<<", ">>", ">>>", "&", "|", "^",
16+
"&&", "||",
17+
"===", "==", ">=", "<=", "<", ">", "!=", "!=="
18+
],
19+
"requireDotNotation": false,
20+
"requireSpacesInsideBrackets": false,
21+
"requireSpacesInsideParentheses": false,
22+
"maximumLineLength": null,
23+
"maximumNumberOfLines": null,
24+
"validateQuoteMarks": {
25+
"mark": "'",
26+
"escape": true
27+
},
28+
"requireCurlyBraces": [
29+
"for",
30+
"while",
31+
"do",
32+
"try",
33+
"catch"
34+
],
35+
"requireEarlyReturn": false,
36+
"validateCommentPosition": false
37+
}

.jshintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"-W069": true, // accesses to "regional" in language files
3+
"multistr": true
4+
}

.scss-lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
linters:
2+
PropertySortOrder:
3+
enabled: false
4+
5+
SingleLinePerSelector:
6+
enabled: false
7+
8+
SelectorDepth:
9+
max_depth: 4
10+
11+
NestingDepth:
12+
max_depth: 4
13+
14+
HexLength:
15+
enabled: false
16+
17+
HexNotation:
18+
style: uppercase
19+
20+
Shorthand:
21+
allowed_shorthands: [1, 2]
22+
23+
QualifyingElement:
24+
enabled: false
25+
26+
ImportantRule:
27+
enabled: false
28+
29+
VendorPrefix:
30+
exclude:
31+
- src/scss/_mixins.scss

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_js:
33
- "0.12"
44
before_install:
55
- gem install sass
6+
- gem install scss_lint
67
- npm install -g grunt-cli
78
- npm install -g bower
89
before_script:

Gruntfile.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ var deepmerge = require('deepmerge');
22

33
module.exports = function(grunt) {
44
require('time-grunt')(grunt);
5-
require('jit-grunt')(grunt);
5+
require('jit-grunt')(grunt, {
6+
scsslint: 'grunt-scss-lint'
7+
});
68

79
grunt.util.linefeed = '\n';
810

@@ -361,12 +363,33 @@ module.exports = function(grunt) {
361363
jshint: {
362364
lib: {
363365
options: {
364-
'-W069': true // accesses to "regional" in language files
366+
jshintrc: '.jshintrc'
367+
},
368+
src: js_files_to_load
369+
}
370+
},
371+
372+
// jscs tests
373+
jscs: {
374+
lib: {
375+
options: {
376+
config: '.jscsrc'
365377
},
366378
src: js_files_to_load
367379
}
368380
},
369381

382+
// scss tests
383+
scsslint: {
384+
lib: {
385+
options: {
386+
colorizeOutput: true,
387+
config: '.scss-lint.yml'
388+
},
389+
src: ['src/**/*.scss']
390+
}
391+
},
392+
370393
// inject all source files and test modules in the test file
371394
'string-replace': {
372395
test: {
@@ -569,8 +592,10 @@ module.exports = function(grunt) {
569592
]);
570593

571594
grunt.registerTask('test', [
572-
'default',
573595
'jshint',
596+
'jscs',
597+
'scsslint',
598+
'default',
574599
'string-replace:test',
575600
'qunit_blanket_lcov',
576601
'qunit'

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@
88
},
99
"description": "jQuery plugin for user friendly query/filter creator",
1010
"devDependencies": {
11+
"deepmerge": "^0.2.0",
1112
"grunt": "^0.4.5",
12-
"grunt-contrib-qunit": "^0.7.0",
13-
"grunt-contrib-uglify": "^0.11.0",
14-
"grunt-contrib-cssmin": "^0.14.0",
15-
"grunt-contrib-copy": "^0.8.0",
13+
"grunt-bump": "^0.7.0",
14+
"grunt-contrib-clean": "^0.7.0",
1615
"grunt-contrib-concat": "^0.5.0",
16+
"grunt-contrib-copy": "^0.8.0",
17+
"grunt-contrib-cssmin": "^0.14.0",
1718
"grunt-contrib-jshint": "^0.11.0",
18-
"grunt-contrib-watch": "^0.6.0",
19+
"grunt-contrib-qunit": "^0.7.0",
1920
"grunt-contrib-sass": "^0.9.0",
21+
"grunt-contrib-uglify": "^0.11.0",
22+
"grunt-contrib-watch": "^0.6.0",
23+
"grunt-coveralls": "^1.0.0",
24+
"grunt-jscs": "^2.6.0",
2025
"grunt-qunit-blanket-lcov": "^0.3.0",
26+
"grunt-scss-lint": "^0.3.8",
2127
"grunt-string-replace": "^1.2.0",
22-
"grunt-contrib-clean": "^0.7.0",
23-
"grunt-coveralls": "^1.0.0",
2428
"grunt-wrap": "^0.3.0",
25-
"deepmerge": "^0.2.0",
26-
"grunt-bump": "^0.7.0",
27-
"time-grunt": "^1.2.0",
28-
"jit-grunt": "^0.9.0"
29+
"jit-grunt": "^0.9.0",
30+
"time-grunt": "^1.2.0"
2931
},
3032
"keywords": [
3133
"jquery",

src/.wrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function(root, factory) {
2-
if (typeof define === 'function' && define.amd) {
2+
if (typeof define == 'function' && define.amd) {
33
define(['jquery', 'doT', 'jQuery.extendext'], factory);
44
}
55
else {

0 commit comments

Comments
 (0)