Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 0c709c1

Browse files
authored
Merge pull request #1700 from nschonni/eslint-updates
ESLint 3.x updates
2 parents 6dda1de + 05105ad commit 0c709c1

6 files changed

Lines changed: 24 additions & 16 deletions

File tree

.eslintrc renamed to .eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"node": true
44
},
55
"globals": {},
6+
"extends": "eslint:recommended",
67
"rules": {
78
"no-bitwise": 2,
89
"camelcase": 0,
@@ -35,6 +36,11 @@
3536
],
3637
"strict": 0,
3738
"no-undef": 2,
38-
"no-unused-vars": 2
39+
"no-unused-vars": 2,
40+
"semi": 2,
41+
"no-extra-semi": 2,
42+
"no-redeclare": 2,
43+
"block-scoped-var": 2,
44+
"no-console": 0
3945
}
4046
}

.jshintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ before_install:
4646

4747
script:
4848
- npm install
49+
- if [ $TRAVIS_OS_NAME == "linux" ] && [ $TRAVIS_NODE_VERSION == "4" ]; then
50+
npm run lint || exit 1;
51+
fi
4952
- npm test
5053

5154
after_success:
5255
- if [ $TRAVIS_OS_NAME == "linux" ] && [ $TRAVIS_NODE_VERSION == "4" ]; then
53-
npm run lint;
5456
npm run-script coverage;
5557
fi
5658

bin/node-sass

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function getEmitter() {
182182
*/
183183

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

187188
if (args[1]) {
@@ -193,9 +194,9 @@ function getOptions(args, options) {
193194
}
194195

195196
if (options.directory) {
196-
var sassDir = path.resolve(options.directory);
197-
var file = path.relative(sassDir, args[0]);
198-
var cssDir = path.resolve(options.output);
197+
sassDir = path.resolve(options.directory);
198+
file = path.relative(sassDir, args[0]);
199+
cssDir = path.resolve(options.output);
199200
options.dest = path.join(cssDir, file).replace(path.extname(file), '.css');
200201
}
201202

@@ -215,9 +216,9 @@ function getOptions(args, options) {
215216
if (!options.directory) {
216217
options.sourceMap = path.resolve(options.sourceMapOriginal, path.basename(options.dest) + '.map');
217218
} else {
218-
var sassDir = path.resolve(options.directory);
219-
var file = path.relative(sassDir, args[0]);
220-
var mapDir = path.resolve(options.sourceMapOriginal);
219+
sassDir = path.resolve(options.directory);
220+
file = path.relative(sassDir, args[0]);
221+
mapDir = path.resolve(options.sourceMapOriginal);
221222
options.sourceMap = path.join(mapDir, file).replace(path.extname(file), '.css.map');
222223
}
223224
}
@@ -236,19 +237,20 @@ function getOptions(args, options) {
236237

237238
function watch(options, emitter) {
238239
var buildGraph = function(options) {
240+
var graph;
239241
var graphOptions = {
240242
loadPaths: options.includePath,
241243
extensions: ['scss', 'sass', 'css']
242244
};
243245

244246
if (options.directory) {
245-
var graph = grapher.parseDir(options.directory, graphOptions);
247+
graph = grapher.parseDir(options.directory, graphOptions);
246248
} else {
247-
var graph = grapher.parseFile(options.src, graphOptions);
249+
graph = grapher.parseFile(options.src, graphOptions);
248250
}
249251

250252
return graph;
251-
}
253+
};
252254

253255
var watch = [];
254256
var graph = buildGraph(options);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
},
7171
"devDependencies": {
7272
"coveralls": "^2.11.8",
73-
"eslint": "^2.9.0",
73+
"eslint": "^3.4.0",
7474
"istanbul": "^0.4.2",
7575
"mocha": "^2.4.5",
7676
"mocha-lcov-reporter": "^1.2.0",

test/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('api', function() {
147147
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
148148
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();
149149

150-
envIncludes = [
150+
var envIncludes = [
151151
fixture('sass-path/red'),
152152
fixture('sass-path/orange')
153153
];
@@ -175,7 +175,7 @@ describe('api', function() {
175175
var expectedRed = read(fixture('sass-path/expected-red.css'), 'utf8').trim();
176176
var expectedOrange = read(fixture('sass-path/expected-orange.css'), 'utf8').trim();
177177

178-
envIncludes = [
178+
var envIncludes = [
179179
fixture('sass-path/red')
180180
];
181181
process.env.SASS_PATH = envIncludes.join(path.delimiter);

0 commit comments

Comments
 (0)