Skip to content

Commit d76fac4

Browse files
CLOUDP-286235: Improved tooling (ESLint/Prettier) and GH actions (#290)
1 parent 651dbf6 commit d76fac4

14 files changed

+2015
-1494
lines changed

.github/workflows/code-health-tools.yml

+13
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ jobs:
5555
sparse-checkout: |
5656
.github
5757
tools
58+
- name: Setup Node
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '20.x'
62+
cache: 'npm'
63+
- name: Install npm dependencies
64+
run: npm install
65+
- name: Run Prettier
66+
run: |
67+
npm run format-check
68+
- name: Run ESLint on JS files
69+
run: |
70+
npm run lint-js
5871
- name: Install Go
5972
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
6073
with:

.github/workflows/required-spec-validations.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ jobs:
2626
- name: Setup Node
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: '20.x'
29+
node-version: '20.x'
30+
cache: 'npm'
3031
- name: Install npm dependencies
31-
uses: nick-fields/retry@v3
32-
with:
33-
timeout_minutes: 10
34-
max_attempts: 3
35-
command: npm install
32+
run: npm install
3633
- name: Download openapi-foas
3734
uses: actions/download-artifact@v4
3835
with:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*.env
1414

1515
/tools/postman/openapi
16-
/tools/postman/node_modules
16+
/node_modules
1717

1818
# Tool generated files
1919
*.idea

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore artifacts:
2+
*.md
3+
*.json
4+
*.yaml
5+
*.yml
6+
*.html

.prettierrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"printWidth": 120,
5+
"semi": true,
6+
"singleQuote": true,
7+
"bracketSpacing": true,
8+
"bracketSameLine": false
9+
}

eslint.config.mjs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
4+
/** @type {import('eslint').Linter.Config[]} */
5+
export default [
6+
{ languageOptions: { globals: globals.browser } },
7+
pluginJs.configs.recommended,
8+
{
9+
languageOptions: {
10+
ecmaVersion: 2022,
11+
sourceType: 'module',
12+
},
13+
},
14+
{
15+
ignores: ['node-modules'],
16+
},
17+
];

0 commit comments

Comments
 (0)