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

Add formatting and eslint pipeline #1044

Merged
merged 24 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions .github/workflows/angular-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Prettier & Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_call:
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: "ui/package-lock.json"
- name: Install dependencies
working-directory: ui
run: npm ci
- name: Run formatter
working-directory: ui
run: npm run format:cli
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Angular Unit Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_call:
workflow_dispatch:
jobs:
build:
Expand Down
41 changes: 41 additions & 0 deletions ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
30 changes: 12 additions & 18 deletions ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"src/content/images"
],
"styles": [
"src/content/scss/wro.css",
"src/content/scss/global.scss"
],
"assets": ["src/favicon.ico", "src/assets", "src/content/images"],
"styles": ["src/content/scss/global.scss"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -97,21 +90,22 @@
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/content/scss/wro.css",
"src/content/scss/global.scss"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/content/scss/global.scss"],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": ["@angular-eslint/schematics"]
}
}
33 changes: 15 additions & 18 deletions ui/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
basePath: "",
frameworks: ["jasmine", "@angular-devkit/build-angular"],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
require("karma-jasmine"),
require("karma-chrome-launcher"),
require("karma-jasmine-html-reporter"),
require("karma-coverage"),
require("@angular-devkit/build-angular/plugins/karma"),
],
client: {
jasmine: {
Expand All @@ -19,26 +19,23 @@ module.exports = function (config) {
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/gateway'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
dir: require("path").join(__dirname, "./coverage/gateway"),
subdir: ".",
reporters: [{ type: "html" }, { type: "text-summary" }],
},
reporters: ['progress', 'kjhtml'],
reporters: ["progress", "kjhtml"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
browsers: ["ChromeHeadless"],
singleRun: true,
restartOnFileChange: true
restartOnFileChange: true,
});
};
Loading
Loading