Skip to content

Commit

Permalink
add csslint
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgee committed Oct 27, 2015
1 parent 2d1cc38 commit 15cbd8e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .csslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* https://github.com/CSSLint/csslint/wiki/Rules */
{
"important": false,
"adjoining-classes": false,
"known-properties": false,
"box-sizing": false,
"box-model": false,
"overqualified-elements": false,
"display-property-grouping": false,
"bulletproof-font-face": false,
"compatible-vendor-prefixes": false,
"regex-selectors": false,
"errors": true,
"duplicate-background-images": false,
"duplicate-properties": false,
"empty-rules": false,
"selector-max-approaching": false,
"gradients": false,
"fallback-colors": false,
"font-sizes": false,
"font-faces": false,
"floats": false,
"star-property-hack": false,
"outline-none": false,
"import": false,
"ids": false,
"underscore-property-hack": false,
"rules-count": false,
"qualified-headings": false,
"selector-max": false,
"shorthand": false,
"text-indent": false,
"unique-headings": false,
"universal-selector": false,
"unqualified-attributes": false,
"vendor-prefix": false,
"zero-units": false
}
23 changes: 18 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ module.exports = function (grunt) {
}
},

csslint: {
strict: {
src: ['viewer/**/*.css', '!viewer/css/theme/**/*.css']
},
lax: {
src: ['viewer/**/*.css', '!viewer/css/theme/**/*.css'],
options: {
csslintrc: '.csslintrc'
}
}
},

eslint: {
build: {
src: ['viewer/**/*.js'],
Expand Down Expand Up @@ -99,11 +111,11 @@ module.exports = function (grunt) {
watch: {
dev: {
files: ['viewer/**'],
tasks: ['jshint']
tasks: ['eslint', 'csslint']
},
build: {
files: ['dist/viewer/**'],
tasks: ['jshint']
tasks: ['eshint', 'csslint']
}
},
connect: {
Expand Down Expand Up @@ -151,6 +163,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-watch');
Expand All @@ -160,10 +173,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-compress');

// define the tasks
grunt.registerTask('default', 'Watches the project for changes, automatically builds them and runs a web server and opens default browser to preview.', ['eslint', 'connect:dev', 'open:dev_browser', 'watch:dev']);
grunt.registerTask('default', 'Watches the project for changes, automatically builds them and runs a web server and opens default browser to preview.', ['eslint', 'csslint:strict', 'connect:dev', 'open:dev_browser', 'watch:dev']);
grunt.registerTask('build', 'Compiles all of the assets and copies the files to the build directory.', ['clean', 'copy', 'scripts', 'stylesheets', 'compress:build']);
grunt.registerTask('build-view', 'Compiles all of the assets and copies the files to the build directory starts a web server and opens browser to preview app.', ['clean', 'copy', 'scripts', 'stylesheets', 'compress:build', 'connect:build', 'open:build_browser', 'watch:build']);
grunt.registerTask('scripts', 'Compiles the JavaScript files.', ['eslint', 'uglify']);
grunt.registerTask('stylesheets', 'Auto prefixes css and compiles the stylesheets.', ['autoprefixer', 'cssmin']);
grunt.registerTask('hint', 'Run simple eslint.', ['eslint']);
grunt.registerTask('stylesheets', 'Auto prefixes css and compiles the stylesheets.', ['csslint:lax', 'autoprefixer', 'cssmin']);
grunt.registerTask('lint', 'Run eslint and csslint.', ['eslint', 'csslint:strict']);
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
"repository": "https://github.com/cmv/cmv-app/",
"dependencies": {
"babel-eslint": "4.1.x",
"csslint": "0.10.x",
"eslint": "1.7.3",
"grunt": "0.4.x",
"grunt-autoprefixer": "0.7.x",
"grunt-contrib-clean": "0.5.x",
"grunt-contrib-connect": "0.7.x",
"grunt-contrib-copy": "0.5.x",
"grunt-contrib-cssmin": "0.9.x",
"grunt-contrib-csslint": "0.5.x",
"grunt-eslint": "17.3.x",
"grunt-contrib-uglify": "0.4.x",
"grunt-contrib-watch": "0.6.x",
Expand Down

0 comments on commit 15cbd8e

Please sign in to comment.