Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveMBush committed Nov 21, 2024
1 parent f40769e commit bfcf387
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

permissions:
actions: read
contents: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 9

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
# Uncomment this line to enable task distribution
#- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: pnpm exec nx affected -t lint test build
10 changes: 9 additions & 1 deletion packages/eslint-plugin-rxjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"name": "@smarttools/eslint-plugin-rxjs",
"version": "0.0.1",
"dependencies": {},
"dependencies": {
"@typescript-eslint/utils": "^8.13.0",
"@typescript-eslint/rule-tester": "^8.13.0",
"common-tags": "^1.8.2",
"decamelize": "^5.0.1",
"typescript": "~5.5.4",
"tsutils": "^3.21.0",
"tsutils-etc": "^1.4.2"
},
"type": "commonjs",
"main": "./index.cjs"
}
16 changes: 15 additions & 1 deletion packages/eslint-plugin-rxjs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Linter } from '@typescript-eslint/utils/ts-eslint';
import recommended from './lib/configs/recommended';

import banObservables from './lib/rules/ban-observables';
import banOperators from './lib/rules/ban-operators';
Expand Down Expand Up @@ -91,4 +92,17 @@ const rules = {
'throw-error': throwError,
} satisfies Linter.PluginRules;

export default { meta, rules } satisfies Linter.Plugin;
const plugin: Linter.Plugin = {
meta, rules, configs: {}
};

plugin.configs = {
recommended: {
plugins: ['rxjs'],
rules: {
...recommended.rules,
},
},
};

export default plugin;
4 changes: 3 additions & 1 deletion packages/eslint-plugin-rxjs/src/lib/configs/recommended.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Linter } from '@typescript-eslint/utils/ts-eslint';

export = {
plugins: ['rxjs'],
rules: {
Expand All @@ -16,5 +18,5 @@ export = {
'rxjs/no-unbound-methods': 'error',
'rxjs/no-unsafe-subject-next': 'error',
'rxjs/no-unsafe-takeuntil': 'error',
},
} as Linter.RulesRecord,
};

0 comments on commit bfcf387

Please sign in to comment.