Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit c2d3742

Browse files
committed
fix: setup prettier
1 parent e772346 commit c2d3742

File tree

74 files changed

+2189
-2225
lines changed

Some content is hidden

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

74 files changed

+2189
-2225
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage:
2-
range: "50..100"
2+
range: '50..100'
33
status:
44
project: no
55
patch: no

.eslintrc.json

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{
22
"root": true,
3-
"ignorePatterns": [
4-
"projects/**/*"
5-
],
3+
"ignorePatterns": ["projects/**/*"],
64
"overrides": [
75
{
8-
"files": [
9-
"*.ts"
10-
],
6+
"files": ["*.ts"],
117
"parserOptions": {
12-
"project": [
13-
"tsconfig.json",
14-
"e2e/tsconfig.json"
15-
],
8+
"project": ["tsconfig.json", "e2e/tsconfig.json"],
169
"createDefaultProgram": true
1710
},
1811
"extends": [
@@ -26,12 +19,8 @@
2619
}
2720
},
2821
{
29-
"files": [
30-
"*.html"
31-
],
32-
"extends": [
33-
"plugin:@angular-eslint/template/recommended"
34-
],
22+
"files": ["*.html"],
23+
"extends": ["plugin:@angular-eslint/template/recommended"],
3524
"rules": {}
3625
}
3726
]

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 20
16+
node-version: 22
1717
cache: 'npm'
1818
- run: npm ci
1919
- name: lint
@@ -36,10 +36,10 @@ jobs:
3636
pull-requests: write # to be able to comment on released pull requests
3737
id-token: write # to enable use of OIDC for npm provenance
3838
steps:
39-
- uses: actions/checkout@v3
40-
- uses: actions/setup-node@v3
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-node@v4
4141
with:
42-
node-version: 20
42+
node-version: 22
4343
cache: 'npm'
4444
- run: npm ci
4545
- run: npm run build

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"trailingComma": "all",
55
"bracketSpacing": true,
66
"printWidth": 100,
7-
"arrowParens": "avoid"
7+
"arrowParens": "avoid",
8+
"tabWidth": 2
89
}

