From e0687a3b254f9bd2d73803623c761f74786b0d9f Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Thu, 4 Jul 2024 22:15:02 +0200 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=A4=96=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 28 ++++++++++++ eslint.config.cjs | 56 ++++++++++++------------ tools/plugins/implicit-libs/project.json | 4 +- 3 files changed, 57 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..aee57ed --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + push: + +jobs: + test: + name: Test + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: 22 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - run: bun install --frozen-lockfile --ignore-scripts + - run: bunx nx format:check + - run: bunx nx run-many -t build lint test diff --git a/eslint.config.cjs b/eslint.config.cjs index 9f869cc..09e943c 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -4,7 +4,7 @@ const js = require('@eslint/js'); const compat = new FlatCompat({ baseDirectory: __dirname, - recommendedConfig: js.configs.recommended + recommendedConfig: js.configs.recommended, }); module.exports = [ @@ -13,8 +13,8 @@ module.exports = [ ...config, files: ['**/*.json'], rules: { - ...config.rules - } + ...config.rules, + }, })), { files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], @@ -23,10 +23,10 @@ module.exports = [ 'warn', { argsIgnorePattern: '^_', - destructuredArrayIgnorePattern: '^_' - } - ] - } + destructuredArrayIgnorePattern: '^_', + }, + ], + }, }, { files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], @@ -45,8 +45,8 @@ module.exports = [ 'type:domain', 'type:infra', 'type:model', - 'type:util' - ] + 'type:util', + ], }, { sourceTag: 'type:feature', @@ -56,12 +56,12 @@ module.exports = [ 'type:domain', 'type:infra', 'type:model', - 'type:util' - ] + 'type:util', + ], }, { sourceTag: 'type:ui', - onlyDependOnLibsWithTags: ['type:ui', 'type:model', 'type:util'] + onlyDependOnLibsWithTags: ['type:ui', 'type:model', 'type:util'], }, { sourceTag: 'type:domain', @@ -69,42 +69,42 @@ module.exports = [ 'type:domain', 'type:infra', 'type:model', - 'type:util' - ] + 'type:util', + ], }, { sourceTag: 'type:infra', onlyDependOnLibsWithTags: [ 'type:infra', 'type:model', - 'type:util' - ] + 'type:util', + ], }, { sourceTag: 'type:model', - onlyDependOnLibsWithTags: ['type:model', 'type:util'] + onlyDependOnLibsWithTags: ['type:model', 'type:util'], }, { sourceTag: 'type:util', - onlyDependOnLibsWithTags: ['type:util'] - } - ] - } - ] - } + onlyDependOnLibsWithTags: ['type:util'], + }, + ], + }, + ], + }, }, ...compat.config({ extends: ['plugin:@nx/typescript'] }).map((config) => ({ ...config, files: ['**/*.ts', '**/*.tsx'], rules: { - ...config.rules - } + ...config.rules, + }, })), ...compat.config({ extends: ['plugin:@nx/javascript'] }).map((config) => ({ ...config, files: ['**/*.js', '**/*.jsx'], rules: { - ...config.rules - } - })) + ...config.rules, + }, + })), ]; diff --git a/tools/plugins/implicit-libs/project.json b/tools/plugins/implicit-libs/project.json index 78c5cd7..a402b15 100644 --- a/tools/plugins/implicit-libs/project.json +++ b/tools/plugins/implicit-libs/project.json @@ -18,9 +18,7 @@ "{projectRoot}/eslint.config.cjs", "{workspaceRoot}/tools/eslint-rules/**/*", { - "externalDependencies": [ - "eslint" - ] + "externalDependencies": ["eslint"] } ], "outputs": ["{options.outputFile}"]