Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/buf-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions biome.base.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": ["tsconfig.*.json", "src/gen/**", "packages/*/dist/**", ".turbo"]
"includes": [
"**",
"!**/tsconfig.*.json",
"!**/src/gen",
"!**/packages/*/dist",
"!**/.turbo"
]
},
"formatter": {
"indentStyle": "space"
},
"linter": {
"rules": {
"recommended": true,
"preset": "recommended",
"style": {
"useTemplate": "off",
"useConst": "off",
Expand Down
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"extends": ["./biome.base.json"],
"files": {
"ignore": ["packages/**"]
"includes": ["!**/packages"]
}
}
73 changes: 36 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.5",
"@biomejs/biome": "^1.9.4",
"@biomejs/biome": "^2.5.14",
"@bufbuild/buf": "^1.72.0",
"@bufbuild/license-header": "^0.0.4",
"@bufbuild/protoc-gen-es": "^2.14.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/cel-spec/biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"root": true,
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"extends": ["../../biome.base.json"],
"files": {
"ignore": ["dist"],
"includes": ["!**/dist", "!**/src/gen"],
"maxSize": 2000000
},
"linter": {
Expand Down
44 changes: 33 additions & 11 deletions packages/cel-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,42 @@
},
"typesVersions": {
"*": {
"testdata/checking.js": ["./dist/cjs/testdata/checking.d.ts"],
"testdata/comprehension.js": ["./dist/cjs/testdata/comprehension.d.ts"],
"testdata/conformance.js": ["./dist/cjs/testdata/conformance.d.ts"],
"testdata/parsing.js": ["./dist/cjs/testdata/parsing.d.ts"],
"testdata/registry.js": ["./dist/cjs/testdata/registry.d.ts"],
"testdata/tests.js": ["./dist/cjs/testdata/tests.d.ts"],
"testdata/checking.js": [
"./dist/cjs/testdata/checking.d.ts"
],
"testdata/comprehension.js": [
"./dist/cjs/testdata/comprehension.d.ts"
],
"testdata/conformance.js": [
"./dist/cjs/testdata/conformance.d.ts"
],
"testdata/parsing.js": [
"./dist/cjs/testdata/parsing.d.ts"
],
"testdata/registry.js": [
"./dist/cjs/testdata/registry.d.ts"
],
"testdata/tests.js": [
"./dist/cjs/testdata/tests.d.ts"
],
"testdata/to-debug-string.js": [
"./dist/cjs/testdata/to-debug-string.d.ts"
],
"cel/expr/checked_pb.js": ["./dist/cjs/gen/cel/expr/checked_pb.d.ts"],
"cel/expr/eval_pb.js": ["./dist/cjs/gen/cel/expr/eval_pb.d.ts"],
"cel/expr/explain_pb.js": ["./dist/cjs/gen/cel/expr/explain_pb.d.ts"],
"cel/expr/syntax_pb.js": ["./dist/cjs/gen/cel/expr/syntax_pb.d.ts"],
"cel/expr/value_pb.js": ["./dist/cjs/gen/cel/expr/value_pb.d.ts"],
"cel/expr/checked_pb.js": [
"./dist/cjs/gen/cel/expr/checked_pb.d.ts"
],
"cel/expr/eval_pb.js": [
"./dist/cjs/gen/cel/expr/eval_pb.d.ts"
],
"cel/expr/explain_pb.js": [
"./dist/cjs/gen/cel/expr/explain_pb.d.ts"
],
"cel/expr/syntax_pb.js": [
"./dist/cjs/gen/cel/expr/syntax_pb.d.ts"
],
"cel/expr/value_pb.js": [
"./dist/cjs/gen/cel/expr/value_pb.d.ts"
],
"cel/expr/conformance/conformance_service_pb.js": [
"./dist/cjs/gen/cel/expr/conformance/conformance_service_pb.d.ts"
],
Expand Down
6 changes: 2 additions & 4 deletions packages/cel-spec/src/testdata/to-debug-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ const decoder = new TextDecoder();
// These expressions MUST capture a single character (a string `S` where `S.length == 1`)
// @ts-expect-error - The regex flag `v` is only available in ES2024 or later
const UNPRINTABLE_EXP: CharRegExp = /[^\p{L}\p{N}\p{S}\p{P}\p{Cs} ]/v;
// @ts-expect-error - The regex flag `v` is only available in ES2024 or later
const UNPRINTABLE_EXP_GLOBAL: CharRegExp = /[^\p{L}\p{N}\p{S}\p{P}\p{Cs} ]/gv;

const SPECIAL_ESCAPES: Map<number, string> = new Map([
[0x07, "\\a"],
Expand Down Expand Up @@ -567,7 +565,7 @@ export class SemanticAdorner implements Adorner {
}

export function formatCELType(t: Type | undefined): string {
if (!t || !t.typeKind.case) {
if (!t?.typeKind.case) {
return "dyn";
}

Expand Down Expand Up @@ -610,7 +608,7 @@ export function formatCELType(t: Type | undefined): string {
return "dyn";
}
case "type":
if (!t.typeKind.value || !t.typeKind.value.typeKind.case) {
if (!t.typeKind.value?.typeKind.case) {
return "type";
}
return `type(${formatCELType(t.typeKind.value)})`;
Expand Down
8 changes: 6 additions & 2 deletions packages/cel/biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"root": true,
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"extends": ["../../biome.base.json"],
"files": {
"includes": ["!**/dist", "!**/src/gen"]
},
"formatter": {
"ignore": ["dist", "src/gen"]
"includes": ["**", "!**/dist/**", "!**/src/gen/**"]
},
"linter": {
"rules": {
Expand Down
4 changes: 3 additions & 1 deletion packages/cel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
},
"typesVersions": {
"*": {
"ext": ["./dist/cjs/ext/index.d.ts"]
"ext": [
"./dist/cjs/ext/index.d.ts"
]
}
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/cel/src/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ class NativeMap implements CelMap {
// biome-ignore lint/suspicious/noExplicitAny: Part of the Map interface.
thisArg?: any,
): void {
this._map.forEach((value, key, _) =>
callback.call(thisArg, toCel(value), key, this),
);
this._map.forEach((value, key, _) => {
callback.call(thisArg, toCel(value), key, this);
});
}

*entries(): MapIterator<[string | bigint | boolean | CelUint, CelValue]> {
Expand Down Expand Up @@ -188,14 +188,14 @@ class ProtoMap implements CelMap {
// biome-ignore lint/suspicious/noExplicitAny: Part of the Map interface.
thisArg?: any,
): void {
this._map.forEach((value, key, _) =>
this._map.forEach((value, key, _) => {
callback.call(
thisArg,
celFromMapValue(this._map.field(), value),
celFromMapKey(this._map.field(), key),
this,
),
);
);
});
}

*entries(): MapIterator<[string | bigint | boolean | CelUint, CelValue]> {
Expand Down
3 changes: 2 additions & 1 deletion packages/example/biome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"root": true,
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"extends": ["../../biome.base.json"]
}
8 changes: 6 additions & 2 deletions packages/re2/biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"root": true,
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"extends": ["../../biome.base.json"],
"files": {
"includes": ["!**/dist", "!**/src/gen"]
},
"formatter": {
"ignore": ["dist", "src/gen"]
"includes": ["**", "!**/dist/**", "!**/src/gen/**"]
},
"linter": {
"rules": {
Expand Down
3 changes: 3 additions & 0 deletions packages/re2/scripts/genUnicodeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ const code = [
" }",
' let kind: "category" | "script" | null = null',
" let pattern: string | null = null",
// biome-ignore lint/suspicious/noTemplateCurlyInString: These strings emit template literals.
' if (STABLE_CATEGORY_NAMES.has(name)) { kind = "category"; pattern = `\\\\p{General_Category=${name}}` }',
// biome-ignore lint/suspicious/noTemplateCurlyInString: These strings emit template literals.
' else if (STABLE_SCRIPT_NAMES.has(name)) { kind = "script"; pattern = `\\\\p{Script=${name}}` }',
" else return null",
"",
// biome-ignore lint/suspicious/noTemplateCurlyInString: This string emits a template literal.
" const cacheKey = `${kind}:${name}`",
" const cached = _sweepCache.get(cacheKey)",
" if (cached) return cached",
Expand Down
Loading
Loading