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

fix: Fix Memory Leaks & other minor fixes #15

Merged
merged 22 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
96d2ccf
chore: Add @smithy/types for correct type for s3 client
binaryoverload Jan 7, 2025
1fd43ce
fix: Use Stream.pipeline for response stream to properly close s3 stream
binaryoverload Jan 7, 2025
068a635
perf: Remove sync IO from npdi and npts
binaryoverload Jan 7, 2025
956852f
chore: Add lint:fix script and fix auto-fixable linting issues
binaryoverload Jan 7, 2025
f4b8f44
chore: Update dependencies in package.json
binaryoverload Jan 7, 2025
9971f8f
fix: Only response if not sentHeaders and log error message
binaryoverload Jan 7, 2025
c3c1dd2
refactor: Update logger to use console.error for error logging
binaryoverload Jan 7, 2025
d77c15d
refactor: Use LOG_ERROR for error logging for timestamps
binaryoverload Jan 7, 2025
69609c3
fix: Add properly padded timestamp to logger with date added
binaryoverload Jan 7, 2025
9fff2a4
fix: Correct typo in Content-Type header value
binaryoverload Jan 7, 2025
6f292b6
Revert "fix: Correct typo in Content-Type header value" and add comment
binaryoverload Jan 7, 2025
aae2435
Apply suggestions from code review
binaryoverload Jan 8, 2025
7e37300
chore: add .editorconfig and move scripts into folder, remove logger …
binaryoverload Jan 8, 2025
ab0a6cc
refactor: remove authentication middleware - unneeded and caused esli…
binaryoverload Jan 8, 2025
a5dbb27
chore: add JSON and YML exceptions to editorconfig
binaryoverload Jan 8, 2025
8689988
feat: Add linting GitHub actions workflow
binaryoverload Jan 8, 2025
065f57c
fix: add getNEXDataByPID import to spr
binaryoverload Jan 8, 2025
60df36a
chore: update eslint + deps, add new rules, update tsconfig
binaryoverload Jan 8, 2025
45d2be8
style: run new eslint on PR affected files
binaryoverload Jan 8, 2025
9bebbe6
style: run new eslint config on EVERYTHING ELSE
binaryoverload Jan 8, 2025
eb2585d
Revert "refactor: remove authentication middleware - unneeded and cau…
binaryoverload Jan 8, 2025
546ae04
chore: update eslint to disable atomic-updates checks
binaryoverload Jan 8, 2025
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = tab
end_of_line = lf
insert_final_newline = true

[*.json]
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on:
pull_request: {}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint
113 changes: 113 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// @ts-check

/* eslint-disable import/no-named-as-default-member -- We want to be able to use the full package name for the imports here for clarity */

import eslint from '@eslint/js';
import eslintCommentPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs';
import stylisticPlugin from '@stylistic/eslint-plugin';
// @ts-expect-error importPlugin is not typed
import importPlugin from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';

/**
* Typed to any as the type is incompatible for some reason - it works!
* @type {any}
*/
const stylisticConfig = stylisticPlugin.configs.customize({
indent: 'tab',
quotes: 'single',
semi: true,
commaDangle: 'never',
braceStyle: '1tbs'
});

/**
* Typed to any as the type is incompatible for some reason - it works!
* @type {any}
*/
const eslintCommentPluginConfig = eslintCommentPlugin.recommended;

export default tseslint.config(
{
// https://eslint.org/docs/rules/
extends: [eslint.configs.recommended],
rules: {
'require-atomic-updates': 'warn',
'no-console': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-unused-vars': 'off',
'one-var': ['error', 'never']
}
},
{
// https://typescript-eslint.io/rules/
extends: [tseslint.configs.recommended],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' }
],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': ['off'],
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/consistent-type-imports': ['error', {
fixStyle: 'separate-type-imports'
}]
}
},
{
// https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/
extends: [eslintCommentPluginConfig],
rules: {
'@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'@eslint-community/eslint-comments/require-description': 'error'
}
},
{
// https://eslint.style/rules
extends: [stylisticConfig],
rules: {
'@stylistic/no-extra-semi': 'error',
'@stylistic/yield-star-spacing': ['error', 'after'],
'@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before' } }],
'@stylistic/curly-newline': ['error', {
multiline: true,
consistent: true
}],
'@stylistic/object-curly-newline': ['error', {
multiline: true,
consistent: true
}]
}
},
{
// https://www.npmjs.com/package/eslint-plugin-import
extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.warnings, importPlugin.flatConfigs.typescript],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json'
},
node: true
}
},
rules: {
'import/order': ['warn', {
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'never'
}],
'import/first': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level']
}
},
{
ignores: [
'scripts/*',
'dist/*'
]
}
);
52 changes: 0 additions & 52 deletions logger.js

This file was deleted.

Loading
Loading