Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPC-9504: Upgrade to ESLint 9 #161

Merged
merged 7 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const baseConfig = require('@unocha/hpc-repo-tools/eslint.config.base');

module.exports = [
...baseConfig,
{
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-require-imports': 'off',
},
},
{
ignores: ['.github', '.prettierrc.js', 'eslint.config.js'],
},
];
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unocha/hpc-api-core",
"version": "9.0.0",
"version": "10.0.0",
"description": "Core libraries supporting HPC.Tools API Backend",
"license": "Apache-2.0",
"private": false,
Expand All @@ -13,8 +13,8 @@
"lint": "yarn lint-prettier && yarn lint-eslint"
},
"engines": {
"node": ">=18.18.2 || >=20.9.0",
"yarn": ">=1.22.10"
"node": ">=20.15.1",
"yarn": ">=1.22.22"
},
"dependencies": {
"@types/lodash": "^4.17.7",
Expand All @@ -31,8 +31,8 @@
"@types/jest": "^29.5.12",
"@types/node": "^22.5.3",
"@types/pg": "^8.11.8",
"@unocha/hpc-repo-tools": "^4.2.0",
"eslint": "^8.57.0",
"@unocha/hpc-repo-tools": "^5.0.0",
"eslint": "^9.9.1",
"husky": "^9.1.5",
"jest": "^29.7.0",
"lint-staged": "^15.2.10",
Expand Down
10 changes: 6 additions & 4 deletions src/lib/data/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,18 +405,20 @@ const disaggregationData = <T extends t.Mixed>(additionalFields: T) =>
export const DISAGGREGATION_DATA = disaggregationData(t.type({}));
type DisaggregationData = t.TypeOf<typeof DISAGGREGATION_DATA>;

const EXTENDED_DISAGGREGATION_DATA = disaggregationData(
const _EXTENDED_DISAGGREGATION_DATA = disaggregationData(
t.type({
lIndex: t.number,
cIndex: t.number,
})
);
type ExtendedDisaggregationData = t.TypeOf<typeof EXTENDED_DISAGGREGATION_DATA>;
type ExtendedDisaggregationData = t.TypeOf<
typeof _EXTENDED_DISAGGREGATION_DATA
>;

const DISAGGREGATION_MATRIX = t.array(
const _DISAGGREGATION_MATRIX = t.array(
t.array(t.union([EMPTY_TUPLE, t.tuple([t.number])]))
);
type DisaggregationMatrix = t.TypeOf<typeof DISAGGREGATION_MATRIX>;
type DisaggregationMatrix = t.TypeOf<typeof _DISAGGREGATION_MATRIX>;

/**
* Utility method that gets disaggregation data of an
Expand Down
15 changes: 7 additions & 8 deletions tests/utils/connection.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import * as t from 'io-ts';
import { knex } from 'knex';

const CONFIG = t.type({
host: t.string,
port: t.number,
user: t.string,
database: t.string,
});
type ConnectionConfig = {
host: string;
port: number;
user: string;
database: string;
};

/**
* Initialize a new Postgres provider
*/
export async function createDbConnection(connection: t.TypeOf<typeof CONFIG>) {
export async function createDbConnection(connection: ConnectionConfig) {
const knexInstance = knex({
client: 'pg',
connection,
Expand Down
Loading