Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit bd49241

Browse files
authored
fix: prettier update new rules applied (#9195)
* fix: prettier update new rules applied * fix: prettier action glob * fix: failed breaking build * fix: envar mdx file prettier ignored
1 parent 867f256 commit bd49241

File tree

293 files changed

+1710
-1422
lines changed

Some content is hidden

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

293 files changed

+1710
-1422
lines changed

.eslintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
"ecmaVersion": 2020,
1919
"sourceType": "module"
2020
},
21-
"plugins": [
22-
"react"
23-
],
21+
"plugins": ["react"],
2422
"settings": {
2523
"react": {
2624
"version": "detect"

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 🐛 Bug
22
description: Report an issue to help improve the project.
33
title: "[BUG] <description>"
4-
labels: ["🛠 goal: fix","🚦 status: awaiting triage"]
4+
labels: ["🛠 goal: fix", "🚦 status: awaiting triage"]
55
body:
66
- type: textarea
77
id: description

.github/ISSUE_TEMPLATE/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 📄 Documentation issue
22
description: Found an issue in the documentation? You can use this one!
33
title: "[DOCS] <description>"
4-
labels: ["📄 aspect: text","🚦 status: awaiting triage"]
4+
labels: ["📄 aspect: text", "🚦 status: awaiting triage"]
55
body:
66
- type: textarea
77
id: description

.github/config/labeler.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
'✍ chore: profile':
2-
- 'data/**'
1+
"✍ chore: profile":
2+
- "data/**"
33

44
tests:
5-
- 'tests/**'
5+
- "tests/**"
66

77
storybook:
8-
- 'stories/**'
8+
- "stories/**"
99

1010
dependencies:
11-
- 'package.*'
11+
- "package.*"
1212

13-
'CI/CD':
14-
- '.github/**'
13+
"CI/CD":
14+
- ".github/**"
1515

16-
'📖 docs':
17-
- 'pages/docs/**'
16+
"📖 docs":
17+
- "pages/docs/**"
1818

19-
'models':
20-
- 'models/**'
19+
"models":
20+
- "models/**"

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ updates:
1010
# set commit message to work with Angular conventional commit style
1111
commit-message:
1212
prefix: "fix(deps)"
13-
prefix-development: "chore(deps)"
13+
prefix-development: "chore(deps)"

.github/scripts/check-filenames.js

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
let fileNames = process.env.FILENAMES.split(' ');
2-
const baseFileNames = process.env.BASE_FILENAMES.split(' ');
3-
const user = process.env.USERNAME;
4-
let exitCode = 0;
5-
6-
// Remove files not changed in this PR from list
7-
if (baseFileNames.length > 0) {
8-
fileNames = fileNames.filter(file => !baseFileNames.includes(file));
9-
}
10-
11-
if (fileNames.length > 0) {
12-
fileNames.forEach(file => {
13-
const splitFile = file.split('/');
14-
const userPart = splitFile[1];
15-
// Files not in data directory produce a warning
16-
if(splitFile[0] !== 'data') {
17-
console.log(`::warning ::${file} included in Pull Request with profile changes but not in data directory.`);
18-
return;
19-
}
20-
if (!file.endsWith('.json')){
21-
exitCode = 1;
22-
console.log(`::error ::Filename ${file} does not end with '.json'`);
23-
return;
24-
}
25-
if ((userPart !== user ) && (userPart !== `${user}.json`)){
26-
// Allow for testimonials
27-
if((splitFile.length == 4) && (splitFile[2] === 'testimonials') && (splitFile[3] === `${user}.json`)) {
28-
return;
29-
}
30-
exitCode = 1;
31-
console.log(`::error ::Filename ${file} does not match user ${user}`);
32-
}
33-
});
34-
}
35-
36-
process.exit(exitCode);
1+
let fileNames = process.env.FILENAMES.split(" ");
2+
const baseFileNames = process.env.BASE_FILENAMES.split(" ");
3+
const user = process.env.USERNAME;
4+
let exitCode = 0;
5+
6+
// Remove files not changed in this PR from list
7+
if (baseFileNames.length > 0) {
8+
fileNames = fileNames.filter((file) => !baseFileNames.includes(file));
9+
}
10+
11+
if (fileNames.length > 0) {
12+
fileNames.forEach((file) => {
13+
const splitFile = file.split("/");
14+
const userPart = splitFile[1];
15+
// Files not in data directory produce a warning
16+
if (splitFile[0] !== "data") {
17+
console.log(
18+
`::warning ::${file} included in Pull Request with profile changes but not in data directory.`,
19+
);
20+
return;
21+
}
22+
if (!file.endsWith(".json")) {
23+
exitCode = 1;
24+
console.log(`::error ::Filename ${file} does not end with '.json'`);
25+
return;
26+
}
27+
if (userPart !== user && userPart !== `${user}.json`) {
28+
// Allow for testimonials
29+
if (
30+
splitFile.length == 4 &&
31+
splitFile[2] === "testimonials" &&
32+
splitFile[3] === `${user}.json`
33+
) {
34+
return;
35+
}
36+
exitCode = 1;
37+
console.log(`::error ::Filename ${file} does not match user ${user}`);
38+
}
39+
});
40+
}
41+
42+
process.exit(exitCode);

.github/scripts/testimonial.mjs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import fs from 'fs';
2-
3-
const fileName = process.env.FILE_NAME;
4-
const title = process.env.DATA_TITLE;
5-
const description = process.env.DATA_DESCRIPTION;
6-
const date = process.env.DATA_DATE;
7-
8-
const output = {
9-
title,
10-
description,
11-
date
12-
}
13-
14-
try {
15-
fs.writeFileSync(fileName, JSON.stringify(output, null, 2));
16-
} catch(e) {
17-
console.log(`::error ::Error writing ${fileName}`);
18-
process.exit(1);
19-
}
1+
import fs from "fs";
2+
3+
const fileName = process.env.FILE_NAME;
4+
const title = process.env.DATA_TITLE;
5+
const description = process.env.DATA_DESCRIPTION;
6+
const date = process.env.DATA_DATE;
7+
8+
const output = {
9+
title,
10+
description,
11+
date,
12+
};
13+
14+
try {
15+
fs.writeFileSync(fileName, JSON.stringify(output, null, 2));
16+
} catch (e) {
17+
console.log(`::error ::Error writing ${fileName}`);
18+
process.exit(1);
19+
}

.github/workflows/codeql.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
paths-ignore:
21-
- '**/*.md'
22-
- '**/*.json'
21+
- "**/*.md"
22+
- "**/*.json"
2323

2424
jobs:
2525
analyze:
@@ -39,45 +39,44 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
language: [ 'javascript' ]
42+
language: ["javascript"]
4343
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
4444
# Use only 'java' to analyze code written in Java, Kotlin or both
4545
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
4646
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4747

4848
steps:
49-
- name: Checkout repository
50-
uses: actions/checkout@v3
49+
- name: Checkout repository
50+
uses: actions/checkout@v3
5151

52-
# Initializes the CodeQL tools for scanning.
53-
- name: Initialize CodeQL
54-
uses: github/codeql-action/init@v2
55-
with:
56-
languages: ${{ matrix.language }}
57-
# If you wish to specify custom queries, you can do so here or in a config file.
58-
# By default, queries listed here will override any specified in a config file.
59-
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# Initializes the CodeQL tools for scanning.
53+
- name: Initialize CodeQL
54+
uses: github/codeql-action/init@v2
55+
with:
56+
languages: ${{ matrix.language }}
57+
# If you wish to specify custom queries, you can do so here or in a config file.
58+
# By default, queries listed here will override any specified in a config file.
59+
# Prefix the list here with "+" to use these queries and those in the config file.
6060

61-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
62-
# queries: security-extended,security-and-quality
61+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
62+
# queries: security-extended,security-and-quality
6363

64+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
65+
# If this step fails, then you should remove it and run the build manually (see below)
66+
- name: Autobuild
67+
uses: github/codeql-action/autobuild@v2
6468

65-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
66-
# If this step fails, then you should remove it and run the build manually (see below)
67-
- name: Autobuild
68-
uses: github/codeql-action/autobuild@v2
69+
# ℹ️ Command-line programs to run using the OS shell.
70+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6971

70-
# ℹ️ Command-line programs to run using the OS shell.
71-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
72+
# If the Autobuild fails above, remove it and uncomment the following three lines.
73+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7274

73-
# If the Autobuild fails above, remove it and uncomment the following three lines.
74-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
75+
# - run: |
76+
# echo "Run, Build Application using script"
77+
# ./location_of_script_within_repo/buildscript.sh
7578

76-
# - run: |
77-
# echo "Run, Build Application using script"
78-
# ./location_of_script_within_repo/buildscript.sh
79-
80-
- name: Perform CodeQL Analysis
81-
uses: github/codeql-action/analyze@v2
82-
with:
83-
category: "/language:${{matrix.language}}"
79+
- name: Perform CodeQL Analysis
80+
uses: github/codeql-action/analyze@v2
81+
with:
82+
category: "/language:${{matrix.language}}"

.github/workflows/data-filenames.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
name: Data Filenames Check
2-
3-
on:
4-
pull_request:
5-
paths:
6-
- "data/**"
7-
8-
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
name: Test changed-files
12-
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: Setup Node
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: "18"
19-
20-
- name: Get changed files
21-
id: changed-files
22-
uses: tj-actions/[email protected]
23-
24-
- name: Get changed files between base & head
25-
id: base-changed-files
26-
uses: tj-actions/[email protected]
27-
with:
28-
base_sha: ${{ github.event.pull_request.head.sha }}
29-
30-
- name: Check changed files
31-
env:
32-
BASE_FILENAMES: ${{ steps.base-changed-files.outputs.all_changed_files }}
33-
FILENAMES: ${{ steps.changed-files.outputs.all_changed_files }}
34-
USERNAME: ${{ github.actor }}
35-
run: |
36-
node .github/scripts/check-filenames.js
1+
name: Data Filenames Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "data/**"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
name: Test changed-files
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "18"
19+
20+
- name: Get changed files
21+
id: changed-files
22+
uses: tj-actions/[email protected]
23+
24+
- name: Get changed files between base & head
25+
id: base-changed-files
26+
uses: tj-actions/[email protected]
27+
with:
28+
base_sha: ${{ github.event.pull_request.head.sha }}
29+
30+
- name: Check changed files
31+
env:
32+
BASE_FILENAMES: ${{ steps.base-changed-files.outputs.all_changed_files }}
33+
FILENAMES: ${{ steps.changed-files.outputs.all_changed_files }}
34+
USERNAME: ${{ github.actor }}
35+
run: |
36+
node .github/scripts/check-filenames.js

.github/workflows/prettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: npm ci
2525

2626
- name: Prettier
27-
run: npx prettier --write data/*.json
27+
run: npx prettier --write data/**/*.json
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030

0 commit comments

Comments
 (0)