angular.json

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
"base": "dist"
2525
},
2626
"index": "src/index.html",
27-
"polyfills": [
28-
"src/polyfills.ts"
29-
],
27+
"polyfills": ["src/polyfills.ts"],
3028
"tsConfig": "tsconfig.app.json",
3129
"assets": [
3230
{
@@ -35,9 +33,7 @@
3533
},
3634
"src/assets"
3735
],
38-
"styles": [
39-
"src/styles.css"
40-
],
36+
"styles": ["src/styles.css"],
4137
"scripts": [],
4238
"extractLicenses": false,
4339
"sourceMap": true,
@@ -104,19 +100,14 @@
104100
},
105101
"src/assets"
106102
],
107-
"styles": [
108-
"src/styles.css"
109-
],
103+
"styles": ["src/styles.css"],
110104
"scripts": []
111105
}
112106
},
113107
"lint": {
114108
"builder": "@angular-eslint/builder:lint",
115109
"options": {
116-
"lintFilePatterns": [
117-
"src/**/*.ts",
118-
"src/**/*.html"
119-
]
110+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
120111
}
121112
}
122113
}

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
"test": "ng test --watch=false --code-coverage",
1414
"test:watch": "ng test",
1515
"test:ci": "ng test --watch=false --code-coverage --no-progress --browsers=ChromeHeadlessCustom",
16-
"lint": "ng lint",
17-
"lint:fix": "ng lint --fix"
16+
"lint": "ng lint && prettier --check .",
17+
"lint:fix": "ng lint --fix && prettier --write .",
18+
"format": "prettier --write ."
1819
},
1920
"private": true,
2021
"dependencies": {
@@ -57,6 +58,7 @@
5758
"karma-jasmine": "5.1.0",
5859
"karma-jasmine-html-reporter": "2.1.0",
5960
"ng-packagr": "19.1.2",
61+
"prettier": "3.2.5",
6062
"puppeteer": "20.2.0",
6163
"rxjs": "7.8.1",
6264
"tslib": "2.8.1",

src/app/app.component.html

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
<div class="home" style="height: 580px; width: 100%;">
1+
<div class="home" style="height: 580px; width: 100%">
22
<div class="cover" [style.background-color]="primaryColor"></div>
33
</div>
44
<div class="container">
55
<div class="row">
66
<div class="col-md-6 text-center text-md-left">
77
<div class="title">Angular Color</div>
88
<div class="description">
9-
Port of <a href="https://github.com/casesandberg/react-color">react-color</a> by casesandberg
9+
Port of <a href="https://github.com/casesandberg/react-color">react-color</a> by
10+
casesandberg
1011
</div>
1112
<div class="description">
12-
A Collection of Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter, Material Design &amp; more
13+
A Collection of Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter, Material
14+
Design &amp; more
1315
</div>
1416
<div class="mt-4">
15-
<gh-button
16-
[count]="true"
17-
user="scttcper"
18-
repo="ngx-color"
19-
>
20-
</gh-button>
17+
<gh-button [count]="true" user="scttcper" repo="ngx-color"> </gh-button>
2118
</div>
2219
</div>
2320
<div class="col-md-6">
2421
<div class="d-flex justify-content-center justify-content-md-end mt-5">
2522
<div style="padding-top: 20px; display: block">
26-
<color-chrome
27-
[color]="state"
28-
(onChangeComplete)="changeComplete($event)"
29-
>
30-
</color-chrome>
23+
<color-chrome [color]="state" (onChangeComplete)="changeComplete($event)"> </color-chrome>
3124
<div class="text-center label">Chrome</div>
3225
</div>
3326
</div>
@@ -36,9 +29,8 @@
3629
<div class="row">
3730
<div class="col-md-4 mt-3">
3831
<div class="d-flex justify-content-center justify-content-md-start">
39-
<div style="width: 220px; display: inline-block;">
40-
<color-sketch [color]="state" (onChangeComplete)="changeComplete($event)">
41-
</color-sketch>
32+
<div style="width: 220px; display: inline-block">
33+
<color-sketch [color]="state" (onChangeComplete)="changeComplete($event)"> </color-sketch>
4234
<div class="text-center label">Sketch</div>
4335
</div>
4436
</div>
@@ -132,7 +124,7 @@
132124
<div class="row">
133125
<div class="col-12 col-md-7 mb-3">
134126
<div class="d-flex justify-content-center justify-content-md-start">
135-
<div style="width: 410px;display: inline-block">
127+
<div style="width: 410px; display: inline-block">
136128
<color-slider
137129
[color]="state"
138130
(onChangeComplete)="changeComplete($event)"
@@ -170,7 +162,7 @@
170162
</div>
171163
<div class="col-md-5 d-md-inline d-none">
172164
<div class="d-flex justify-content-center justify-content-md-start">
173-
<div style="width: 320px;display: inline-block">
165+
<div style="width: 320px; display: inline-block">
174166
<color-swatches
175167
[color]="state"
176168
(onChangeComplete)="changeComplete($event)"
@@ -181,10 +173,10 @@
181173
</div>
182174
</div>
183175
</div>
184-
<div class="row">
176+
<div class="row">
185177
<div class="col-12 col-md-7 mb-3">
186178
<div class="d-flex justify-content-center justify-content-md-start">
187-
<div style="width: 320px;display: inline-block">
179+
<div style="width: 320px; display: inline-block">
188180
<color-shade-picker
189181
[color]="state"
190182
(onChangeComplete)="changeComplete($event)"
@@ -193,7 +185,8 @@
193185
<div class="pt-3 text-center label">Shade Slider</div>
194186
</div>
195187
</div>
188+
</div>
196189
</div>
197-
</div>
198190

199-
<app-footer></app-footer>
191+
<app-footer></app-footer>
192+
</div>

src/app/app.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import { Component } from '@angular/core';
33
import { ColorEvent } from 'ngx-color';
44

55
@Component({
6-
selector: 'app-root',
7-
templateUrl: './app.component.html',
8-
styleUrls: ['./app.component.css'],
9-
standalone: false
6+
selector: 'app-root',
7+
templateUrl: './app.component.html',
8+
styleUrls: ['./app.component.css'],
9+
standalone: false,
1010
})
1111
export class AppComponent {
1212
title = 'app';
1313
primaryColor = '#194D33';
1414
state = {
1515
h: 150,
16-
s: 0.50,
17-
l: 0.20,
16+
s: 0.5,
17+
l: 0.2,
1818
a: 1,
1919
};
2020

src/app/footer.component.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import { Component, VERSION } from '@angular/core';
22

33
@Component({
4-
selector: 'app-footer',
5-
template: `
4+
selector: 'app-footer',
5+
template: `
66
<footer class="footer mb-4 mt-5">
77
Angular {{ version }}
88
<br />
99
Released under the
10-
<a href="https://github.com/typectrl/ngx-codemirror/blob/master/LICENSE"
11-
>MIT</a
12-
>
10+
<a href="https://github.com/typectrl/ngx-codemirror/blob/master/LICENSE">MIT</a>
1311
license
1412
</footer>
1513
`,
16-
styles: [
17-
`
14+
styles: [
15+
`
1816
.footer {
1917
line-height: 2;
2018
text-align: center;
@@ -23,8 +21,8 @@ import { Component, VERSION } from '@angular/core';
2321
font-family: var(--font-family-monospace);
2422
}
2523
`,
26-
],
27-
standalone: false
24+
],
25+
standalone: false,
2826
})
2927
export class FooterComponent {
3028
version = VERSION.full;

0 commit comments

Comments
 (0)