module.exports = function(grunt) {
	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),

		jshint: {
			files: ['Gruntfile.js', 'js/**/*.js'],
			options: {
				ignores: ['js/core.js', 'js/yui-min.js']
			}
		},
		sass: {
			dist: {
				options: {
					style: 'compressed'
				},
				files: {
					'css/style.min.css': 'sass/style.scss'
				}
			},
			check: {
				options: {
					check: true
				},
				files: {
					'css/style.css': 'sass/style.scss'
				}
			},
			dev: {
				options: {
					style: 'expanded',
					// trace: true,
					lineNumbers: true
				},
				files: {
					'css/style.css': 'sass/style.scss'
				}
			}
		},
		watch: {
			js: {
				files: ['Gruntfile.js','js/**/*.js'],
				tasks: ['jshint'],
				options: {
					atBegin: true
				}
			},
			css: {
				files: 'sass/**/*.scss',
				tasks: ['sass:dev'],
				options: {
					atBegin: true
				}
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-sass');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask('default', ['watch']);
	grunt.registerTask('dist', ['jshint', 'sass:dist']);
	grunt.registerTask('check', ['jshint', 'sass:check']);
};