Skip to content

Commit

Permalink
chore: update biome options
Browse files Browse the repository at this point in the history
use biome `workspace` mode instead of one per package
  • Loading branch information
Sukaato committed Oct 6, 2024
1 parent e331de7 commit 69b5960
Show file tree
Hide file tree
Showing 26 changed files with 203 additions and 349 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/actions/quality/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Quality
description: Run quality check for specified package
inputs:
package:
description: The package to check code quality. Must have a biome.json
type: string
required: true
node-version:
description: The version of node to use.
type: string
Expand All @@ -24,20 +20,15 @@ runs:
node-version: ${{ inputs.node-version }}

- name: Install Package
run: npm install -w @poppy-ui/${{ inputs.package }}
shell: bash

- name: Install Core
if: inputs.package != 'core'
run: npm install @poppy-ui/core @poppy-ui/docs -w @poppy-ui/${{ inputs.package }}
run: npm install
shell: bash

- name: Format
run: npx -w @poppy-ui/${{ inputs.package }} @biomejs/biome format --reporter github
run: npx @biomejs/biome format --reporter github
shell: bash

- name: Lint
run: npx -w @poppy-ui/${{ inputs.package }} @biomejs/biome lint --reporter github
run: npx @biomejs/biome lint --reporter github
shell: bash

- name: Scan
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
strategy:
matrix:
node-version:
- 18.x
- 20.x
- 22.x
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
strategy:
matrix:
node-version:
- 18.x
- 20.x
- 22.x
steps:
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/quality-vue.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Quality - Core

name: Quality
on:
push:
branches:
- main
paths:
- packages/core/**
- packages/**
pull_request:
branches:
- main
paths:
- packages/core/**
- packages/**

# When pushing a new commit we should
# cancel the previous test run to not
# consume more runners than we need to.
concurrency:
group: ${{ github.ref }}_quality_core
group: ${{ github.ref }}_quality
cancel-in-progress: true

jobs:
Expand All @@ -29,23 +29,25 @@ jobs:
- uses: actions/checkout@v4
- name: Quality
uses: ./.github/workflows/actions/quality
with:
package: core

test:
needs: quality
runs-on: ubuntu-latest
strategy:
matrix:
package:
- core
- vue
node-version:
- 18.x
- 20.x
- 22.x
steps:
- uses: actions/checkout@v4
- name: Quality
- name: Test ${{ matrix.package }} on ${{ matrix.node-version }}
uses: ./.github/workflows/actions/test
with:
package: core
package: ${{ matrix.package }}
node-version: ${{ matrix.node-version }}

analyze:
Expand Down
8 changes: 2 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"recommendations": [
"github.vscode-github-actions",
"biomejs.biome",
"vue.volar"
]
}
"recommendations": ["github.vscode-github-actions", "biomejs.biome", "vue.volar"]
}
18 changes: 9 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.organizeImports.biome": "explicit",
"source.sortImports": "explicit",
"source.removeUnused.ts": "explicit",
"source.removeUnusedImports": "explicit",
}
}
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.organizeImports.biome": "explicit",
"source.sortImports": "explicit",
"source.removeUnused.ts": "explicit",
"source.removeUnusedImports": "explicit"
}
}
67 changes: 0 additions & 67 deletions biome.json

This file was deleted.

114 changes: 114 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": [
"packages/docs/*",
"**/*.d.ts",
"packages/vue/src/vue-component-lib/utils.ts",
"packages/vue/src/proxies.ts"
]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "multiline"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "asNeeded",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "multiline"
},
"linter": {
"enabled": true
}
},
"css": {
"formatter": {
"enabled": true
},
"linter": {
"enabled": true
},
"parser": {
"cssModules": true
},
"assists": {
"enabled": true
}
},
"assists": {
"enabled": true,
"actions": {
"source": {
"sortJsxProps": "on",
"useSortedKeys": "on"
}
}
},
"overrides": [
{
"include": ["packages/core/src/**", "packages/core/plugins/**"],
"linter": {
"rules": {
"suspicious": {
"noAssignInExpressions": "off", // Used to assing ref
"noConfusingVoidType": "off"
},
"correctness": {
"useJsxKeyInIterable": "off" // Stencil generate jsx key for us
},
"a11y": {
"useKeyWithClickEvents": "warn", // Should be an error before release v1
"useValidAnchor": "off", // Anchor is used to trigger focus on element, for link purpose,
"noAutofocus": "off", // Auto focus is used for inputs components
"noSvgWithoutTitle": "off",
"useSemanticElements": "off"
},
"style": {
"noParameterAssign": "off" // Used to assing ref
}
}
}
},
{
"include": ["packages/vue/src/**", "tests/vue/src/**"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
}
}
}
}
]
}
Loading

0 comments on commit 69b5960

Please sign in to comment.