Skip to content

Commit 1ded5ca

Browse files
committed
Adopt prettier
1 parent 453c59a commit 1ded5ca

38 files changed

+459
-579
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,69 @@
33
#
44
# You may wish to alter this file to override the set of languages analyzed,
55
# or to provide custom queries or build logic.
6-
name: "CodeQL"
6+
name: 'CodeQL'
77

88
on:
9-
push:
10-
branches: [master]
11-
pull_request:
12-
# The branches below must be a subset of the branches above
13-
branches: [master]
14-
schedule:
15-
- cron: '0 2 * * 5'
9+
push:
10+
branches: [master]
11+
pull_request:
12+
# The branches below must be a subset of the branches above
13+
branches: [master]
14+
schedule:
15+
- cron: '0 2 * * 5'
1616

1717
jobs:
18-
analyze:
19-
name: Analyze
20-
runs-on: ubuntu-latest
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
2121

22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
# Override automatic language detection by changing the below list
26-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27-
language: ['javascript']
28-
# Learn more...
29-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
# Override automatic language detection by changing the below list
26+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27+
language: ['javascript']
28+
# Learn more...
29+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3030

31-
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v2
34-
with:
35-
# We must fetch at least the immediate parents so that if this is
36-
# a pull request then we can checkout the head.
37-
fetch-depth: 2
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2
34+
with:
35+
# We must fetch at least the immediate parents so that if this is
36+
# a pull request then we can checkout the head.
37+
fetch-depth: 2
3838

39-
# If this run was triggered by a pull request event, then checkout
40-
# the head of the pull request instead of the merge commit.
41-
- run: git checkout HEAD^2
42-
if: ${{ github.event_name == 'pull_request' }}
39+
# If this run was triggered by a pull request event, then checkout
40+
# the head of the pull request instead of the merge commit.
41+
- run: git checkout HEAD^2
42+
if: ${{ github.event_name == 'pull_request' }}
4343

44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
5858

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
6161

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
6565

66-
#- run: |
67-
# make bootstrap
68-
# make release
66+
#- run: |
67+
# make bootstrap
68+
# make release
6969

70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

.prettierrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"htmlWhitespaceSensitivity": "strict",
7+
"printWidth": 120,
8+
"arrowParens": "avoid",
9+
"bracketSpacing": false,
10+
"overrides": [
11+
{
12+
"files": ["*.md"],
13+
"options": {
14+
"tabWidth": 2
15+
}
16+
}
17+
]
18+
}

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ See the component in action on [the demo page](https://ecodev.github.io/fab-spee
1313
## Install
1414

1515
1. Install the library:
16-
```bash
17-
yarn add @ecodev/fab-speed-dial
18-
```
16+
```bash
17+
yarn add @ecodev/fab-speed-dial
18+
```
1919
2. In `app.module.ts` add the following modules to the `imports` array:
20-
- `MatButtonModule`
21-
- `MatIconModule`
22-
- `EcoFabSpeedDialModule`
20+
- `MatButtonModule`
21+
- `MatIconModule`
22+
- `EcoFabSpeedDialModule`
2323

2424
## Usage
2525

@@ -28,34 +28,34 @@ or adapt the bindings to your needs:
2828

2929
```html
3030
<eco-fab-speed-dial>
31-
<eco-fab-speed-dial-trigger>
32-
<button mat-fab (click)="doAction('trigger')"><mat-icon>menu</mat-icon></button>
33-
</eco-fab-speed-dial-trigger>
34-
35-
<eco-fab-speed-dial-actions>
36-
<button mat-mini-fab (click)="doAction('action1')"><mat-icon>add</mat-icon></button>
37-
<button mat-mini-fab (click)="doAction('action2')"><mat-icon>edit</mat-icon></button>
38-
<button mat-mini-fab (click)="doAction('action3')"><mat-icon>search</mat-icon></button>
39-
</eco-fab-speed-dial-actions>
31+
<eco-fab-speed-dial-trigger>
32+
<button mat-fab (click)="doAction('trigger')"><mat-icon>menu</mat-icon></button>
33+
</eco-fab-speed-dial-trigger>
34+
35+
<eco-fab-speed-dial-actions>
36+
<button mat-mini-fab (click)="doAction('action1')"><mat-icon>add</mat-icon></button>
37+
<button mat-mini-fab (click)="doAction('action2')"><mat-icon>edit</mat-icon></button>
38+
<button mat-mini-fab (click)="doAction('action3')"><mat-icon>search</mat-icon></button>
39+
</eco-fab-speed-dial-actions>
4040
</eco-fab-speed-dial>
4141
```
4242

4343
## Properties
4444

4545
### eco-fab-speed-dial
4646

47-
| Property | Type | Default | Description |
48-
|------------------|----------------------|---------------------|--------------------------------------------------------|
49-
| `open` | `boolean` | `false` | Indicates if this FAB Speed Dial is opened |
50-
| `direction` | `up`, `down`, `left` or `right` | `up` | The direction to open the action buttons |
51-
| `animationMode` | `fling` or `scale` | `fling` | The animation to apply when opening the action buttons |
52-
| `fixed` | `boolean` | `false` | Indicates if this FAB Speed Dial is fixed (user cannot change the open state on click) |
47+
| Property | Type | Default | Description |
48+
| --------------- | ------------------------------- | ------- | -------------------------------------------------------------------------------------- |
49+
| `open` | `boolean` | `false` | Indicates if this FAB Speed Dial is opened |
50+
| `direction` | `up`, `down`, `left` or `right` | `up` | The direction to open the action buttons |
51+
| `animationMode` | `fling` or `scale` | `fling` | The animation to apply when opening the action buttons |
52+
| `fixed` | `boolean` | `false` | Indicates if this FAB Speed Dial is fixed (user cannot change the open state on click) |
5353

5454
### eco-fab-speed-dial-trigger
5555

56-
| Property | Type | Default | Description |
57-
|------------------|--------------|---------------------|-------------------------------------------------|
58-
| `spin` | `boolean` | `false` | Enables the rotation of the trigger action when the speed dial is opening |
56+
| Property | Type | Default | Description |
57+
| -------- | --------- | ------- | ------------------------------------------------------------------------- |
58+
| `spin` | `boolean` | `false` | Enables the rotation of the trigger action when the speed dial is opening |
5959

6060
Additionally to spin property, add class "spin180" or "spin360" on html content inside of `eco-fab-speed-dial-trigger` tag to activate rotation on a specific element.
6161

angular.json

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "tsconfig.app.json",
2121
"aot": true,
22-
"assets": [
23-
"src/favicon.ico",
24-
"src/assets"
25-
],
26-
"styles": [
27-
"src/styles.css"
28-
],
22+
"assets": ["src/favicon.ico", "src/assets"],
23+
"styles": ["src/styles.css"],
2924
"scripts": []
3025
},
3126
"configurations": {
@@ -83,27 +78,16 @@
8378
"polyfills": "src/polyfills.ts",
8479
"tsConfig": "tsconfig.spec.json",
8580
"karmaConfig": "karma.conf.js",
86-
"assets": [
87-
"src/favicon.ico",
88-
"src/assets"
89-
],
90-
"styles": [
91-
"src/styles.css"
92-
],
81+
"assets": ["src/favicon.ico", "src/assets"],
82+
"styles": ["src/styles.css"],
9383
"scripts": []
9484
}
9585
},
9686
"lint": {
9787
"builder": "@angular-devkit/build-angular:tslint",
9888
"options": {
99-
"tsConfig": [
100-
"tsconfig.app.json",
101-
"tsconfig.spec.json",
102-
"e2e/tsconfig.json"
103-
],
104-
"exclude": [
105-
"**/node_modules/**"
106-
]
89+
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
90+
"exclude": ["**/node_modules/**"]
10791
}
10892
},
10993
"e2e": {
@@ -131,7 +115,7 @@
131115
"options": {
132116
"tsConfig": "projects/fab-speed-dial/tsconfig.lib.json",
133117
"project": "projects/fab-speed-dial/ng-package.json"
134-
},
118+
}
135119
},
136120
"test": {
137121
"builder": "@angular-devkit/build-angular:karma",
@@ -148,9 +132,7 @@
148132
"projects/fab-speed-dial/tsconfig.lib.json",
149133
"projects/fab-speed-dial/tsconfig.spec.json"
150134
],
151-
"exclude": [
152-
"**/node_modules/**"
153-
]
135+
"exclude": ["**/node_modules/**"]
154136
}
155137
}
156138
}

