Skip to content

Commit

Permalink
Migrate eslint-plugin-lvksh (#33)
Browse files Browse the repository at this point in the history
* Yolk

* Update Linting and apply rules

* Upgrade eslint-plugin-lvksh
  • Loading branch information
lucemans authored Jan 6, 2022
1 parent a837e74 commit 998f101
Show file tree
Hide file tree
Showing 8 changed files with 429 additions and 351 deletions.
38 changes: 4 additions & 34 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,12 @@
"ecmaVersion": 2021
},
"extends": [
"plugin:radar/recommended",
"eslint:recommended",
"eslint:recommended"
"plugin:lvksh/recommended"
],
"ignorePatterns": ["!**/*"],
"plugins": [
"simple-import-sort",
"radar",
"unicorn",
"jest"
],
"plugins": ["lvksh"],
"env": {
"node": true,
"jest/globals": true
"node": true
},
"rules": {
"quotes": ["error", "single"],
"semi": ["error", "always"],
"linebreak-style": ["error", "unix"],
"indent": ["error", 4],
"unicorn/prefer-spread": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"no-unused-vars": "off",
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": ["return", "if", "switch", "try"]
},
{
"blankLine": "always",
"prev": ["if", "switch", "try"],
"next": "*"
}
]
}
"rules": {}
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
"license": "LGPL-3.0-or-later",
"devDependencies": {
"@types/jest": "^27.0.2",
"@typescript-eslint/parser": "^5.2.0",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"chalk": "^4.1.2",
"eslint": "^8.1.0",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-radar": "^0.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unicorn": "^37.0.1",
"eslint": "^8.6.0",
"eslint-plugin-jest": "^25.3.4",
"eslint-plugin-lvksh": "^1.2.2",
"jest": "^27.2.5",
"jest-nyancat-reporter": "^2.0.0",
"ts-jest": "^27.0.5",
Expand Down
27 changes: 13 additions & 14 deletions src/BatchBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { types } from 'cassandra-driver';
import { inspect } from 'util';
import { inspect } from 'node:util';

import {
createIndexRaw,
Expand Down Expand Up @@ -34,8 +34,8 @@ export class BatchBuilder<Tables extends TableScheme> {
return this.query({ query, args: [] });
}

rawWithParams(query: string, args: any[]) {
return this.query({ query, args });
rawWithParams(query: string, arguments_: any[]) {
return this.query({ query, args: arguments_ });
}

useKeyspace(keyspace: string, createIfNotExists = false) {
Expand All @@ -54,13 +54,13 @@ export class BatchBuilder<Tables extends TableScheme> {

insertInto<Table extends keyof Tables>(
table: Table,
obj: Partial<Tables[Table]>,
object: Partial<Tables[Table]>,
extra?: string
) {
const query = insertIntoRaw<Tables, Table>(
this.keyspace,
table,
obj,
object,
extra
);

Expand All @@ -69,14 +69,14 @@ export class BatchBuilder<Tables extends TableScheme> {

update<Table extends keyof Tables, ColumnName extends keyof Tables[Table]>(
table: Table,
obj: Partial<Tables[Table]>,
object: Partial<Tables[Table]>,
criteria: { [key in ColumnName]?: Tables[Table][key] | string },
extra?: string
) {
const query = updateRaw<Tables, Table, ColumnName>(
this.keyspace,
table,
obj,
object,
criteria,
extra
);
Expand All @@ -94,13 +94,12 @@ export class BatchBuilder<Tables extends TableScheme> {
criteria: { [key in ColumnName]?: Tables[Table][key] | string },
extra?: string
) {
const query = deleteFromRaw<Tables, Table, ColumnName, DeletedColumnName>(
this.keyspace,
table,
fields,
criteria,
extra
);
const query = deleteFromRaw<
Tables,
Table,
ColumnName,
DeletedColumnName
>(this.keyspace, table, fields, criteria, extra);

return this.query(query);
}
Expand Down
Loading

0 comments on commit 998f101

Please sign in to comment.