From b2307627b44743d88a88896aabb0392d36012626 Mon Sep 17 00:00:00 2001 From: coderiaser Date: Mon, 17 Jun 2024 15:27:12 +0300 Subject: [PATCH] chore: lint --- .eslintrc.json | 10 ------- .github/workflows/nodejs.yml | 58 ++++++++++++++++-------------------- .madrun.js | 4 +-- README.md | 14 ++++----- eslint.config.js | 3 ++ 5 files changed, 37 insertions(+), 52 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e47bc83..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": [ - "plugin:node/recommended", - "plugin:putout/recommended" - ], - "plugins": [ - "node", - "putout" - ] -} diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0c7c2d8..0a29c53 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,40 +1,32 @@ name: Node CI - -on: [push, pull_request] - +on: + - push + - pull_request jobs: build: - runs-on: ubuntu-latest - strategy: matrix: - node-version: [14.x, 15.x] - + node-version: + - 18.x + - 20.x + - 22.x steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Install Amber - run: - curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/install.sh" | bash - - - name: Install Redrun - run: - npm i redrun -g - - - name: Install - run: - npm install - - - name: build - run: - redrun build:amber - - - name: Lint - run: - redrun lint - + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Install Amber + run: curl -s "https://raw.githubusercontent.com/Ph0enixKM/AmberNative/master/setup/install.sh" | bash + - name: Install Redrun + run: bun i redrun -g --no-save + - name: Install + run: bun i --no-save + - name: build + run: redrun build:amber + - name: Lint + run: redrun lint diff --git a/.madrun.js b/.madrun.js index 33c5828..c073560 100644 --- a/.madrun.js +++ b/.madrun.js @@ -5,7 +5,7 @@ export default { 'lint': () => run('lint:*'), 'lint:js': () => 'putout .', 'lint:bash': () => `docker run --rm -v "$PWD:/mnt" koalaman/shellcheck lib/*.sh bin/*.sh`, - 'fix:lint': () => run('lint', '--fix'), + 'fix:lint': () => run('lint:js', '--fix'), 'docker:build': () => 'docker build . -t coderaiser/loop:`version`', 'postdocker:build': () => 'docker tag coderaiser/loop:`version` coderaiser/loop:latest', 'rm:docker': () => 'docker rmi -f coderaiser/loop:`version`', @@ -21,5 +21,5 @@ export default { 'prewisdom': async () => await run(['rm:*', 'rm:docker']), 'rm:package-lock': () => 'rm -f package-lock.json', 'watcher': () => 'nodemon -w . -e sh --exec', - 'watch:lint': () => run('watcher', '\'npm run lint\''), + 'watch:lint': async () => await run('watcher', `'npm run lint'`), }; diff --git a/README.md b/README.md index 75dee1a..fb88d6e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -# Loop [![License][LicenseIMGURL]][LicenseURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] +# Loop [![License][LicenseIMGURL]][LicenseURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] -[BuildStatusURL]: https://github.com/coderaiser/loop/actions?query=workflow%3A%22Node+CI%22 "Build Status" -[BuildStatusIMGURL]: https://github.com/coderaiser/loop/workflows/Node%20CI/badge.svg -[DependencyStatusIMGURL]: https://david-dm.org/coderaiser/loop.svg?path=packages/putout -[DependencyStatusURL]: https://david-dm.org/coderaiser/loop?path=packages/putout "Dependency Status" -[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat -[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License" +[BuildStatusURL]: https://github.com/coderaiser/loop/actions?query=workflow%3A%22Node+CI%22 "Build Status" +[BuildStatusIMGURL]: https://github.com/coderaiser/loop/workflows/Node%20CI/badge.svg +[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat +[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License" Create or resize file system of an image file to use as a [loop device](https://en.wikipedia.org/wiki/Loop_device). @@ -20,6 +18,7 @@ docker run --rm coderaiser/loop ```sh docker run --rm -t -v "$PWD:/root" --name loop coderaiser/loop image.bin 100M ``` + You can pass arguments to docker container via environment variables `$FILE` and `$SIZE` as well: ```sh @@ -27,4 +26,5 @@ docker run --rm -t -v "$PWD:/root" --name loop -e "FILE=image.bin" -e "SIZE=100M ``` ## License + MIT diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..ea90e3c --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,3 @@ +import {safeAlign} from 'eslint-plugin-putout/config'; + +export default safeAlign;