e2e/protractor.conf.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,21 @@ const {SpecReporter} = require('jasmine-spec-reporter');
99
*/
1010
exports.config = {
1111
allScriptsTimeout: 11000,
12-
specs: [
13-
'./src/**/*.e2e-spec.ts',
14-
],
12+
specs: ['./src/**/*.e2e-spec.ts'],
1513
capabilities: {
16-
'browserName': 'chrome',
14+
browserName: 'chrome',
1715
},
1816
directConnect: true,
1917
baseUrl: 'http://localhost:4200/',
2018
framework: 'jasmine',
2119
jasmineNodeOpts: {
2220
showColors: true,
2321
defaultTimeoutInterval: 30000,
24-
print: function () {
25-
},
22+
print: function () {},
2623
},
2724
onPrepare() {
2825
require('ts-node').register({
29-
project: require('path').join(__dirname, './tsconfig.json'),
26+
project: require('path').join(__dirname, './tsconfig.json'),
3027
});
3128
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
3229
},

e2e/src/app.e2e-spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { AppPage } from './app.po';
2-
import { browser, logging } from 'protractor';
1+
import {AppPage} from './app.po';
2+
import {browser, logging} from 'protractor';
33

44
describe('workspace-project App', () => {
55
let page: AppPage;
@@ -16,8 +16,10 @@ describe('workspace-project App', () => {
1616
afterEach(async () => {
1717
// Assert that there are no errors emitted from the browser
1818
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19-
expect(logs).not.toContain(jasmine.objectContaining({
20-
level: logging.Level.SEVERE,
21-
} as logging.Entry));
19+
expect(logs).not.toContain(
20+
jasmine.objectContaining({
21+
level: logging.Level.SEVERE,
22+
} as logging.Entry),
23+
);
2224
});
2325
});

e2e/src/app.po.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { browser, by, element } from 'protractor';
1+
import {browser, by, element} from 'protractor';
22

33
export class AppPage {
44
navigateTo() {
5-
return browser.get(browser.baseUrl) as Promise<any>;
5+
return browser.get(browser.baseUrl) as Promise<any>;
66
}
77

88
getParagraphText() {

e2e/tsconfig.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{
22
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "../out-tsc/e2e",
4+
"outDir": "../out-tsc/e2e",
55
"module": "commonjs",
66
"target": "es2018",
7-
"types": [
8-
"jasmine",
9-
"jasminewd2",
10-
"node"
11-
]
7+
"types": ["jasmine", "jasminewd2", "node"]
128
}
139
}

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function (config) {
1616
require('@angular-devkit/build-angular/plugins/karma'),
1717
],
1818
client: {
19-
clearContext: false // leave Jasmine Spec Runner output visible in browser
19+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
2020
},
2121
coverageIstanbulReporter: {
2222
dir: require('path').join(__dirname, '../coverage'),

0 commit comments

Comments
 (0)