Skip to content

Commit 9bba505

Browse files
committed
chore: expand oxlint plugins and add agentic coding section
Enable all default plugins (eslint, typescript, unicorn, oxc) that were previously dropped when plugins field was explicitly set, plus react, jsx-a11y, import, and vitest for broader coverage. Key changes: - oxlintrc.json: add 7 new plugins, enable import/no-cycle for circular dependency detection, disable rules incompatible with project (React 17 JSX transform, ES2022 target, side-effect imports) - Fix lint violations caught by new plugins: unnecessary template literal, missing html lang attribute, label-control association for a11y - Fix lint:ci ignore-pattern mismatch in apps/cdk - Add inline oxlint-disable for intentional test.skip and assertion-free integration tests - README: add Agentic Coding section with DSQL skill install and oxlint/oxfmt post-write hook recommendation
1 parent 5654754 commit 9bba505

File tree

8 files changed

+41
-6
lines changed

8 files changed

+41
-6
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ See [`AGENTS.md`](./AGENTS.md) for development guide — local development setup
9999

100100
To add social sign-in (Google, Facebook, etc.), see [Add social sign-in to a user pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-configuring-federation-with-social-idp.html).
101101

102+
## Agentic coding
103+
104+
This kit is designed to work well with AI coding agents. The following setup is recommended.
105+
106+
### Aurora DSQL skill
107+
108+
Install the [Aurora DSQL skill](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/SECTION_aurora-dsql-steering.html) to give your agent DSQL-specific knowledge (schema design, migration patterns, constraints):
109+
110+
```sh
111+
npx skills add awslabs/mcp --skill dsql
112+
```
113+
114+
### Lint and format on save
115+
116+
This kit uses [oxlint](https://oxc.rs/) + [oxfmt](https://oxc.rs/docs/guide/usage/formatter) — Rust-based linter and formatter fast enough to run on every file write without noticeable delay. Set up a post-write hook in your AI coding agent to get instant feedback:
117+
118+
```sh
119+
oxlint --config oxlintrc.json --fix <file>
120+
oxfmt --write <file>
121+
```
122+
102123
## Maintenance policy
103124

104125
This kit follows [Semantic Versioning](https://semver.org/). Since users copy (not fork) this kit, breaking changes are introduced as new major versions without a lengthy deprecation cycle.

apps/cdk/lib/constructs/cf-lambda-furl-service/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class CloudFrontLambdaFunctionUrlService extends Construct {
150150
parameters: {
151151
DistributionId: distribution.distributionId,
152152
InvalidationBatch: {
153-
CallerReference: `${handler.currentVersion.version}`,
153+
CallerReference: handler.currentVersion.version,
154154
Paths: {
155155
Quantity: 1,
156156
Items: ['/*'],

apps/cdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"format": "oxfmt --write .",
1010
"format:ci": "oxfmt --check .",
1111
"lint": "oxlint --config ../../oxlintrc.json --fix --ignore-pattern lib/constructs/dsql-migrator/handler.ts .",
12-
"lint:ci": "oxlint --config ../../oxlintrc.json --max-warnings 0 .",
12+
"lint:ci": "oxlint --config ../../oxlintrc.json --max-warnings 0 --ignore-pattern lib/constructs/dsql-migrator/handler.ts .",
1313
"check": "pnpm run lint && pnpm run format",
1414
"check:ci": "pnpm run lint:ci && pnpm run format:ci",
1515
"cdk": "cdk"

apps/webapp/src/app/(root)/components/TodoItem.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ export default function TodoItemComponent({ todo }: TodoItemProps) {
9595
<input type="hidden" {...registerUpdate('status')} value={todo.status} />
9696

9797
<div>
98-
<label className="block text-sm font-medium text-gray-700">Title</label>
98+
<label htmlFor={`title-${todo.id}`} className="block text-sm font-medium text-gray-700">
99+
Title
100+
</label>
99101
<input
102+
id={`title-${todo.id}`}
100103
type="text"
101104
{...registerUpdate('title')}
102105
className="mt-1 p-2 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"
@@ -107,8 +110,11 @@ export default function TodoItemComponent({ todo }: TodoItemProps) {
107110
</div>
108111

109112
<div>
110-
<label className="block text-sm font-medium text-gray-700">Description</label>
113+
<label htmlFor={`description-${todo.id}`} className="block text-sm font-medium text-gray-700">
114+
Description
115+
</label>
111116
<textarea
117+
id={`description-${todo.id}`}
112118
{...registerUpdate('description')}
113119
rows={3}
114120
className="mt-1 p-2 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"

apps/webapp/src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Toaster } from 'sonner';
33

44
export default function RootLayout({ children }: { children: React.ReactNode }) {
55
return (
6-
<html>
6+
<html lang="en">
77
<head>
88
<title>AWS Serverless TODO</title>
99
{/* Comment out this meta tag if you want to enable search engine crawling */}

oxlintrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3-
"plugins": ["nextjs", "typescript"],
3+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "nextjs", "react", "jsx-a11y", "import", "vitest"],
44
"options": {
55
"typeAware": true,
66
"typeCheck": true
@@ -12,8 +12,12 @@
1212
"rules": {
1313
"typescript/no-unused-vars": "off",
1414
"typescript/no-unsafe-type-assertion": "off",
15+
"unicorn/no-array-sort": "off",
1516
"no-new": "off",
1617
"no-unused-expressions": "off",
18+
"react/react-in-jsx-scope": "off",
19+
"import/no-cycle": "error",
20+
"import/no-unassigned-import": "off",
1721
"no-restricted-imports": [
1822
"error",
1923
{

packages/db/src/migrate.integ.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ describe.skipIf(!endpoint)('migrate integration (DSQL)', () => {
118118
}
119119
});
120120

121+
// oxlint-disable-next-line jest/expect-expect -- success of await migrate() is the assertion
121122
test('I4: modified applied file still skipped (no hash check)', async () => {
122123
fs.writeFileSync(
123124
path.join(tmpDir, '0001_initial.sql'),
@@ -161,6 +162,7 @@ describe.skipIf(!endpoint)('migrate integration (DSQL)', () => {
161162
}
162163
});
163164

165+
// oxlint-disable-next-line jest/expect-expect -- success of await migrate() is the assertion
164166
test('I6: multiple statements in separate transactions', async () => {
165167
fs.writeFileSync(
166168
path.join(tmpDir, '0001.sql'),

packages/db/src/schema.integ.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe('oxlint DSQL rules', () => {
6464
// no-restricted-syntax is not yet supported by oxlint (as of v1.56.0).
6565
// The rule is configured in oxlintrc.json for future compatibility.
6666
// These tests are skipped until oxlint adds support.
67+
// oxlint-disable-next-line jest/no-disabled-tests -- waiting for oxlint no-restricted-syntax support
6768
test.skip('L5: .references() detected in schema.ts', () => {
6869
const file = writeFile(
6970
'schema.ts',
@@ -78,6 +79,7 @@ describe('oxlint DSQL rules', () => {
7879
expect(output).toContain('no-restricted-syntax');
7980
});
8081

82+
// oxlint-disable-next-line jest/no-disabled-tests -- waiting for oxlint no-restricted-syntax support
8183
test.skip('L6: .references() not detected in non-schema file', () => {
8284
const file = writeFile('actions.ts', "const x = { references: () => 'ok' };\nx.references();\n");
8385
const { output } = runOxlint(file);

0 commit comments

Comments
 (0)