From a75ccb1ffdbad49a70e1f60f7bdce37e6cda0e76 Mon Sep 17 00:00:00 2001 From: Nodari Chkuaselidze Date: Tue, 13 Jun 2023 20:45:26 +0400 Subject: [PATCH 1/2] pkg: add ci. --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ package-lock.json | 32 ++++++++++++++++++++++++++ package.json | 4 ++-- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 package-lock.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d6350dd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build + +on: [push, pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Install tools + run: npm install --location=global bslint + + - name: Install dependencies + run: npm install + + - name: Lint + run: npm run lint + + - name: Lint types + run: npm run lint-types + + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Install dependencies + run: npm install + + - name: Test + run: npm run test diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..bf12e2e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,32 @@ +{ + "name": "bufio", + "version": "1.0.7", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bufio", + "version": "1.0.7", + "license": "MIT", + "devDependencies": { + "bmocha": "^2.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bmocha": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/bmocha/-/bmocha-2.1.8.tgz", + "integrity": "sha512-bog23Ckl9lRyBxrsi4FmX1rTz4d1WhHRpIA+q2lpoiXmNuroMHr1JUOU5sPiMZwvhLCxqffvWv3xCJC7PC126w==", + "dev": true, + "bin": { + "_bmocha": "bin/_bmocha", + "bmocha": "bin/bmocha" + }, + "engines": { + "node": ">=8.0.0" + } + } + } +} diff --git a/package.json b/package.json index 52c0923..49e27c4 100644 --- a/package.json +++ b/package.json @@ -15,14 +15,14 @@ "author": "Christopher Jeffrey ", "main": "./lib/bufio.js", "scripts": { - "lint": "eslint lib/ test/ || exit 0", + "lint": "eslint lib/ test/", "test": "bmocha --reporter spec test/*-test.js" }, "devDependencies": { "bmocha": "^2.1.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=14.0.0" }, "browser": { "./lib/custom": "./lib/custom-browser.js" From 286e1e5fffea8edaa126a0d4cac11dfdd5c8cfad Mon Sep 17 00:00:00 2001 From: Nodari Chkuaselidze Date: Tue, 13 Jun 2023 20:52:33 +0400 Subject: [PATCH 2/2] lint: add test rules update. --- .eslintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 4db51ca..3de38b4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,7 +39,8 @@ }, "rules": { "max-len": "off", - "prefer-arrow-callback": "off" + "prefer-arrow-callback": "off", + "no-return-assign": "off" } } ],