Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: consistently quote props for editing #726

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ description: Install dependencies and perform setup for https://github.com/arkty

inputs:
node:
default: lts/*
default: latest

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.1.2
version: 8.3.1

- name: Setup Node (${{ inputs.node }})
uses: actions/setup-node@v3
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ jobs:
- name: Setup repo
uses: ./.github/actions/setup

- name: Typecheck
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Format
run: pnpm exec prettier --check --ignore-path ./dev/configs/.prettierignore .

- name: Test
run: pnpm testRepo

Expand All @@ -38,13 +44,8 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
node: [lts/*]
os: [windows-latest, macos-latest]
include:
- os: ubuntu-latest
node: lts/-1
- os: ubuntu-latest
node: latest
node: [14, 16, 18, 19, 20]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { type } from "../../src/main.js"
export const user = type({
name: "string",
device: {
platform: "'android'|'ios'",
"platform": "'android'|'ios'",
"version?": "number"
}
})
Expand Down Expand Up @@ -70,13 +70,13 @@ import { scope } from "../../src/main.js"
// Scopes are collections of types that can reference each other.
export const types = scope({
package: {
name: "string",
"name": "string",
"dependencies?": "package[]",
"contributors?": "contributor[]"
},
contributor: {
// Subtypes like 'email' are inferred like 'string' but provide additional validation at runtime.
email: "email",
"email": "email",
"packages?": "package[]"
}
}).compile()
Expand Down
2 changes: 1 addition & 1 deletion dev/arktype.io/docs/api/narrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ hide_table_of_contents: true

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const createStackblitzDemo = async ({ embedId }: DemoProps) =>
".prettierrc": JSON.stringify({
tabWidth: 4,
semi: false,
quoteProps: "consistent",
trailingComma: "none"
}),
...defaultStaticFiles
Expand Down
14 changes: 7 additions & 7 deletions dev/arktype.io/src/components/homeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ export const HomeDemo = () => {
variant="contained"
sx={{
backgroundColor,
backdropFilter: "blur(4px)",
borderRadius: "2rem",
fontSize: "1.5rem",
fontFamily: cascadiaCodeFamily,
textTransform: "none",
color: palette.primary.main,
"backdropFilter": "blur(4px)",
"borderRadius": "2rem",
"fontSize": "1.5rem",
"fontFamily": cascadiaCodeFamily,
"textTransform": "none",
"color": palette.primary.main,
"&:hover": {
backgroundColor,
color: palette.secondary.main,
backdropFilter: "blur(6px)"
},
zIndex: 1
"zIndex": 1
}}
onClick={() => setIsActive(!isActive)}
endIcon={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ hide_table_of_contents: true

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ hide_table_of_contents: true

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const createStackblitzDemo = async ({ embedId }: DemoProps) =>
".prettierrc": JSON.stringify({
tabWidth: 4,
semi: false,
quoteProps: "consistent",
trailingComma: "none"
}),
...defaultStaticFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ hide_table_of_contents: true

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const createStackblitzDemo = async ({ embedId }: DemoProps) =>
".prettierrc": JSON.stringify({
tabWidth: 4,
semi: false,
quoteProps: "consistent",
trailingComma: "none"
}),
...defaultStaticFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ hide_table_of_contents: true

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const createStackblitzDemo = async ({ embedId }: DemoProps) =>
".prettierrc": JSON.stringify({
tabWidth: 4,
semi: false,
quoteProps: "consistent",
trailingComma: "none"
}),
...defaultStaticFiles
Expand Down
4 changes: 2 additions & 2 deletions dev/configs/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = defineConfig({
/**
* General restrictions
*/
curly: "warn",
eqeqeq: "warn",
"curly": "warn",
"eqeqeq": "warn",
"object-shorthand": ["warn"],
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
8 changes: 4 additions & 4 deletions dev/examples/concision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import type { Infer } from "../../src/main.js"
{
// @snipStatement:arkUserExpression
const arkUser = type({
name: /^ark.*$/ as Infer<`ark${string}`>,
birthday: ["string", "|>", (s) => new Date(s)],
"name": /^ark.*$/ as Infer<`ark${string}`>,
"birthday": ["string", "|>", (s) => new Date(s)],
"powerLevel?": "1<=number<9000"
})
}

// @snipStatement:arkUserHelper
const arkUser = type({
name: /^ark.*$/ as Infer<`ark${string}`>,
birthday: morph("string", (s) => new Date(s)),
"name": /^ark.*$/ as Infer<`ark${string}`>,
"birthday": morph("string", (s) => new Date(s)),
"powerLevel?": "1<=number<9000"
})

Expand Down
4 changes: 2 additions & 2 deletions dev/examples/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { type } from "../../src/main.js"

// Define your type...
export const pkg = type({
name: "string",
version: "semver",
"name": "string",
"version": "semver",
"contributors?": "1<email[]<=10"
})

Expand Down
4 changes: 2 additions & 2 deletions dev/examples/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { scope } from "../../src/main.js"
// Scopes are collections of types that can reference each other.
export const types = scope({
package: {
name: "string",
"name": "string",
"dependencies?": "package[]",
"contributors?": "contributor[]"
},
contributor: {
// Subtypes like 'email' are inferred like 'string' but provide additional validation at runtime.
email: "email",
"email": "email",
"packages?": "package[]"
}
}).compile()
Expand Down
2 changes: 1 addition & 1 deletion dev/examples/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type } from "../../src/main.js"
export const user = type({
name: "string",
device: {
platform: "'android'|'ios'",
"platform": "'android'|'ios'",
"version?": "number"
}
})
Expand Down
4 changes: 2 additions & 2 deletions dev/test/cyclic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { attest } from "../attest/main.js"
const getCyclicScope = () =>
scope({
package: {
name: "string",
"name": "string",
"dependencies?": "package[]",
"contributors?": "contributor[]"
},
contributor: {
email: "email",
"email": "email",
"packages?": "package[]"
}
})
Expand Down
4 changes: 2 additions & 2 deletions dev/test/discriminate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("discriminate", () => {
["isRainForest", [["value", true]]]
]
],
default: [
"default": [
[
"requiredProp",
["temperature", [["value", "hot"]]]
Expand All @@ -179,7 +179,7 @@ describe("discriminate", () => {
cases: {
"'cold'": [],
"'hot'": [],
default: [
"default": [
[
"switch",
{
Expand Down
4 changes: 2 additions & 2 deletions dev/test/generateBenchData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const randomInRange = (min: number, max: number) =>

const cyclicScopeSeed = Object.freeze({
user: {
name: "string",
"name": "string",
"friends?": "user[]",
groups: "group[]"
"groups": "group[]"
},
group: {
title: "string",
Expand Down