Skip to content

Commit 14c09b6

Browse files
committed
added lint to CI workflow
1 parent ad84294 commit 14c09b6

13 files changed

+664
-650
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ root = true
22

33
[*]
44
indent_style = space
5-
indent_size = 4
5+
indent_size = 2
66
end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
2424
restore-keys: |
2525
${{ runner.os }}-
26-
- name: Install dependencies
27-
run: npm ci
26+
- run: npm ci
27+
- run: npm run lint
2828
- run: npm test
2929
env:
3030
CI: true

.github/workflows/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
restore-keys: |
2020
${{ runner.os }}-node-
2121
- run: npm ci
22-
- run: npm run release
2322
- run: npm publish
2423
env:
2524
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"build": "babel src --out-dir lib --source-maps",
99
"lint:src": "eslint 'src/**/*.js'",
1010
"lint:test": "eslint 'spec/**/*.js'",
11+
"lint:fix": "eslint 'spec/**/*.js' --fix && eslint 'spec/**/*.js' --fix",
1112
"lint": "npm run lint:src && npm run lint:test",
1213
"test": "nyc --reporter=lcov jasmine",
13-
"release": "npm run build && npm test",
1414
"posttest": "nyc report --reporter=json && codecov -f coverage/*.json",
15+
"prepare": "npm run build && npm test",
1516
"demo": "node ./demo"
1617
},
1718
"repository": {

spec/.eslintrc.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"env": {
3+
"jasmine": true
4+
},
5+
"globals": {
6+
},
7+
"rules": {
8+
"no-console": [0],
9+
"no-var": "error"
10+
}
11+
}

spec/ApiMailAdapter.spec.js

+528-528
Large diffs are not rendered by default.

spec/MailAdapter.spec.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ const MailAdapter = require('../src/MailAdapter');
44
const { Parse } = require('./helper');
55

66
describe('MailAdapter', () => {
7-
const adapter = new MailAdapter()
8-
const user = new Parse.User();
7+
const adapter = new MailAdapter()
8+
const user = new Parse.User();
99

10-
it('should have a method called sendMail', () => {
11-
expect(typeof adapter.sendMail).toBe('function');
12-
expect(adapter.sendMail()).toBeUndefined();
13-
});
10+
it('should have a method called sendMail', () => {
11+
expect(typeof adapter.sendMail).toBe('function');
12+
expect(adapter.sendMail()).toBeUndefined();
13+
});
1414

15-
it('should have a method called sendVerificationEmail', () => {
16-
expect(typeof adapter.sendVerificationEmail).toBe('function');
17-
expect(adapter.sendVerificationEmail({ link: 'link', appName: 'appName', user: user })).toBeUndefined();
18-
});
15+
it('should have a method called sendVerificationEmail', () => {
16+
expect(typeof adapter.sendVerificationEmail).toBe('function');
17+
expect(adapter.sendVerificationEmail({ link: 'link', appName: 'appName', user: user })).toBeUndefined();
18+
});
1919

20-
it('should have a method called sendPasswordResetEmail', () => {
21-
expect(typeof adapter.sendPasswordResetEmail).toBe('function');
22-
expect(adapter.sendPasswordResetEmail({ link: 'link', appName: 'appName', user: user })).toBeUndefined();
23-
});
24-
});
20+
it('should have a method called sendPasswordResetEmail', () => {
21+
expect(typeof adapter.sendPasswordResetEmail).toBe('function');
22+
expect(adapter.sendPasswordResetEmail({ link: 'link', appName: 'appName', user: user })).toBeUndefined();
23+
});
24+
});

spec/helper.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
// Simluate Parse User class
44
const Parse = {
5-
User: class User {
6-
get(key) {
7-
switch (key) {
8-
case 'username':
9-
return 'ExampleUsername'
10-
case 'email':
11-
12-
}
13-
}
5+
User: class User {
6+
get(key) {
7+
switch (key) {
8+
case 'username':
9+
return 'ExampleUsername'
10+
case 'email':
11+
12+
}
1413
}
14+
}
1515
};
1616

1717
module.exports = {
18-
Parse
19-
};
18+
Parse
19+
};

0 commit comments

Comments
 (0)