Skip to content

Commit c2b61ee

Browse files
authored
chore: run Prettier on commit + fix existing issues (#1511)
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
1 parent c035137 commit c2b61ee

File tree

38 files changed

+1936
-1038
lines changed

38 files changed

+1936
-1038
lines changed

.eslintrc.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"root": true,
33
"ignorePatterns": ["**/*"],
44
"plugins": ["@nx"],
5-
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
5+
"extends": ["eslint:recommended", "prettier"],
66
"overrides": [
77
{
88
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
@@ -64,7 +64,17 @@
6464
"checkObsoleteDependencies": true,
6565
"checkVersionMismatches": true,
6666
"ignoredDependencies": ["jest-cucumber", "jest"],
67-
"ignoredFiles": ["**/test/**", "**/tests/**", "**/e2e/**", "**/spec/**", "**/*.spec.ts", "**/*.spec.js", "**/*.test.ts", "**/*.test.js", "**/jest.*"]
67+
"ignoredFiles": [
68+
"**/test/**",
69+
"**/tests/**",
70+
"**/e2e/**",
71+
"**/spec/**",
72+
"**/*.spec.ts",
73+
"**/*.spec.js",
74+
"**/*.test.ts",
75+
"**/*.test.js",
76+
"**/jest.*"
77+
]
6878
}
6979
]
7080
}

.github/ISSUE_TEMPLATE/add-hook.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Add provider template
44
title: Add {my-behavior} hook
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
# Add {my-behavior} hook
@@ -13,7 +12,7 @@ assignees: ''
1312

1413
I want to add a hook which performs {my-behavior}.
1514

16-
- it would be great if {my-behavior} could be included in some flag evaluations
15+
- it would be great if {my-behavior} could be included in some flag evaluations
1716
- {my-behavior} would enable developers to be more productive!
1817
- other reasons!
1918

.github/ISSUE_TEMPLATE/add-provider.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Add provider template
44
title: Add {my-system} provider
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
# Add {my-system} provider

.github/workflows/ci.yml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
branches: ['main']
77

88
jobs:
9-
lint-test-build:
9+
test-build:
1010
# Needed for nx-set-shas when run on the main branch
1111
permissions:
1212
actions: read
@@ -30,26 +30,48 @@ jobs:
3030
# This line is needed for nx affected to work when CI is running on a PR
3131
- run: git branch --track main origin/main || true
3232

33-
- run: if ! npx nx format:check ; then echo "Format check failed. Please run 'npx nx format:write'."; fi
34-
- run: npx nx affected --base=origin/main --target=lint --parallel=3 --exclude=js-sdk-contrib
3533
- run: npx nx affected --base=origin/main --target=test --parallel=3 --ci --code-coverage --exclude=js-sdk-contrib
3634
- run: npx nx affected --base=origin/main --target=build --parallel=3 --exclude=js-sdk-contrib
3735

36+
format-lint:
37+
# Needed for nx-set-shas when run on the main branch
38+
permissions:
39+
actions: read
40+
contents: read
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
44+
with:
45+
fetch-depth: 0
46+
submodules: recursive
47+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
48+
with:
49+
node-version-file: '.nvmrc'
50+
cache: 'npm'
51+
52+
- run: npm ci
53+
- uses: nrwl/nx-set-shas@v3
54+
# This line is needed for nx affected to work when CI is running on a PR
55+
- run: git branch --track main origin/main || true
56+
57+
- run: if ! npx nx format:check ; then echo "Format check failed. Please run 'npx nx format:write'."; fi
58+
- run: npx nx affected --base=origin/main --target=lint --parallel=3 --exclude=js-sdk-contrib
59+
3860
e2e:
39-
runs-on: ubuntu-latest
40-
41-
steps:
42-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
43-
with:
44-
fetch-depth: 0
45-
submodules: recursive
46-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
47-
with:
48-
node-version-file: '.nvmrc'
49-
cache: 'npm'
50-
51-
- name: Install
52-
run: npm ci
53-
54-
- name: e2e
55-
run: npm run e2e
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
65+
with:
66+
fetch-depth: 0
67+
submodules: recursive
68+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
69+
with:
70+
node-version-file: '.nvmrc'
71+
cache: 'npm'
72+
73+
- name: Install
74+
run: npm ci
75+
76+
- name: e2e
77+
run: npm run e2e

.github/workflows/component-owners.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ on:
33
pull_request_target:
44

55
permissions:
6-
contents: read # to read changed files
7-
issues: write # to read/write issue assignees
8-
pull-requests: write # to read/write PR reviewers
6+
contents: read # to read changed files
7+
issues: write # to read/write issue assignees
8+
pull-requests: write # to read/write PR reviewers
99

1010
jobs:
1111
run_self:

.github/workflows/lint-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
header: pr-title-lint-error
2626
message: |
2727
Hey there and thank you for opening this pull request! 👋🏼
28-
28+
2929
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
3030
Details:
31-
31+
3232
```
3333
${{ steps.lint_pr_title.outputs.error_message }}
3434
```
3535
# Delete a previous comment when the issue has been resolved
3636
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
3737
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2
38-
with:
38+
with:
3939
header: pr-title-lint-error
4040
delete: true

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: ${{ steps.release.outputs.releases_created }}
3838
with:
3939
node-version-file: '.nvmrc'
40-
registry-url: "https://registry.npmjs.org"
40+
registry-url: 'https://registry.npmjs.org'
4141
cache: 'npm'
4242
- name: Update npm (for OIDC auth)
4343
if: ${{ steps.release.outputs.releases_created }}

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*": "npx nx format:write --files"
3+
}

.nxignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)