Skip to content

Commit 00959be

Browse files
committed
Applying linter to packages/core/src
1 parent 70eb49d commit 00959be

31 files changed

+810
-773
lines changed

packages/core/src/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
const auth = {
3131
basic: (username: string, password: string, realm?: string) => {
32-
if (realm) {
32+
if (realm != null) {
3333
return {
3434
scheme: 'basic',
3535
principal: username,
@@ -77,12 +77,12 @@ const auth = {
7777
}
7878
}
7979

80-
function isNotEmpty<T extends object | string>(value: T | null | undefined): boolean {
80+
function isNotEmpty<T extends object | string> (value: T | null | undefined): boolean {
8181
return !(
8282
value === null ||
8383
value === undefined ||
8484
value === '' ||
85-
Object.getPrototypeOf(value) === Object.prototype && Object.keys(value).length === 0
85+
(Object.getPrototypeOf(value) === Object.prototype && Object.keys(value).length === 0)
8686
)
8787
}
8888

packages/core/src/connection-provider.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19+
/* eslint-disable @typescript-eslint/promise-function-async */
1920

2021
import Connection from './connection'
2122
import { bookmarks } from './internal'
2223
import { ServerInfo } from './result-summary'
2324

24-
2525
/**
2626
* Inteface define a common way to acquire a connection
2727
*
@@ -44,11 +44,11 @@ class ConnectionProvider {
4444
* @property {string} param.impersonatedUser - the impersonated user
4545
* @property {function (databaseName:string?)} param.onDatabaseNameResolved - Callback called when the database name get resolved
4646
*/
47-
acquireConnection(param?: {
47+
acquireConnection (param?: {
4848
accessMode?: string
4949
database?: string
50-
bookmarks: bookmarks.Bookmarks,
51-
impersonatedUser?: string,
50+
bookmarks: bookmarks.Bookmarks
51+
impersonatedUser?: string
5252
onDatabaseNameResolved?: (databaseName?: string) => void
5353
}): Promise<Connection> {
5454
throw Error('Not implemented')
@@ -60,7 +60,7 @@ class ConnectionProvider {
6060
*
6161
* @returns {Promise<boolean>}
6262
*/
63-
supportsMultiDb(): Promise<boolean> {
63+
supportsMultiDb (): Promise<boolean> {
6464
throw Error('Not implemented')
6565
}
6666

@@ -70,7 +70,7 @@ class ConnectionProvider {
7070
*
7171
* @returns {Promise<boolean>}
7272
*/
73-
supportsTransactionConfig(): Promise<boolean> {
73+
supportsTransactionConfig (): Promise<boolean> {
7474
throw Error('Not implemented')
7575
}
7676

@@ -80,7 +80,7 @@ class ConnectionProvider {
8080
*
8181
* @returns {Promise<boolean>}
8282
*/
83-
supportsUserImpersonation(): Promise<boolean> {
83+
supportsUserImpersonation (): Promise<boolean> {
8484
throw Error('Not implemented')
8585
}
8686

@@ -94,7 +94,7 @@ class ConnectionProvider {
9494
*
9595
* @returns {Promise<ServerInfo>} promise resolved with server info or rejected with error.
9696
*/
97-
verifyConnectivityAndGetServerInfo(param? :{ database?: string, accessMode?: string }): Promise<ServerInfo> {
97+
verifyConnectivityAndGetServerInfo (param?: { database?: string, accessMode?: string }): Promise<ServerInfo> {
9898
throw Error('Not implemented')
9999
}
100100

@@ -103,7 +103,7 @@ class ConnectionProvider {
103103
*
104104
* @returns {Promise<void>}
105105
*/
106-
close(): Promise<void> {
106+
close (): Promise<void> {
107107
throw Error('Not implemented')
108108
}
109109
}

packages/core/src/connection.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19+
/* eslint-disable @typescript-eslint/promise-function-async */
1920

2021
import { ServerAddress } from './internal/server-address'
2122

@@ -25,28 +26,28 @@ import { ServerAddress } from './internal/server-address'
2526
*/
2627
class Connection {
2728
get id (): string {
28-
return ""
29+
return ''
2930
}
3031

31-
get databaseId(): string {
32-
return ""
32+
get databaseId (): string {
33+
return ''
3334
}
3435

35-
get server(): any {
36+
get server (): any {
3637
return {}
3738
}
3839

3940
/**
4041
* @property {ServerAddress} the server address this connection is opened against
4142
*/
42-
get address(): ServerAddress | undefined {
43+
get address (): ServerAddress | undefined {
4344
return undefined
4445
}
4546

4647
/**
4748
* @property {ServerVersion} the version of the server this connection is connected to
4849
*/
49-
get version(): any {
50+
get version (): any {
5051
return undefined
5152
}
5253

0 commit comments

Comments
 (0)