Skip to content

Commit

Permalink
Add eslint fix (#21)
Browse files Browse the repository at this point in the history
* docs: update README.md with new package name
* chore: add eslint9 with basic config
* fix: fix lint issues
  • Loading branch information
T1B0 authored Nov 27, 2024
1 parent d294d5c commit 044270d
Show file tree
Hide file tree
Showing 42 changed files with 1,296 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
# - run: npm run lint
- run: npm run lint
- run: npm run build
- run: npm run test

Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ iggy node.js client for [iggy-rs](https://iggy.rs/)'s binary protocol, written i

diclaimer: although all iggy commands & basic client/stream are implemented this is still a WIP, provided as is, and has still a long way to go to be considered "battle tested".

note: This lib started as _iggy-bin_ ( [github](https://github.com/T1B0/iggy-bin) / [npm](https://www.npmjs.com/package/iggy-bin)) before migrating under iggy-rs org. package [email protected] is equivalent to @iggy.rs/[email protected]


note: previous works on node.js http client has been moved to [iggy-node-http-client](<https://github.com/iggy-rs/iggy-node-http-client) (moved on 04 July 2024)

## install

```
$ npm i iggy-bin
$ npm i @iggy.rs/sdk
```

## basic usage

```ts
import { Client } from "iggy-bin";
import { Client } from "@iggy.rs/sdk";

const credentials = { username: "iggy", password: "iggy" };

Expand Down Expand Up @@ -44,6 +47,20 @@ $ npm run build

### test

#### unit tests
```
$ npm run test
```

#### e2e tests

e2e test expect an iggy-server at tcp://127.0.0.1:8090
```
$ npm run test:e2e
```

### lint

```
$ npm run lint
```
58 changes: 58 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { builtinModules } from "module"

// import jsLint from "@eslint/js"
// import stylistic from "@stylistic/eslint-plugin"
// import globals from "globals"
import tsLint from "typescript-eslint"

export default [
// config parsers
{
files: ["**/*.{js,mjs,cjs,ts}"]
},
{
languageOptions: {
// globals: {
// ...globals.node
// }
}
},
// rules
// jsLint.configs.recommended,
...tsLint.configs.recommended,
{
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "separate-type-imports"
}
]
}
},
{
plugins: {

},
},

// see: https://eslint.style/guide/getting-started
// see: https://github.com/eslint-stylistic/eslint-stylistic/blob/main/packages/eslint-plugin/configs/disable-legacy.ts
// stylistic.configs["disable-legacy"],
// stylistic.configs.customize({
// indent: 4,
// quotes: "double",
// semi: false,
// commaDangle: "never",
// jsx: true
// }),

{
// https://eslint.org/docs/latest/use/configure/ignore
ignores: [
"node_modules",
"dist",
]
}
]
Loading

0 comments on commit 044270d

Please sign in to comment.