Skip to content

Commit

Permalink
CLOUDP-286235: Improved tooling (ESLint/Prettier) and GH actions (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovisaberggren authored Nov 25, 2024
1 parent 651dbf6 commit d76fac4
Show file tree
Hide file tree
Showing 14 changed files with 2,015 additions and 1,494 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/code-health-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ jobs:
sparse-checkout: |
.github
tools
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Run Prettier
run: |
npm run format-check
- name: Run ESLint on JS files
run: |
npm run lint-js
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/required-spec-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npm install
run: npm install
- name: Download openapi-foas
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*.env

/tools/postman/openapi
/tools/postman/node_modules
/node_modules

# Tool generated files
*.idea
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore artifacts:
*.md
*.json
*.yaml
*.yml
*.html
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"printWidth": 120,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"bracketSameLine": false
}
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from 'globals';
import pluginJs from '@eslint/js';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
{
ignores: ['node-modules'],
},
];
Loading

0 comments on commit d76fac4

Please sign in to comment.