Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Code Push with EsLint Plugin #262

Merged
merged 22 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
275fa7e
fix: initial code-pushup setup
ChristopherPHolder Feb 5, 2024
4c275ca
fix: add gitignore
ChristopherPHolder Feb 5, 2024
16d91d0
fix: setup eslint plugin for nx mono repo
ChristopherPHolder Feb 5, 2024
6e55c83
fix: gitignore code-pushup reports
ChristopherPHolder Feb 5, 2024
c9c5d21
fix: add code-pushup to pipeline
ChristopherPHolder Feb 28, 2024
70785d9
fix: code-pushup fix upload config
ChristopherPHolder Feb 28, 2024
0cf0d75
fix: update packages
ChristopherPHolder Feb 28, 2024
4f942bf
fix: reduce noise
ChristopherPHolder Feb 28, 2024
d8943a4
fix: configure to target cli
ChristopherPHolder Feb 28, 2024
f2fa0b1
fix: fix baseline configs
ChristopherPHolder Feb 29, 2024
0927cc9
fix: add eslint-plugin-jest
ChristopherPHolder Feb 29, 2024
3ab8b69
fix: add eslint-plugin-jest
ChristopherPHolder Feb 29, 2024
d05e79a
fix: fix configs and add dependencies
ChristopherPHolder Feb 29, 2024
a1b7d3f
fix: test extend @code-pushup
ChristopherPHolder Feb 29, 2024
e5bdc8e
fix: test extend @code-pushup
ChristopherPHolder Feb 29, 2024
5c41032
fix: add extends @code-pushup
ChristopherPHolder Mar 5, 2024
6f6df0c
fix: add extends eslint
ChristopherPHolder Mar 5, 2024
80ddd0b
fix: cleanup setup
ChristopherPHolder Mar 5, 2024
0e7214a
test: remove test skip
ChristopherPHolder Mar 5, 2024
3dcf3f7
test: reduce test complexity config code-pushup
ChristopherPHolder Mar 8, 2024
02683aa
test: re implement @nx/enforce-module-boundaries
ChristopherPHolder Mar 11, 2024
db7d5cd
test: fix dependencies
ChristopherPHolder Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,18 @@
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
"extends": [
"@code-pushup",
"@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"
}
},
{
"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
61 changes: 61 additions & 0 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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: 'audit',
plugin: 'eslint',
slug: 'no-var',
weight: 1,
},
{
type: 'audit',
plugin: 'eslint',
slug: 'prefer-const',
weight: 1,
},
{
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
Loading