Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 38 additions & 33 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ module.exports = {
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
sourceType: 'module',
project: 'tsconfig.json',
project: 'tsconfig.app.json',
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'@typescript-eslint',
'@stylistic',
'import',
],
settings: {
Expand All @@ -97,14 +98,16 @@ module.exports = {
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': true,
minimumDescriptionLength: 4,
},
],
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/ban-types': [

// Replaces removed @typescript-eslint/ban-types (split in v8)
'@typescript-eslint/no-restricted-types': [
'error',
{
extendDefaults: false,
types: {
String: {
message: 'Use `string` instead.',
Expand Down Expand Up @@ -141,12 +144,6 @@ module.exports = {
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
fixWith: 'Record<string, unknown>',
},
Function: 'Use a specific function type instead, like `() => void`.',
// null: {
// message:
// 'Use `undefined` instead. See: https://github.com/sindresorhus/meta/issues/7',
// fixWith: 'undefined',
// },
Buffer: {
message:
'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
Expand All @@ -161,24 +158,29 @@ module.exports = {
},
},
],
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',

'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
'@typescript-eslint/consistent-generic-constructors': [
'error',
'constructor',
],
'@typescript-eslint/consistent-indexed-object-style': 'error',

// Stylistic rules (moved from @typescript-eslint in v8)
'brace-style': 'off',
'@typescript-eslint/brace-style': [
'@stylistic/brace-style': [
'error',
'1tbs',
{
allowSingleLine: false,
},
],
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': [
'@stylistic/comma-spacing': [
'error',
{
before: false,
Expand Down Expand Up @@ -237,19 +239,19 @@ module.exports = {
// ],

'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@stylistic/function-call-spacing': ['error', 'never'],
indent: 'off',
'@typescript-eslint/indent': [
'@stylistic/indent': [
'error',
2,
{
SwitchCase: 1,
},
],
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': 'error',
'@stylistic/keyword-spacing': 'error',
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': [
'@stylistic/lines-between-class-members': [
'error',
'always',
{
Expand All @@ -258,7 +260,7 @@ module.exports = {
exceptAfterSingleLine: true,
},
],
'@typescript-eslint/member-delimiter-style': [
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
Expand Down Expand Up @@ -358,10 +360,12 @@ module.exports = {
'@typescript-eslint/no-dynamic-delete': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': [

// Replaces removed @typescript-eslint/no-empty-interface (v8)
'@typescript-eslint/no-empty-object-type': [
'error',
{
allowSingleExtends: true,
allowInterfaces: 'with-single-extends',
},
],

Expand Down Expand Up @@ -392,11 +396,11 @@ module.exports = {
// ],

'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 'error',
'@stylistic/no-extra-semi': 'error',
'no-loop-func': 'off',
'@typescript-eslint/no-loop-func': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
// Removed in @typescript-eslint v8 — base ESLint rule handles this now
'no-loss-of-precision': 'error',
'@typescript-eslint/no-extraneous-class': [
'error',
{
Expand Down Expand Up @@ -468,15 +472,17 @@ module.exports = {
// The rule is buggy and keeps inferring `any` for types that are not `any`. Just a lot of false-positives.
// '@typescript-eslint/no-redundant-type-constituents': 'error',

// no-require-imports subsumes the removed no-var-requires in v8
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-this-alias': [
'error',
{
allowDestructuring: true,
},
],
// Replaces removed @typescript-eslint/no-throw-literal (renamed in v8)
'no-throw-literal': 'off',
'@typescript-eslint/no-throw-literal': [
'@typescript-eslint/only-throw-error': [
'error',
{
// This should ideally be `false`, but it makes rethrowing errors inconvenient. There should be a separate `allowRethrowingUnknown` option.
Expand Down Expand Up @@ -534,17 +540,16 @@ module.exports = {
'@typescript-eslint/no-useless-constructor': 'error',
'object-curly-spacing': 'off',
'curly': ['error', 'all'],
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'padding-line-between-statements': 'off',
'@typescript-eslint/padding-line-between-statements': [
'@stylistic/padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: 'multiline-block-like',
next: '*',
},
],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
'@typescript-eslint/parameter-properties': [
'error',
Expand Down Expand Up @@ -584,10 +589,10 @@ module.exports = {

'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/prefer-ts-expect-error': 'error',
// Removed in v8 — covered by ban-ts-comment with ts-ignore: true
'@typescript-eslint/promise-function-async': 'error',
quotes: 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'@stylistic/quotes': ['error', 'single'],
'@typescript-eslint/restrict-plus-operands': [
'error',
{
Expand All @@ -613,7 +618,7 @@ module.exports = {
// '@typescript-eslint/require-await': 'error',

'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': [
'@stylistic/space-before-function-paren': [
'error',
{
anonymous: 'always',
Expand All @@ -622,11 +627,11 @@ module.exports = {
},
],
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': 'error',
'@stylistic/space-infix-ops': 'error',
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],
'@stylistic/semi': ['error', 'always'],
'space-before-blocks': 'off',
'@typescript-eslint/space-before-blocks': ['error', 'always'],
'@stylistic/space-before-blocks': ['error', 'always'],

// TODO: Reconsider enabling it again in 2023.
// NOTE: The rule was complete redone in typescript-eslint v3, so this config needs to be changed before this is enabled.
Expand Down Expand Up @@ -656,7 +661,7 @@ module.exports = {
lib: 'never',
},
],
'@typescript-eslint/type-annotation-spacing': 'error',
'@stylistic/type-annotation-spacing': 'error',

// Disabled as it crashes on most code.
// https://github.com/typescript-eslint/typescript-eslint/search?q=%22unbound-method%22&state=open&type=Issues
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: PR Checks

on:
pull_request:
branches: [main]

concurrency:
group: pr-checks-${{ github.head_ref }}
cancel-in-progress: true
Comment thread
coderabbitai[bot] marked this conversation as resolved.

env:
GO_VERSION: "1.26"
NODE_VERSION: "20"
PNPM_VERSION: "10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo ".tool-versions:"
sed -n '1,5p' .tool-versions

echo
echo "Workflow env versions:"
sed -n '11,15p' .github/workflows/pr-checks.yml

Repository: omniviewdev/omniview

Length of output: 213


Align all environment versions with .tool-versions.

Version mismatches between workflow and .tool-versions can cause local/CI drift:

  • PNPM: workflow pins 10, .tool-versions has 9.15.0
  • NODE: workflow pins 20, .tool-versions has 20.18.1
  • GO: workflow pins 1.26, .tool-versions has 1.23.8 (most significant drift)

Update all three to match .tool-versions for consistency.

💡 Example fix
 env:
-  GO_VERSION: "1.26"
-  NODE_VERSION: "20"
-  PNPM_VERSION: "10"
+  GO_VERSION: "1.23.8"
+  NODE_VERSION: "20.18.1"
+  PNPM_VERSION: "9.15.0"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-checks.yml at line 14, Update the workflow environment
version pins to exactly match .tool-versions: change PNPM_VERSION to 9.15.0,
NODE_VERSION to 20.18.1, and GO_VERSION to 1.23.8 (update the PNPM_VERSION,
NODE_VERSION and GO_VERSION variables used in the workflow file so CI and local
dev use the same tool versions).


jobs:
go-checks:
name: Go checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Build
run: make go-build

- name: Vet
run: make go-vet

- name: Test
run: make go-test

- name: Format check
run: make fmt-check
continue-on-error: true

- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: run
Comment thread
coderabbitai[bot] marked this conversation as resolved.
env:
GOWORK: "off"
continue-on-error: true

bindings-check:
name: Bindings freshness
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Install wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.11.0

- name: Check bindings are up to date
run: make bindings-check

ui-checks:
name: UI checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: make ui-install

- name: Build
run: make ui-build

- name: Lint
run: make ui-lint
continue-on-error: true

- name: Typecheck
run: make ui-typecheck
continue-on-error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ lerna-debug.log*

node_modules
dist
!dist/.gitkeep
dist-ssr
*.local

Expand Down
Loading
Loading