Skip to content

Commit

Permalink
chore: Use Prettier for code formatting (#1312)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <djelinek@redhat.com>
  • Loading branch information
djelinek committed May 16, 2024
1 parent 2000e03 commit 239b59c
Show file tree
Hide file tree
Showing 235 changed files with 18,456 additions and 18,280 deletions.
117 changes: 52 additions & 65 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,54 @@
{
"root": true, // this is root configuration for project
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaFeatures": {
"impliedStrict": true
}
},
"env": {
"browser": true,
"es2022": true,
"mocha": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"@typescript-eslint",
"@stylistic"
],
"rules": {
"@typescript-eslint/no-var-requires": "off", // allows require statements outside of imports
"@typescript-eslint/no-floating-promises": "warn",
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"PascalCase",
"UPPER_CASE"
]
}
],
"@stylistic/semi": "warn",
"curly": "warn",
"eqeqeq": [
"warn",
"always"
],
"no-redeclare": "warn",
"no-throw-literal": "warn"
"root": true, // this is root configuration for project
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaFeatures": {
"impliedStrict": true
}
}
},
"env": {
"browser": true,
"es2022": true,
"mocha": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint", "@stylistic"],
"rules": {
"@typescript-eslint/no-var-requires": "off", // allows require statements outside of imports
"@typescript-eslint/no-floating-promises": "warn",
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
}
],
"@stylistic/semi": "warn",
"curly": "warn",
"eqeqeq": ["warn", "always"],
"no-redeclare": "warn",
"no-throw-literal": "warn"
}
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-reports.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🚫 Bug Report
description: If something is not working properly
title: "[🚫 Bug] "
labels: [ bug, new-issue ]
labels: [bug, new-issue]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-requests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🚀 Feature Request
description: If something is missing or could be improved
title: "[🚀 Request] "
labels: [ enhancement, new-issue ]
labels: [enhancement, new-issue]
body:
- type: markdown
attributes:
Expand Down
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ updates:
- "skip-changelog"
reviewers:
- redhat-developer/extester-maintainers
- package-ecosystem: 'npm'
directory: '/'
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: 'daily'
interval: "daily"
open-pull-requests-limit: 20
versioning-strategy: increase
reviewers:
Expand Down
4 changes: 2 additions & 2 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ changelog:
categories:
- title: 🚫 Bugs
labels:
- 'bug'
- "bug"
exclude:
labels:
- dependencies
- title: 🚀 Features
labels:
- 'enhancement'
- "enhancement"
exclude:
labels:
- dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 📊 Code Coverage

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/insiders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
- cron: "0 0 * * *"
push:
branches: [ insider ]
branches: [insider]
workflow_dispatch:

concurrency:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 🏗️ Main CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

concurrency:
Expand All @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ min, 1.88.1, max ]
version: [min, 1.88.1, max]
uses: ./.github/workflows/template-main.yaml
with:
version: ${{ matrix.version }}
Expand All @@ -26,7 +26,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
name: 🚦 Status Check
needs: [ test ]
needs: [test]
steps:
- name: ℹ️ Test Matrix Result
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [ lts/*, latest ]
node: [lts/*, latest]
uses: ./.github/workflows/template-main.yaml
with:
version: max
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 📖 Publish wiki

on:
push:
branches: [ main ]
branches: [main]
paths:
- docs/**
- .github/workflows/publish-wiki.yml
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/stalebot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🗄️ Close Stale Issues and PRs

on:
schedule:
- cron: '30 1 * * *'
- cron: "30 1 * * *"

jobs:
stale:
Expand All @@ -12,13 +12,13 @@ jobs:
- name: 🗄️ Close Inactive
uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
exempt-issue-milestones: 'BACKLOG,NEXT'
stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days."
stale-pr-message: "This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days."
close-issue-message: "This issue was closed because it has been stalled for 5 days with no activity."
exempt-issue-milestones: "BACKLOG,NEXT"
exempt-all-assignees: true
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'enhancement,question,help-wanted,do-not-stale'
exempt-pr-labels: 'help-wanted,prio,do-not-stale'
stale-issue-label: "no-issue-activity"
stale-pr-label: "no-pr-activity"
exempt-issue-labels: "enhancement,question,help-wanted,do-not-stale"
exempt-pr-labels: "help-wanted,prio,do-not-stale"
exempt-draft-pr: true
9 changes: 6 additions & 3 deletions .github/workflows/template-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
type: string
nodejs:
required: false
default: '18.x'
default: "18.x"
type: string
code_type:
required: false
default: 'stable'
default: "stable"
type: string

jobs:
Expand All @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

env:
Expand All @@ -45,6 +45,9 @@ jobs:
- name: 🔧 Build
run: npm run build

- name: ✨ Code Formatter - Prettier
run: npx prettier . --check

- name: 🔧 Install - Test Project
run: npm install --workspace=extester-test

Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage/
out/
resources/
test-resources/
test-extensions/
.test-extensions/
23 changes: 23 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"endOfLine": "auto",
"printWidth": 160,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"useTabs": true,
"tabWidth": 4,
"quoteProps": "as-needed",
"overrides": [
{
"files": ["*.yaml", "*.yml", "*.json", "*.md"],
"options": {
"useTabs": false,
"tabWidth": 2,
"singleQuote": false
}
}
]
}

0 comments on commit 239b59c

Please sign in to comment.