Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/tidy-effects-diagnose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-app/eslint-shared-config": patch
---

Run configured Effect diagnostics through Oxlint's type-aware lint integration.
22 changes: 21 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"extends": ["./packages/eslint-shared-config/src/oxlintrc.json"],
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/any-unknown-in-error-context": "off",
"effecttsgo/effect-fn-iife": "off",
"effecttsgo/global-error-in-effect-catch": "off",
"effecttsgo/layer-merge-all-with-dependencies": "off",
"effecttsgo/lazy-effect": "off",
"effecttsgo/return-effect-in-gen": "off",
"effecttsgo/run-effect-inside-effect": "off",
"effecttsgo/schema-sync-in-effect": "off",
"effecttsgo/strict-effect-provide": "off",
"effecttsgo/unknown-in-effect-catch": "off",
"effecttsgo/missing-effect-service-dependency": "error",
"effecttsgo/effect-fn-opportunity": "warn",
"effecttsgo/global-error-in-effect-failure": "warn",
"effecttsgo/prefer-schema-over-json": "warn"
},
// ignorePatterns overwrites (not merges) the base — all standard patterns must be repeated here.
"ignorePatterns": [
"**/dist/**",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build": "cd packages/eslint-shared-config && pnpm build && cd ../.. && cd packages/cli && pnpm build && cd .. && pnpm build:tsc && cd vue-components && pnpm build",
"rbuild": "pnpm clean && pnpm build",
"nnm": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + && pnpm i",
"prepare": "node -e \"const v=require('typescript/package.json').version;if(v.startsWith('6.')){require('child_process').execSync('effect-language-service patch',{stdio:'inherit'})}else{console.log('Skipping effect-language-service patch for TypeScript '+v)}\" && node scripts/install-git-hooks.mjs",
"prepare": "node -e \"const v=require('typescript/package.json').version;if(v.startsWith('6.')){require('child_process').execSync('effect-language-service patch',{stdio:'inherit'})}else{console.log('Skipping effect-language-service patch for TypeScript '+v)}\" && effect-tsgo patch --no-typescript --oxlint && node scripts/install-git-hooks.mjs",
"subtree:effect": "node scripts/sync-effect-subtree.js"
},
"dependencies": {
Expand All @@ -49,6 +49,7 @@
"@effect-app/eslint-codegen-model": "workspace:*",
"@effect-app/infra": "workspace:*",
"@effect/language-service": "0.86.2",
"@effect/tsgo": "^0.31.0",
"@effect/platform-node": "4.0.0-beta.90",
"@effect/vitest": "4.0.0-beta.90",
"@tsconfig/strictest": "^2.0.8",
Expand All @@ -64,8 +65,8 @@
"lint-staged": "^17.3.0",
"madge": "^8.0.0",
"npm-check-updates": "^22.2.1",
"oxlint": "^1.67.0",
"oxlint-tsgolint": "^0.23.0",
"oxlint": "1.77.0",
"oxlint-tsgolint": "7.0.2001",
"pkg-pr-new": "0.0.75",
"ts-plugin-sort-import-suggestions": "^1.0.4",
"typescript": "~6.0.3",
Expand Down
94 changes: 47 additions & 47 deletions packages/effect-app/src/Model/query/dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export const relation = <
expr: {
field: (field: FieldPath<RelationElement<TFieldValues, P>>): ComputedProjectionMathExpression => ({
_tag: "field",
field: field as string
field
}),
mul: (
left: ComputedProjectionMathExpression,
Expand All @@ -716,33 +716,33 @@ export const relation = <
},
length: (): ComputedProjectionExpression<number> => ({
_tag: "relation-length",
path: path as string
path
}),
count: (operation?: ComputedProjectionOperation): ComputedProjectionExpression<number> =>
operation
? {
_tag: "relation-count",
path: path as string,
path,
operation
}
: {
_tag: "relation-count",
path: path as string
path
},
any: (operation?: ComputedProjectionOperation): ComputedProjectionExpression<boolean> =>
operation
? {
_tag: "relation-any",
path: path as string,
path,
operation
}
: {
_tag: "relation-any",
path: path as string
path
},
every: (operation: ComputedProjectionOperation): ComputedProjectionExpression<boolean> => ({
_tag: "relation-every",
path: path as string,
path,
operation
}),
distinctCount: <const F extends FieldPath<RelationElement<TFieldValues, P>>>(
Expand All @@ -752,14 +752,14 @@ export const relation = <
operation
? {
_tag: "relation-distinct-count",
path: path as string,
field: field as string,
path,
field,
operation
}
: {
_tag: "relation-distinct-count",
path: path as string,
field: field as string
path,
field
},
sum: <const F extends FieldPath<RelationElement<TFieldValues, P>>>(
field: F,
Expand All @@ -768,14 +768,14 @@ export const relation = <
operation
? {
_tag: "relation-sum",
path: path as string,
field: field as string,
path,
field,
operation
}
: {
_tag: "relation-sum",
path: path as string,
field: field as string
path,
field
},
sumExpr: (
expression: ComputedProjectionMathExpression,
Expand All @@ -784,13 +784,13 @@ export const relation = <
operation
? {
_tag: "relation-sum-expr",
path: path as string,
path,
expression,
operation
}
: {
_tag: "relation-sum-expr",
path: path as string,
path,
expression
},
sumExprBy: <const F extends FieldPath<RelationElement<TFieldValues, P>>>(
Expand All @@ -803,16 +803,16 @@ export const relation = <
operation
? {
_tag: "relation-sum-expr-by",
path: path as string,
path,
expression,
unit: options.unit as string,
unit: options.unit,
operation
}
: {
_tag: "relation-sum-expr-by",
path: path as string,
path,
expression,
unit: options.unit as string
unit: options.unit
},
sumExprNormalized: (
expression: ComputedProjectionMathExpression,
Expand All @@ -826,18 +826,18 @@ export const relation = <
operation
? {
_tag: "relation-sum-expr-normalized",
path: path as string,
path,
expression,
unit: options.unit as string,
unit: options.unit,
toBase: options.toBase,
factors: options.factors,
operation
}
: {
_tag: "relation-sum-expr-normalized",
path: path as string,
path,
expression,
unit: options.unit as string,
unit: options.unit,
toBase: options.toBase,
factors: options.factors
},
Expand All @@ -848,15 +848,15 @@ export const relation = <
operation
? {
_tag: "relation-collect",
path: path as string,
field: field as string,
path,
field,
distinct: false,
operation
}
: {
_tag: "relation-collect",
path: path as string,
field: field as string,
path,
field,
distinct: false
},
collectDistinct: <const F extends FieldPath<RelationElement<TFieldValues, P>>>(
Expand All @@ -866,15 +866,15 @@ export const relation = <
operation
? {
_tag: "relation-collect",
path: path as string,
field: field as string,
path,
field,
distinct: true,
operation
}
: {
_tag: "relation-collect",
path: path as string,
field: field as string,
path,
field,
distinct: true
},
collectFields: <const F extends readonly FieldPath<RelationElement<TFieldValues, P>>[]>(
Expand All @@ -886,15 +886,15 @@ export const relation = <
operation
? {
_tag: "relation-collect-fields",
path: path as string,
fields: fields as readonly string[],
path,
fields,
distinct: false,
operation
}
: {
_tag: "relation-collect-fields",
path: path as string,
fields: fields as readonly string[],
path,
fields,
distinct: false
},
collectDistinctFields: <const F extends readonly FieldPath<RelationElement<TFieldValues, P>>[]>(
Expand All @@ -906,15 +906,15 @@ export const relation = <
operation
? {
_tag: "relation-collect-fields",
path: path as string,
fields: fields as readonly string[],
path,
fields,
distinct: true,
operation
}
: {
_tag: "relation-collect-fields",
path: path as string,
fields: fields as readonly string[],
path,
fields,
distinct: true
}
})
Expand All @@ -930,7 +930,7 @@ export const relation = <
export const expr = {
field: <T extends FieldValues = FieldValues>(
field: FieldPath<T>
): ComputedProjectionMathExpression => ({ _tag: "field", field: field as string }),
): ComputedProjectionMathExpression => ({ _tag: "field", field }),
mul: (
left: ComputedProjectionMathExpression,
right: ComputedProjectionMathExpression
Expand Down Expand Up @@ -1059,7 +1059,7 @@ export const projectComputed: {
const computedProjection = typeof mapOrBuild === "function"
? mapOrBuild(makeComputedHelpers())
: mapOrBuild
return new Project({ current, schema, mode, computed: computedProjection } as any)
return new Project({ current, schema, mode, computed: computedProjection })
}

/**
Expand All @@ -1077,12 +1077,12 @@ export interface AggBuilder<TFieldValues extends FieldValues> {
}

const makeAggBuilder = <TFieldValues extends FieldValues>(): AggBuilder<TFieldValues> => ({
field: (path) => ({ _tag: "agg-field", path: path as string }),
field: (path) => ({ _tag: "agg-field", path }),
count: () => ({ _tag: "agg-count" }),
countWhen: (operation) => ({ _tag: "agg-count-when", operation }),
sum: (field) => ({ _tag: "agg-sum", field: field as string }),
min: (field) => ({ _tag: "agg-min", field: field as string }),
max: (field) => ({ _tag: "agg-max", field: field as string })
sum: (field) => ({ _tag: "agg-sum", field }),
min: (field) => ({ _tag: "agg-min", field }),
max: (field) => ({ _tag: "agg-max", field })
})

/**
Expand Down
16 changes: 8 additions & 8 deletions packages/effect-app/src/Model/query/new-kid-interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,17 @@ const interpret = <
case "relation-count":
case "relation-any":
case "relation-every":
return [key, { _tag: e._tag, path: e.path, filter } as ComputedProjectionIrExpression]
return [key, { _tag: e._tag, path: e.path, filter }]
case "relation-distinct-count":
case "relation-sum":
return [
key,
{ _tag: e._tag, path: e.path, field: e.field, filter } as ComputedProjectionIrExpression
{ _tag: e._tag, path: e.path, field: e.field, filter }
]
case "relation-sum-expr":
return [
key,
{ _tag: e._tag, path: e.path, expression: e.expression, filter } as ComputedProjectionIrExpression
{ _tag: e._tag, path: e.path, expression: e.expression, filter }
]
case "relation-sum-expr-by":
return [
Expand All @@ -337,7 +337,7 @@ const interpret = <
expression: e.expression,
unit: e.unit,
filter
} as ComputedProjectionIrExpression
}
]
case "relation-sum-expr-normalized":
return [
Expand All @@ -350,7 +350,7 @@ const interpret = <
toBase: e.toBase,
factors: e.factors,
filter
} as ComputedProjectionIrExpression
}
]
case "relation-collect":
return [
Expand All @@ -361,7 +361,7 @@ const interpret = <
field: e.field,
distinct: e.distinct,
filter
} as ComputedProjectionIrExpression
}
]
case "relation-collect-fields":
return [
Expand All @@ -372,10 +372,10 @@ const interpret = <
fields: e.fields,
distinct: e.distinct,
filter
} as ComputedProjectionIrExpression
}
]
case "relation-length":
return [key, { _tag: e._tag, path: e.path } as ComputedProjectionIrExpression]
return [key, { _tag: e._tag, path: e.path }]
}
})
)
Expand Down
2 changes: 1 addition & 1 deletion packages/effect-app/src/ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const RequestId = extendM(
function make(input: string, options?: S.MakeOptions): NonEmptyString255
function make(input?: string, options?: S.MakeOptions): NonEmptyString255 {
const id = input === undefined ? StringId.make() : StringId.make(input, options)
return id as NonEmptyString255
return id
}
return ({
make,
Expand Down
Loading
Loading