Commit 05105ad3 by Nick Schonning

Bump ESLint to 3.x and fix errors

parent fb199177
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"node": true "node": true
}, },
"globals": {}, "globals": {},
"extends": "eslint:recommended",
"rules": { "rules": {
"no-bitwise": 2, "no-bitwise": 2,
"camelcase": 0, "camelcase": 0,
...@@ -35,6 +36,11 @@ ...@@ -35,6 +36,11 @@
], ],
"strict": 0, "strict": 0,
"no-undef": 2, "no-undef": 2,
"no-unused-vars": 2 "no-unused-vars": 2,
"semi": 2,
"no-extra-semi": 2,
"no-redeclare": 2,
"block-scoped-var": 2,
"no-console": 0
} }
} }
node_modules/**
test/coverage/html
...@@ -182,6 +182,7 @@ function getEmitter() { ...@@ -182,6 +182,7 @@ function getEmitter() {
*/ */
function getOptions(args, options) { function getOptions(args, options) {
var cssDir, sassDir, file, mapDir;
options.src = args[0]; options.src = args[0];
if (args[1]) { if (args[1]) {
...@@ -193,9 +194,9 @@ function getOptions(args, options) { ...@@ -193,9 +194,9 @@ function getOptions(args, options) {
} }
if (options.directory) { if (options.directory) {
var sassDir = path.resolve(options.directory); sassDir = path.resolve(options.directory);
var file = path.relative(sassDir, args[0]); file = path.relative(sassDir, args[0]);
var cssDir = path.resolve(options.output); cssDir = path.resolve(options.output);
options.dest = path.join(cssDir, file).replace(path.extname(file), '.css'); options.dest = path.join(cssDir, file).replace(path.extname(file), '.css');
} }
...@@ -215,9 +216,9 @@ function getOptions(args, options) { ...@@ -215,9 +216,9 @@ function getOptions(args, options) {
if (!options.directory) { if (!options.directory) {
options.sourceMap = path.resolve(options.sourceMapOriginal, path.basename(options.dest) + '.map'); options.sourceMap = path.resolve(options.sourceMapOriginal, path.basename(options.dest) + '.map');
} else { } else {
var sassDir = path.resolve(options.directory); sassDir = path.resolve(options.directory);
var file = path.relative(sassDir, args[0]); file = path.relative(sassDir, args[0]);
var mapDir = path.resolve(options.sourceMapOriginal); mapDir = path.resolve(options.sourceMapOriginal);
options.sourceMap = path.join(mapDir, file).replace(path.extname(file), '.css.map'); options.sourceMap = path.join(mapDir, file).replace(path.extname(file), '.css.map');
} }
} }
...@@ -236,19 +237,20 @@ function getOptions(args, options) { ...@@ -236,19 +237,20 @@ function getOptions(args, options) {
function watch(options, emitter) { function watch(options, emitter) {
var buildGraph = function(options) { var buildGraph = function(options) {
var graph;
var graphOptions = { var graphOptions = {
loadPaths: options.includePath, loadPaths: options.includePath,
extensions: ['scss', 'sass', 'css'] extensions: ['scss', 'sass', 'css']
}; };
if (options.directory) { if (options.directory) {
var graph = grapher.parseDir(options.directory, graphOptions); graph = grapher.parseDir(options.directory, graphOptions);
} else { } else {
var graph = grapher.parseFile(options.src, graphOptions); graph = grapher.parseFile(options.src, graphOptions);
} }
return graph; return graph;
} };
var watch = []; var watch = [];
var graph = buildGraph(options); var graph = buildGraph(options);
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
}, },
"devDependencies": { "devDependencies": {
"coveralls": "^2.11.8", "coveralls": "^2.11.8",
"eslint": "^2.9.0", "eslint": "^3.4.0",
"istanbul": "^0.4.2", "istanbul": "^0.4.2",
"mocha": "^2.4.5", "mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.2.0", "mocha-lcov-reporter": "^1.2.0",
......
...@@ -147,7 +147,7 @@ describe('api', function() { ...@@ -147,7 +147,7 @@ describe('api', function() {
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim(); var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim(); var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();
envIncludes = [ var envIncludes = [
fixture('sass-path/red'), fixture('sass-path/red'),
fixture('sass-path/orange') fixture('sass-path/orange')
]; ];
...@@ -175,7 +175,7 @@ describe('api', function() { ...@@ -175,7 +175,7 @@ describe('api', function() {
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim(); var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim(); var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();
envIncludes = [ var envIncludes = [
fixture('sass-path/red') fixture('sass-path/red')
]; ];
process.env.SASS_PATH = envIncludes.join(path.delimiter); process.env.SASS_PATH = envIncludes.join(path.delimiter);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment