diff --git a/.eslintrc.js b/.eslintrc.js index 93e509c3..519f5cd6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,7 +21,6 @@ module.exports = { plugins: [ 'html', 'node', - 'cypress', '@typescript-eslint', 'jest', '@typescript-eslint', diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 6a65abdf..d2ceae19 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -14,6 +14,25 @@ concurrency: # TODO(@raducristianpopa): add lint/format checks and tests jobs: + checks: + name: ESLint, Prettier & Typecheck + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Environment setup + uses: ./.github/actions/setup + + - name: Lint + run: pnpm lint + + - name: Format + run: pnpm format + + - name: Typecheck + run: pnpm typecheck + build-extension: name: Build Extension strategy: diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index e8aeea55..894618b0 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -5,9 +5,28 @@ on: branches: - main -# TODO(@raducristianpopa): add lint/format checks and tests +# TODO(@raducristianpopa): add server tests jobs: + checks: + name: ESLint, Prettier, Typecheck + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Environment setup + uses: ./.github/actions/setup + + - name: Lint + run: pnpm lint + + - name: Format + run: pnpm format + + - name: Typecheck + run: pnpm typecheck + build-extension: name: Build extension strategy: diff --git a/package.json b/package.json index 4ab8cdd4..a66fb99e 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ "format": "prettier --check .", "format:fix": "prettier --write .", "lint": "pnpm -r lint", - "lint:fix": "pnpm -r lint:fix eslint --ext js,jsx,ts,tsx, src --fix && prettier --write .", - "typecheck": "pnpm -r typecheck", + "lint:fix": "pnpm -r lint:fix", "test": "pnpm -r test", + "test:ci": "pnpm -r test:ci", + "typecheck": "pnpm -r typecheck", "extension": "pnpm --filter @interledger/wm-extension", "wm-server": "pnpm --filter @interledger/wm-server" }, @@ -32,6 +33,7 @@ "eslint-plugin-babel": "^5.3.1", "eslint-plugin-html": "^7.1.0", "eslint-plugin-import": "^2.28.0", + "eslint-plugin-jest": "^27.6.3", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-react": "^7.33.2", diff --git a/packages/server/package.json b/packages/server/package.json index 72b5b719..4fbb7e19 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -12,8 +12,9 @@ "scripts": { "build": "tsc", "dev": "tsx --watch ./src/index.ts", - "lint": "eslint . --ext js,ts --max-warnings 0", - "lint:fix": "eslint . --ext ts --fix" + "lint": "eslint . --ext ts --cache --cache-location 'node_modules/.cache/.eslintcache' --max-warnings 0", + "lint:fix": "eslint . --ext ts --cache --cache-location 'node_modules/.cache/.eslintcache' --fix", + "typecheck": "tsc --noEmit" }, "dependencies": { "@interledger/http-signature-utils": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8526c93..6e46d50f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: eslint-plugin-import: specifier: ^2.28.0 version: 2.29.0(@typescript-eslint/parser@6.13.2)(eslint@8.55.0) + eslint-plugin-jest: + specifier: ^27.6.3 + version: 27.6.3(@typescript-eslint/eslint-plugin@6.13.2)(eslint@8.55.0)(jest@29.7.0)(typescript@5.3.3) eslint-plugin-jsx-a11y: specifier: ^6.7.1 version: 6.8.0(eslint@8.55.0) @@ -1710,6 +1713,14 @@ packages: - supports-color dev: true + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 + dev: true + /@typescript-eslint/scope-manager@6.13.2: resolution: {integrity: sha512-CXQA0xo7z6x13FeDYCgBkjWzNqzBn8RXaE3QVQVIUm74fWJLkJkaHmHdKStrxQllGh6Q4eUGyNpMe0b1hMkXFA==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1738,11 +1749,37 @@ packages: - supports-color dev: true + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@typescript-eslint/types@6.13.2: resolution: {integrity: sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/typescript-estree@6.13.2(typescript@5.3.3): resolution: {integrity: sha512-SuD8YLQv6WHnOEtKv8D6HZUzOub855cfPnPMKvdM/Bh1plv1f7Q/0iFUDLKKlxHcEstQnaUU4QZskgQq74t+3w==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1764,6 +1801,26 @@ packages: - supports-color dev: true + /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.3.3): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.6 + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) + eslint: 8.55.0 + eslint-scope: 5.1.1 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/utils@6.13.2(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-b9Ptq4eAZUym4idijCRzl61oPCwwREcfDI8xGk751Vhzig5fFZR9CyzDz4Sp/nxSLBYxUPyh4QdIDqWykFhNmQ==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1783,6 +1840,14 @@ packages: - typescript dev: true + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.62.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@typescript-eslint/visitor-keys@6.13.2: resolution: {integrity: sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -3450,6 +3515,28 @@ packages: - supports-color dev: true + /eslint-plugin-jest@27.6.3(@typescript-eslint/eslint-plugin@6.13.2)(eslint@8.55.0)(jest@29.7.0)(typescript@5.3.3): + resolution: {integrity: sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 + eslint: ^7.0.0 || ^8.0.0 + jest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + jest: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 6.13.2(@typescript-eslint/parser@6.13.2)(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) + eslint: 8.55.0 + jest: 29.7.0(@types/node@20.10.4)(ts-node@10.9.2) + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /eslint-plugin-jsx-a11y@6.8.0(eslint@8.55.0): resolution: {integrity: sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==} engines: {node: '>=4.0'} @@ -6878,6 +6965,10 @@ packages: strip-bom: 3.0.0 dev: true + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true + /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -6886,6 +6977,16 @@ packages: engines: {node: '>=0.6.x'} dev: false + /tsutils@3.21.0(typescript@5.3.3): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 5.3.3 + dev: true + /tsx@4.7.0: resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==} engines: {node: '>=18.0.0'}