Skip to content

Commit

Permalink
Update lintest config and fix code style
Browse files Browse the repository at this point in the history
PR-URL: #240
  • Loading branch information
tshemsedinov committed Jun 25, 2022
1 parent 0830324 commit 4cb3d61
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
14 changes: 1 addition & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 2020
},
"rules": {
"arrow-parens": ["error", "always"],
"comma-dangle": "off",
"handle-callback-err": "off",
"consistent-return": "off",
"operator-linebreak": [
"error",
"after",
{ "overrides": { "?": "before", ":": "before" } }
],
"no-confusing-arrow": "off"
"ecmaVersion": "latest"
}
}
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": ["**/.*rc"],
Expand Down
4 changes: 2 additions & 2 deletions lib/pg.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const registerEntity = (model, name) => {
catId('Category') +
') WHERE "id" = (' +
catId(name) +
');'
');',
);
const categoryId = catId(name);
const flat = flatFields(entity.fields);
Expand All @@ -242,7 +242,7 @@ const registerEntity = (model, name) => {
catId('Field') +
') WHERE "id" = (' +
fldId(name, field) +
');'
');',
);
}
return { inserts: ins.join('\n'), updates: upd.join('\n') };
Expand Down
2 changes: 1 addition & 1 deletion metasql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Query {
offset(count: number): Query;
then(
resolve?: (rows: Array<object>) => unknown,
reject?: Function
reject?: Function,
): Promise<unknown>;
catch(reject?: Function): Promise<unknown>;
toString(): string;
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"pg": "^8.7.3"
},
"devDependencies": {
"@types/node": "^17.0.23",
"@types/node": "^18.0.0",
"@types/pg": "^8.6.5",
"eslint": "^8.12.0",
"eslint-config-metarhia": "^7.0.1",
"eslint-config-metarhia": "^8.1.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
8 changes: 4 additions & 4 deletions test/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const metadomain = require('metadomain');
} catch (error) {
test.assert(
error.stack.includes('test/sql.js'),
'Error stack should have query invocation file in it'
'Error stack should have query invocation file in it',
);
test.assert(error.dbStack, 'Original error stack should be preserved');
} finally {
Expand Down Expand Up @@ -159,7 +159,7 @@ const metadomain = require('metadomain');
.update(
'City',
{ name: 'ODESSA', countryId: undefined },
{ name: 'Odessa', cityId: undefined }
{ name: 'Odessa', cityId: undefined },
)
.returning(['cityId']);
test.strictEqual(res2.rowCount, 1);
Expand Down Expand Up @@ -189,7 +189,7 @@ const metadomain = require('metadomain');

await db.delete('City', { cityId }).returning('*');
test.end();
}
},
);

metatests.test('Database.insert into registry', async (test) => {
Expand Down Expand Up @@ -254,6 +254,6 @@ const metadomain = require('metadomain');

await db.delete('Counter', { counterId });
test.end();
}
},
);
})();

0 comments on commit 4cb3d61

Please sign in to comment.