Skip to content

Commit

Permalink
Setup Code Push with EsLint Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherPHolder authored Mar 11, 2024
2 parents a2626b8 + db7d5cd commit 8f03326
Show file tree
Hide file tree
Showing 23 changed files with 5,700 additions and 791 deletions.
40 changes: 20 additions & 20 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"extends": [
"@code-pushup/eslint-config/typescript",
"@code-pushup/eslint-config/node",
"@code-pushup/eslint-config/jest"
],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "tsconfig.base.json"
}
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ jobs:
run: npm run nx -- run-many -t build --skip-nx-cache --parallel=false
- name: test
run: npm run nx -- run-many -t test --skip-nx-cache --parallel=false

# Code PushUp command
- name: Collect and upload Code PushUp report
run: npx code-pushup autorun
env:
CP_API_KEY: ${{ secrets.CP_API_KEY }}
NODE_OPTIONS: --max-old-space-size=8192
- name: Save report files as workflow artifact
uses: actions/upload-artifact@v3
with:
name: code-pushup-report
path: .code-pushup/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ testem.log
.DS_Store
Thumbs.db

.nx/cache
.nx/cache

.env
.code-pushup
32 changes: 32 additions & 0 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import eslintPlugin, { eslintConfigFromNxProjects } from '@code-pushup/eslint-plugin';
import type { CoreConfig } from '@code-pushup/models';
import 'dotenv/config';

const config: CoreConfig = {
upload: {
server: 'https://portal-api-r6nh2xm7mq-ez.a.run.app/graphql',
apiKey: process.env.CP_API_KEY,
organization: 'push-based',
project: 'user-flow',
},
plugins: [
await eslintPlugin(await eslintConfigFromNxProjects()),
],
categories: [
{
slug: 'bug-prevention',
title: 'Bug prevention',
refs: [{ type: 'group', plugin: 'eslint', slug: 'problems', weight: 100 }],
},
{
slug: 'code-style',
title: 'Code style',
refs: [
{ type: 'group', plugin: 'eslint', slug: 'suggestions', weight: 75 },
{ type: 'group', plugin: 'eslint', slug: 'formatting', weight: 25 },
],
},
],
};

export default config;
Loading

0 comments on commit 8f03326

Please sign in to comment.