Skip to content

Commit

Permalink
Bump ESLint to 3.x and fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Sep 6, 2016
1 parent fb19917 commit 05105ad
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
8 changes: 7 additions & 1 deletion .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"node": true
},
"globals": {},
"extends": "eslint:recommended",
"rules": {
"no-bitwise": 2,
"camelcase": 0,
Expand Down Expand Up @@ -35,6 +36,11 @@
],
"strict": 0,
"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
}
}
2 changes: 0 additions & 2 deletions .jshintignore

This file was deleted.

20 changes: 11 additions & 9 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function getEmitter() {
*/

function getOptions(args, options) {
var cssDir, sassDir, file, mapDir;
options.src = args[0];

if (args[1]) {
Expand All @@ -193,9 +194,9 @@ function getOptions(args, options) {
}

if (options.directory) {
var sassDir = path.resolve(options.directory);
var file = path.relative(sassDir, args[0]);
var cssDir = path.resolve(options.output);
sassDir = path.resolve(options.directory);
file = path.relative(sassDir, args[0]);
cssDir = path.resolve(options.output);
options.dest = path.join(cssDir, file).replace(path.extname(file), '.css');
}

Expand All @@ -215,9 +216,9 @@ function getOptions(args, options) {
if (!options.directory) {
options.sourceMap = path.resolve(options.sourceMapOriginal, path.basename(options.dest) + '.map');
} else {
var sassDir = path.resolve(options.directory);
var file = path.relative(sassDir, args[0]);
var mapDir = path.resolve(options.sourceMapOriginal);
sassDir = path.resolve(options.directory);
file = path.relative(sassDir, args[0]);
mapDir = path.resolve(options.sourceMapOriginal);
options.sourceMap = path.join(mapDir, file).replace(path.extname(file), '.css.map');
}
}
Expand All @@ -236,19 +237,20 @@ function getOptions(args, options) {

function watch(options, emitter) {
var buildGraph = function(options) {
var graph;
var graphOptions = {
loadPaths: options.includePath,
extensions: ['scss', 'sass', 'css']
};

if (options.directory) {
var graph = grapher.parseDir(options.directory, graphOptions);
graph = grapher.parseDir(options.directory, graphOptions);
} else {
var graph = grapher.parseFile(options.src, graphOptions);
graph = grapher.parseFile(options.src, graphOptions);
}

return graph;
}
};

var watch = [];
var graph = buildGraph(options);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"devDependencies": {
"coveralls": "^2.11.8",
"eslint": "^2.9.0",
"eslint": "^3.4.0",
"istanbul": "^0.4.2",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.2.0",
Expand Down
4 changes: 2 additions & 2 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('api', function() {
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();

envIncludes = [
var envIncludes = [
fixture('sass-path/red'),
fixture('sass-path/orange')
];
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('api', function() {
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();

envIncludes = [
var envIncludes = [
fixture('sass-path/red')
];
process.env.SASS_PATH = envIncludes.join(path.delimiter);
Expand Down

0 comments on commit 05105ad

Please sign in to comment.