Skip to content

Commit 1d1a302

Browse files
committed
feat(lint): add lint support
1 parent a77bc29 commit 1d1a302

File tree

5 files changed

+213
-11
lines changed

5 files changed

+213
-11
lines changed

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"build": "rm -rf dist && webpack",
1111
"preversion": "npm run build && git add dist",
1212
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
13-
"precommit": "echo done",
14-
"commitmsg": "commitlint -e $GIT_PARAMS"
13+
"precommit": "yarn lint",
14+
"commitmsg": "commitlint -e $GIT_PARAMS",
15+
"lint": "tslint --project tsconfig.json"
1516
},
1617
"dependencies": {
1718
"conventional-changelog-cli": "^2.0.1",
@@ -20,9 +21,11 @@
2021
"devDependencies": {
2122
"@commitlint/cli": "^7.0.0",
2223
"@commitlint/config-conventional": "^7.0.1",
24+
"@moneytree/tslint-rules": "^1.0.2",
2325
"@types/qs": "^6.5.1",
2426
"awesome-typescript-loader": "^5.2.0",
2527
"husky": "^0.14.3",
28+
"tslint": "^5.16.0",
2629
"typescript": "^3.0.1",
2730
"webpack": "^4.16.3",
2831
"webpack-cli": "^3.1.0"

src/endpoints.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export const DOMAIN = 'getmoneytree.com'
1+
export const DOMAIN = 'getmoneytree.com';
22

33
export const VAULT = {
44
SUBDOMAIN: 'vault',
5-
TEST_SUBDOMAIN: 'vault-staging',
5+
TEST_SUBDOMAIN: 'vault-staging'
66
};
77

88
export const MY_ACCOUNT = {
@@ -12,4 +12,4 @@ export const MY_ACCOUNT = {
1212
OAUTH: 'oauth/authorize',
1313
SETTINGS: 'settings'
1414
}
15-
}
15+
};

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LinkSDK {
5454
private params: IParams;
5555
private oauthParams: IOauthParams;
5656

57-
init(config: IConfig): void {
57+
public init(config: IConfig): void {
5858
if (!config.clientId) {
5959
throw new Error('Need a clientId to initialise');
6060
}
@@ -89,7 +89,7 @@ class LinkSDK {
8989
}
9090

9191
// Open My Account to authorize application to use MtLink API
92-
authorize(options: IMyAccountOptions = {}): void {
92+
public authorize(options: IMyAccountOptions = {}): void {
9393
const { newTab = false, email, authPage, backTo, showAuthToggle } = options;
9494

9595
const params = encodeConfigWithParams(
@@ -107,7 +107,7 @@ class LinkSDK {
107107
}
108108

109109
// Open the Vault page
110-
openVault(options: IVaultOptions = {}): void {
110+
public openVault(options: IVaultOptions = {}): void {
111111
const { newTab = false, backTo = location.href } = options;
112112
const params = encodeConfigWithParams(this.params, {
113113
sdk_platform: 'js',
@@ -119,7 +119,7 @@ class LinkSDK {
119119
}
120120

121121
// Open the Guest settings page
122-
openSettings(options: IMyAccountOptions = {}): void {
122+
public openSettings(options: IMyAccountOptions = {}): void {
123123
const { newTab = false, backTo = location.href } = options;
124124

125125
const params = encodeConfigWithParams(this.params, {

tslint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": ["@moneytree/tslint-rules"],
3+
"linterOptions": {
4+
"exclude": ["**/node_modules/**"]
5+
}
6+
}

0 commit comments

Comments
 (0)