Skip to content

Commit 76f5915

Browse files
authored
Add prettier and lint to pipeline and fix errors (hobbyfarm#248)
* fix(#498): ensure that tasks can be updated * feat(): add prettier * feat(): format files with prettier * feat(): add prettier to pipeline * feat(): repair lint error and add lint to pipeline * fix(): fix easy lint errors with autofix * fix(): fix lint errors --------- Co-authored-by: Tanja Ulmen <tanja.ulmen@sva.de>
1 parent 0b31530 commit 76f5915

File tree

236 files changed

+2949
-2627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+2949
-2627
lines changed

.eslintrc.json

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,34 @@
11
{
22
"root": true,
3-
"ignorePatterns": [
4-
"projects/**/*"
5-
],
3+
"ignorePatterns": ["projects/**/*", "e2e/**/*"],
64
"overrides": [
75
{
8-
"files": [
9-
"*.ts"
10-
],
6+
"files": ["*.ts"],
7+
"parser": "@typescript-eslint/parser",
118
"parserOptions": {
12-
"project": [
13-
"tsconfig.json",
14-
"e2e/tsconfig.json"
15-
],
16-
"createDefaultProgram": true
9+
"project": ["tsconfig.json"],
10+
"sourceType": "module"
1711
},
12+
"plugins": ["@angular-eslint", "@typescript-eslint"],
1813
"extends": [
19-
"plugin:@angular-eslint/ng-cli-compat",
20-
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
21-
"plugin:@angular-eslint/template/process-inline-templates"
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:@angular-eslint/recommended",
17+
"plugin:@angular-eslint/template/process-inline-templates",
18+
"prettier"
2219
],
2320
"rules": {
2421
"@typescript-eslint/explicit-member-accessibility": [
2522
"off",
26-
{
27-
"accessibility": "explicit"
28-
}
29-
],
30-
"arrow-parens": [
31-
"off",
32-
"always"
23+
{ "accessibility": "explicit" }
3324
],
25+
"arrow-parens": ["off", "always"],
3426
"import/order": "off"
3527
}
3628
},
3729
{
38-
"files": [
39-
"*.html"
40-
],
41-
"extends": [
42-
"plugin:@angular-eslint/template/recommended"
43-
],
30+
"files": ["*.html"],
31+
"extends": ["plugin:@angular-eslint/template/recommended"],
4432
"rules": {}
4533
}
4634
]

.github/workflows/ci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ name: CI
44

55
on:
66
push:
7-
branches: [ "master" ]
7+
branches: ['master']
88
pull_request:
9-
branches: [ "master" ]
9+
branches: ['master']
1010
workflow_dispatch: {}
1111

1212
concurrency:
13-
group: "ci"
13+
group: 'ci'
1414
cancel-in-progress: true
1515

1616
env:
@@ -37,6 +37,10 @@ jobs:
3737
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
3838
- name: Install dependencies
3939
run: npm install
40+
- name: Prettier
41+
run: npm run prettier:check
42+
- name: Linting
43+
run: npm run lint
4044
- name: Build
4145
run: npm run build:prod
4246
env:

.github/workflows/pkg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: PKG
44

55
on:
66
push:
7-
branches: [ "master" ]
8-
tags: [ '*' ]
7+
branches: ['master']
8+
tags: ['*']
99
workflow_dispatch: {}
1010

1111
env:

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
.github

.prettierrc renamed to .prettierrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
24
"overrides": [
35
{
46
"files": "*.html",

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ A file placed at `/config.json` will allow for runtime configuration (e.g., cust
1212

1313
```json
1414
{
15-
"title": "HobbyFarm Administration",
16-
"favicon": "/assets/default/favicon.png",
17-
"login": {
18-
"logo": "/assets/default/rancher-labs-stacked-color.svg",
19-
"background": "/assets/default/vault.jpg"
20-
},
21-
"logo": "/assets/default/logo.svg"
15+
"title": "HobbyFarm Administration",
16+
"favicon": "/assets/default/favicon.png",
17+
"login": {
18+
"logo": "/assets/default/rancher-labs-stacked-color.svg",
19+
"background": "/assets/default/vault.jpg"
20+
},
21+
"logo": "/assets/default/logo.svg"
2222
}
2323
```
2424

2525
To customize logos, mount them into the container at `/usr/share/nginx/html/assets`, and then reference the file names in `config.json`. Alternatively, you can reference files from an object store.
2626

2727
A file placed at `/custom.css` will allow for runtime style customization. To do so, mount a file called `custom.css` into the container at `/usr/share/nginx/html/`.
2828

29-
30-
3129
## Contributing
3230

3331
### Local Development

angular.json

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
"main": "src/main.ts",
2323
"polyfills": "src/polyfills.ts",
2424
"tsConfig": "src/tsconfig.app.json",
25-
"allowedCommonJsDependencies": [
26-
"dragula"
27-
],
25+
"allowedCommonJsDependencies": ["dragula"],
2826
"assets": [
2927
"src/favicon.ico",
3028
"src/config.json",
@@ -120,32 +118,22 @@
120118
"polyfills": "src/polyfills.ts",
121119
"tsConfig": "src/tsconfig.spec.json",
122120
"karmaConfig": "src/karma.conf.js",
123-
"styles": [
124-
"src/styles.scss"
125-
],
121+
"styles": ["src/styles.scss"],
126122
"scripts": [],
127-
"assets": [
128-
"src/favicon.ico",
129-
"src/assets"
130-
]
123+
"assets": ["src/favicon.ico", "src/assets"]
131124
}
132125
},
133126
"lint": {
134127
"builder": "@angular-eslint/builder:lint",
135128
"options": {
136-
"lintFilePatterns": [
137-
"src/**/*.ts",
138-
"src/**/*.html"
139-
]
129+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
140130
}
141131
}
142132
}
143133
}
144134
},
145135
"cli": {
146-
"schematicCollections": [
147-
"@angular-eslint/schematics"
148-
],
136+
"schematicCollections": ["@angular-eslint/schematics"],
149137
"analytics": false
150138
},
151139
"schematics": {

0 commit comments

Comments
 (0)