このコミットが含まれているのは:
@@ -211,6 +211,13 @@ records.each {
|
|||||||
- In TypeScript and TSX, block bodies for components, functions, callbacks,
|
- In TypeScript and TSX, block bodies for components, functions, callbacks,
|
||||||
`if`, `try`, `catch`, `finally`, loops, and JSX nesting use 2 spaces per
|
`if`, `try`, `catch`, `finally`, loops, and JSX nesting use 2 spaces per
|
||||||
level.
|
level.
|
||||||
|
- In TypeScript and TSX, put the opening brace of `try`, `catch`, and
|
||||||
|
`finally` blocks on the next line at the same indentation as the keyword.
|
||||||
|
- Do not indent the opening `{` one level deeper than `try`, `catch`, or
|
||||||
|
`finally`.
|
||||||
|
- Indent the block body 2 spaces deeper than the keyword and opening brace.
|
||||||
|
- Put the closing `}` on its own line at the same indentation as the keyword.
|
||||||
|
- Do not write `try {`, `catch {`, or `finally {`.
|
||||||
- In TypeScript and TSX, use 4-space continuation indentation for wrapped
|
- In TypeScript and TSX, use 4-space continuation indentation for wrapped
|
||||||
expressions, arguments, conditions, arrays, object literals, JSX
|
expressions, arguments, conditions, arrays, object literals, JSX
|
||||||
attributes, and similar continuations.
|
attributes, and similar continuations.
|
||||||
@@ -578,6 +585,13 @@ and layout reuse, follow `frontend/AGENTS.md`.
|
|||||||
declarations, unless imports, exports, or file boundaries make that awkward.
|
declarations, unless imports, exports, or file boundaries make that awkward.
|
||||||
- In TSX, use 2-space block indentation and 4-space continuation
|
- In TSX, use 2-space block indentation and 4-space continuation
|
||||||
indentation.
|
indentation.
|
||||||
|
- In TypeScript and TSX, put the opening brace of `try`, `catch`, and
|
||||||
|
`finally` blocks on the next line at the same indentation as the keyword.
|
||||||
|
- Do not indent the opening `{` one level deeper than `try`, `catch`, or
|
||||||
|
`finally`.
|
||||||
|
- Indent the block body 2 spaces deeper than the keyword and opening brace.
|
||||||
|
- Put the closing `}` on its own line at the same indentation as the keyword.
|
||||||
|
- Do not write `try {`, `catch {`, or `finally {`.
|
||||||
- In TypeScript and TSX, convert every complete leading run of 8 spaces to a
|
- In TypeScript and TSX, convert every complete leading run of 8 spaces to a
|
||||||
tab character.
|
tab character.
|
||||||
- A leading tab is exactly equivalent to 8 leading spaces.
|
- A leading tab is exactly equivalent to 8 leading spaces.
|
||||||
@@ -628,6 +642,22 @@ and layout reuse, follow `frontend/AGENTS.md`.
|
|||||||
single physical line.
|
single physical line.
|
||||||
- Always add braces around `if`, `else`, or `for` bodies when the body spans
|
- Always add braces around `if`, `else`, or `for` bodies when the body spans
|
||||||
two or more physical lines, even if it is one statement.
|
two or more physical lines, even if it is one statement.
|
||||||
|
- `try` / `catch` / `finally` brace placement example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
try
|
||||||
|
{
|
||||||
|
doWork ()
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
recover ()
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
cleanUp ()
|
||||||
|
}
|
||||||
|
```
|
||||||
- Do not use a leading semicolon for expression statements such as
|
- Do not use a leading semicolon for expression statements such as
|
||||||
`;([...]).forEach(...)`; rewrite the expression to avoid ASI hazards
|
`;([...]).forEach(...)`; rewrite the expression to avoid ASI hazards
|
||||||
explicitly, for example with `void`.
|
explicitly, for example with `void`.
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ module Preview
|
|||||||
|
|
||||||
Response = Data.define(:body, :content_type, :url)
|
Response = Data.define(:body, :content_type, :url)
|
||||||
|
|
||||||
def self.fetch(raw_url,
|
def self.fetch(raw_url, max_bytes: DEFAULT_MAX_BYTES, redirects: MAX_REDIRECTS)
|
||||||
max_bytes: DEFAULT_MAX_BYTES,
|
|
||||||
redirects: MAX_REDIRECTS)
|
|
||||||
uri, addresses = UrlSafety.validate(raw_url)
|
uri, addresses = UrlSafety.validate(raw_url)
|
||||||
response = request(uri, addresses.first, max_bytes)
|
response = request(uri, addresses.first, max_bytes)
|
||||||
|
|
||||||
@@ -69,9 +67,7 @@ module Preview
|
|||||||
log_failure(:timeout, url: uri&.to_s || raw_url, error: e.class.name, message: e.message)
|
log_failure(:timeout, url: uri&.to_s || raw_url, error: e.class.name, message: e.message)
|
||||||
raise FetchTimeout, e.message
|
raise FetchTimeout, e.message
|
||||||
rescue SocketError, SystemCallError, OpenSSL::SSL::SSLError, EOFError => e
|
rescue SocketError, SystemCallError, OpenSSL::SSL::SSLError, EOFError => e
|
||||||
log_failure(:network_error,
|
log_failure(:network_error, url: uri&.to_s || raw_url, error: e.class.name,
|
||||||
url: uri&.to_s || raw_url,
|
|
||||||
error: e.class.name,
|
|
||||||
message: e.message)
|
message: e.message)
|
||||||
raise FetchFailed, e.message
|
raise FetchFailed, e.message
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -153,6 +153,13 @@ pass or the remaining failure is clearly blocked.
|
|||||||
closing `</div>)` forms when nearby code uses them.
|
closing `</div>)` forms when nearby code uses them.
|
||||||
- Block bodies for components, functions, callbacks, `if`, `try`, `catch`,
|
- Block bodies for components, functions, callbacks, `if`, `try`, `catch`,
|
||||||
`finally`, loops, and JSX nesting use 2 spaces per level.
|
`finally`, loops, and JSX nesting use 2 spaces per level.
|
||||||
|
- Put the opening brace of `try`, `catch`, and `finally` blocks on the next
|
||||||
|
line at the same indentation as the keyword.
|
||||||
|
- Do not indent the opening `{` one level deeper than `try`, `catch`, or
|
||||||
|
`finally`.
|
||||||
|
- Indent the block body 2 spaces deeper than the keyword and opening brace.
|
||||||
|
- Put the closing `}` on its own line at the same indentation as the keyword.
|
||||||
|
- Do not write `try {`, `catch {`, or `finally {`.
|
||||||
- Wrapped expressions, arguments, ternary branches, method chains, and object
|
- Wrapped expressions, arguments, ternary branches, method chains, and object
|
||||||
pairs use 4-space continuation indentation relative to the owning
|
pairs use 4-space continuation indentation relative to the owning
|
||||||
expression. Do not confuse this with 2-space block indentation.
|
expression. Do not confuse this with 2-space block indentation.
|
||||||
@@ -229,6 +236,23 @@ const Component = () => {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- `try` / `catch` / `finally` brace placement example:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
try
|
||||||
|
{
|
||||||
|
doWork ()
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
recover ()
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
cleanUp ()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- Continuation indentation example:
|
- Continuation indentation example:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import type { FC, MouseEvent } from 'react'
|
|||||||
|
|
||||||
import type { Material, Menu, MenuVisibleItem, Tag, User } from '@/types'
|
import type { Material, Menu, MenuVisibleItem, Tag, User } from '@/types'
|
||||||
|
|
||||||
type Props = { user: User | null, }
|
type Props = { user: User | null }
|
||||||
|
|
||||||
|
|
||||||
export const menuOutline = (
|
export const menuOutline = (
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする