Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 080f45d

Browse files
committed
Switch to ESLint
1 parent 7bae62e commit 080f45d

6 files changed

Lines changed: 92 additions & 34 deletions

File tree

.eslintrc

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"extends": [
3+
"eslint:recommended"
4+
],
5+
"env": {
6+
"node": true
7+
},
8+
"rules": {
9+
"block-scoped-var": 2,
10+
"brace-style": [2, "1tbs"],
11+
"camelcase": [2, {"properties": "always"}],
12+
"comma-spacing": [2, {"before": false, "after": true}],
13+
"comma-style": [2, "last"],
14+
"computed-property-spacing": [2, "never"],
15+
"curly": [2, "all"],
16+
"dot-notation": 2,
17+
"eol-last": [2, "unix"],
18+
"eqeqeq": [2, "allow-null"],
19+
"global-require": 0,
20+
"indent": [2, 2],
21+
"key-spacing": 2,
22+
"keyword-spacing": 2,
23+
"linebreak-style": [2, "unix"],
24+
"max-statements-per-line": 2,
25+
"new-cap": 2,
26+
"no-array-constructor": 2,
27+
"no-caller": 2,
28+
"no-console": 0,
29+
"no-control-regex": 2,
30+
"no-div-regex": 2,
31+
"no-eval": 2,
32+
"no-extend-native": 2,
33+
"no-extra-bind": 2,
34+
"no-floating-decimal": 2,
35+
"no-implied-eval": 2,
36+
"no-implicit-globals": 2,
37+
"no-mixed-spaces-and-tabs": 2,
38+
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}],
39+
"no-native-reassign": 2,
40+
"no-new-func": 2,
41+
"no-new-object": 2,
42+
"no-new-wrappers": 2,
43+
"no-octal-escape": 2,
44+
"no-self-assign": 2,
45+
"no-self-compare": 2,
46+
"no-sequences": 2,
47+
"no-shadow-restricted-names": 2,
48+
"no-spaced-func": 2,
49+
"no-throw-literal": 2,
50+
"no-trailing-spaces": 2,
51+
"no-undef": 2,
52+
"no-undefined": 2,
53+
"no-unneeded-ternary": 2,
54+
"no-unused-expressions": [2, {"allowShortCircuit": true, "allowTernary": true}],
55+
"no-unused-vars": 2,
56+
"no-use-before-define": 2,
57+
"no-useless-call": 2,
58+
"no-useless-escape": 2,
59+
"no-whitespace-before-property": 2,
60+
"no-with": 2,
61+
"one-var": [2, "never"],
62+
"operator-linebreak": [2, "after"],
63+
"quote-props": [2, "as-needed"],
64+
"quotes": [2, "single", {"avoidEscape": true}],
65+
"semi": [2, "always"],
66+
"semi-spacing": [2, {"before": false, "after": true}],
67+
"space-before-blocks": 2,
68+
"space-before-function-paren": 2,
69+
"space-in-parens": [2, "never"],
70+
"space-infix-ops": 2,
71+
"space-unary-ops": 2,
72+
"spaced-comment": 2,
73+
"strict": [2, "safe"],
74+
"wrap-iife": [2, "inside"]
75+
}
76+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ node_modules
55
\#*\#
66

77
.*
8+
!.eslintrc
89
!.gitignore
910
!.gitattributes
10-
!.jshintrc
1111
!.travis.yml

.jshintrc

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

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"node": ">=0.10.0"
1212
},
1313
"scripts": {
14-
"test": "mocha"
14+
"lint": "eslint *.js lib/**/*.js test/**/*.js",
15+
"test": "npm run lint && mocha"
1516
},
1617
"files": [
1718
"index.js",
@@ -31,8 +32,9 @@
3132
"lodash.isstring": "~2.4.1"
3233
},
3334
"devDependencies": {
34-
"mocha": "^2.1.0",
3535
"chai": "^1.10.0",
36+
"eslint": "^2.10.2",
37+
"mocha": "^2.1.0",
3638
"pofile": "~0.2.7"
3739
}
3840
}

test/.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../.eslintrc",
3+
"env": {
4+
"mocha": true
5+
},
6+
"rules": {
7+
"no-unused-expressions": 0
8+
}
9+
}

test/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
/*jshint expr: true */
32

43
var compile = require('../').compile;
54
var extract = require('../').extract;
@@ -12,7 +11,7 @@ var PO = require('pofile');
1211
var fixturesDir = path.join(__dirname, 'fixtures');
1312
var anotherDir = path.join(__dirname, 'another');
1413

15-
var createFixtureFile = function(filename, content) {
14+
var createFixtureFile = function (filename, content) {
1615
return new gutil.File({
1716
cwd: __dirname,
1817
base: fixturesDir,
@@ -281,7 +280,7 @@ describe('gulp-angular-gettext', function () {
281280
expect(file.contents.toString()).to.equal(JSON.stringify({
282281
es: {
283282
'Hello world': '¡Hola, mundo',
284-
'Goodbye': 'Adios'
283+
Goodbye: 'Adios'
285284
}
286285
}));
287286

0 commit comments

Comments
 (0)