Skip to content

Commit

Permalink
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.61.0 to…
Browse files Browse the repository at this point in the history
… 6.9.0 (#203)

* chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.61.0 to 6.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix pr

* run eslint and prettier in separate ci job

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lion Ralfs <[email protected]>
  • Loading branch information
dependabot[bot] and lionralfs authored Oct 23, 2023
1 parent 93d841e commit 2d478fb
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 387 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ module.exports = {
es2021: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
// 'plugin:@typescript-eslint/stylistic-type-checked',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: true,
},
plugins: ['@typescript-eslint'],
rules: {
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ on:
branches: [ main ]

jobs:
lint:
# run lint in separate stage so we can use the latest nodejs
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run prettier
- run: npm run lint

build:

runs-on: ubuntu-latest
Expand All @@ -27,8 +45,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run prettier
- run: npm run lint
- run: npm test
- run: npm run build
- run: cd test/commonjs && node index.js
2 changes: 1 addition & 1 deletion lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export class DiscogsClient {
}
callback(err, data, rateLimit);
})
.catch(err => {
.catch((err: Error) => {
callback(err);
});
}
Expand Down
15 changes: 12 additions & 3 deletions lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ export function escape(str: string): string {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function merge(target: Record<any, any>, source: Record<any, any>): Record<any, any> {
for (const key in source) {
if (source[key] && typeof source[key] === 'object') {
target[key] = merge(Array.isArray(source[key]) ? [] : {}, source[key]);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const value = source[key];
if (isObject(value)) {
target[key] = merge(Array.isArray(value) ? [] : {}, value);
} else {
target[key] = source[key];
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
target[key] = value;
}
}
return target;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isObject(value: any): value is object {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value && typeof value === 'object';
}
Loading

0 comments on commit 2d478fb

Please sign in to comment.