Skip to content

Commit

Permalink
Added TSLint
Browse files Browse the repository at this point in the history
  • Loading branch information
icastillejogomez committed May 14, 2020
1 parent f44c91d commit 56dbe3b
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 24 deletions.
441 changes: 441 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"types": "lib",
"scripts": {
"start": "node dist/main",
"compile": "rm -fr dist && tsc"
"compile": "rm -fr dist && tsc",
"lint": "tslint --project tsconfig.json 'src/**/*.ts'"
},
"keywords": [
"degiro",
Expand All @@ -18,6 +19,8 @@
"author": "Ignacio F. Castillejo Gómez",
"license": "MIT",
"devDependencies": {
"tslint": "^6.1.2",
"tslint-config-airbnb": "^5.11.2",
"typescript": "^3.8.3"
},
"dependencies": {
Expand Down
13 changes: 6 additions & 7 deletions src/lib/DeGiro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DeGiroClassInterface } from './interfaces'
// Import types
import { DeGiroSettupType, PortfolioPositionType } from './types'


/**
* @class DeGiro
* @description Main class of DeGiro Unofficial API.
Expand All @@ -13,7 +12,7 @@ export class DeGiro implements DeGiroClassInterface{

private readonly username: string
private readonly pwd: string

constructor(params: DeGiroSettupType) {
this.username = params.username
this.pwd = params.pwd
Expand All @@ -24,15 +23,15 @@ export class DeGiro implements DeGiroClassInterface{
}

login(): never {
throw new Error("Method not implemented.")
throw new Error('Method not implemented.')
}

getCashFunds(): import("./types/CashFoundType").CashFoundType[] {
throw new Error("Method not implemented.")
getCashFunds(): import('./types/CashFoundType').CashFoundType[] {
throw new Error('Method not implemented.')
}

getPortfolio(): import("./types/PortfolioPositionType").PortfolioPositionType[] {
throw new Error("Method not implemented.")
getPortfolio(): import('./types/PortfolioPositionType').PortfolioPositionType[] {
throw new Error('Method not implemented.')
}

printConfig(): void {
Expand Down
11 changes: 5 additions & 6 deletions src/lib/interfaces/DeGiroClassInterface.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { CashFoundType, DeGiroSettupType } from "../types";
import { PortfolioPositionType } from "../types";
import { DeGiro } from "../DeGiro";
import { CashFoundType, DeGiroSettupType, PortfolioPositionType } from '../types'
import { DeGiro } from '../DeGiro'

/**
* @interface DeGiroClassInterface
*/
export interface DeGiroClassInterface {

login(): never

getCashFunds(): Array<CashFoundType>
getCashFunds(): CashFoundType[]

getPortfolio(): Array<PortfolioPositionType>
getPortfolio(): PortfolioPositionType[]

// setOrder

Expand Down
2 changes: 1 addition & 1 deletion src/lib/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DeGiroClassInterface } from './DeGiroClassInterface'

export {
DeGiroClassInterface
DeGiroClassInterface,
}
10 changes: 5 additions & 5 deletions src/lib/types/CashFoundType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// }

export type CashFoundType = {
id: string,
name: string,
value: number,
valueBaseCurr: number,
rate: number
id: string,
name: string,
value: number,
valueBaseCurr: number,
rate: number,
}
2 changes: 1 addition & 1 deletion src/lib/types/PortfolioPositionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
// ...

export type PortfolioPositionType = {

foo: string,
}
2 changes: 1 addition & 1 deletion src/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { PortfolioPositionType } from './PortfolioPositionType'
export {
CashFoundType,
DeGiroSettupType,
PortfolioPositionType
PortfolioPositionType,
}
2 changes: 1 addition & 1 deletion src/tests/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DeGiro from './../main'

const degiro: DeGiro = new DeGiro({
username: 'nachoogoomezomg',
pwd: '**********'
pwd: '**********',
})

degiro.printConfig()
2 changes: 1 addition & 1 deletion src/tests/static-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DeGiro from './../main'

const degiro: DeGiro = DeGiro.create({
username: 'nachoogoomezomg',
pwd: '**********'
pwd: '**********',
})

degiro.printConfig()
11 changes: 11 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"defaultSeverity": "error",
"extends": "tslint-config-airbnb",
"jsRules": {},
"rules": {
"eofline": false,
"semicolon":false,
"import-name": [false, "ignore-modules"]
},
"rulesDirectory": []
}

0 comments on commit 56dbe3b

Please sign in to comment.