From 14b67bd83b3210e6c167c947e8f9ab414f0b10c9 Mon Sep 17 00:00:00 2001 From: Tom Klein Date: Tue, 18 Jul 2023 09:15:17 +0200 Subject: [PATCH 1/2] Add Github Action test --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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..d08eb82 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: 'Build Test' + +on: + push: + branches: + - '**' + +jobs: + build-test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: + - uses: actions/checkout@v2 + - name: Running Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + # Actual Tests + - run: npm i + - run: npm run lint --if-present + - run: npm run typecheck --if-present + - run: npm run bundle --if-present From d24431ff3ddb1905c53864b9a30ed55e17c7a84a Mon Sep 17 00:00:00 2001 From: Tom Klein Date: Tue, 18 Jul 2023 10:17:27 +0200 Subject: [PATCH 2/2] fix linting --- .eslintrc.js | 38 ++++++++++++++++++++++++++++++++++++++ src/track.ts | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..b15f9b0 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,38 @@ +module.exports = { + parser: '@typescript-eslint/parser', + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + ], + plugins: ['prettier'], + env: { + node: true, + browser: true, + worker: true, + es2022: true, + }, + rules: { + 'prettier/prettier': 'error', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { ignoreRestSiblings: true, argsIgnorePattern: '^_' }, + ], + }, + overrides: [ + { + files: ['*d.ts'], + rules: { + 'no-undef': 'off', + }, + }, + { + files: ['*js'], + globals: { + webcm: 'writable', + }, + }, + ], +} + diff --git a/src/track.ts b/src/track.ts index 3c86f92..2956e6b 100644 --- a/src/track.ts +++ b/src/track.ts @@ -3,7 +3,7 @@ import { ComponentSettings, MCEvent } from '@managed-components/types' const USER_DATA: Record = { email: { hashed: true }, phone_number: { hashed: true }, - external_id: { hashed: true } + external_id: { hashed: true }, } const getTtclid = (event: MCEvent) => {