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
63 changes: 61 additions & 2 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ jobs:
- name: Check TS configs
run: yarn check-ts-configs
working-directory: ${{ github.base_ref }}
- name: ESLint
run: yarn eslint
- name: Lint
run: yarn lint
working-directory: ${{ github.base_ref }}
- name: Check Package Node Modules
run: yarn check-package-dependencies
Expand Down Expand Up @@ -218,6 +218,65 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
aiFixStaticAnalysis:
name: AI Fix Static Analysis
needs:
- constants
- staticCodeAnalysis
if: >-
failure() && needs.staticCodeAnalysis.result == 'failure' &&
needs.constants.outputs.is-fork-pr != 'true' &&
github.event.pull_request.user.login == 'adrians5j'
permissions:
contents: write
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- uses: actions/setup-node@v5
with:
node-version: 24
- uses: actions/checkout@v5
with:
path: ${{ github.base_ref }}
- uses: actions/cache@v5
with:
path: ${{ github.base_ref }}/.yarn/cache
key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn --immutable
working-directory: ${{ github.base_ref }}
- name: Fix code formatting
run: yarn format:fix
working-directory: ${{ github.base_ref }}
continue-on-error: true
- name: Fix lint issues (auto-fixable)
run: yarn lint:fix
working-directory: ${{ github.base_ref }}
continue-on-error: true
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
- name: AI Fix Remaining Issues
working-directory: ${{ github.base_ref }}
run: >-
claude --dangerously-skip-permissions -p "Some static analysis checks
may still be failing. Fix any remaining issues: 1. Run 'yarn adio' —
if it reports dependency errors, fix the relevant package.json files.
2. Run 'yarn check-ts-configs' — if it reports errors, fix them. 3.
Run 'yarn lint' — if there are still non-auto-fixable errors, read
the affected files and fix them. 4. Run 'yarn
check-package-dependencies' — if it reports errors, fix them. Work in
the current directory."
- name: Update yarn.lock
run: yarn
working-directory: ${{ github.base_ref }}
- name: Commit fixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: ai fix static analysis [skip ci]'
repository: ${{ github.base_ref }}
runs-on: ubuntu-latest
vitest-constants:
needs:
- constants
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
- name: Check TS configs
run: yarn check-ts-configs
working-directory: v6
- name: ESLint
run: yarn eslint
- name: Lint
run: yarn lint
working-directory: v6
- name: Check Package Node Modules
run: yarn check-package-dependencies
Expand Down
126 changes: 63 additions & 63 deletions .github/workflows/wac/pullRequests.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const pullRequests = createWorkflow({
{ name: "Check code formatting", run: "yarn format:check" },
{ name: "Check dependencies", run: "yarn adio" },
{ name: "Check TS configs", run: "yarn check-ts-configs" },
{ name: "ESLint", run: "yarn eslint" },
{ name: "Lint", run: "yarn lint" },
{
name: "Check Package Node Modules",
run: "yarn check-package-dependencies"
Expand Down Expand Up @@ -278,68 +278,68 @@ export const pullRequests = createWorkflow({
)
]
}),
// aiFixStaticAnalysis: createJob({
// name: "AI Fix Static Analysis",
// needs: ["constants", "staticCodeAnalysis"],
// if: "failure() && needs.staticCodeAnalysis.result == 'failure' && needs.constants.outputs.is-fork-pr != 'true' && github.event.pull_request.user.login == 'adrians5j'",
// permissions: { contents: "write" },
// checkout: { path: DIR_WEBINY_JS },
// env: { ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}" },
// steps: [
// ...yarnCacheSteps,
// {
// name: "Install dependencies",
// run: "yarn --immutable",
// "working-directory": DIR_WEBINY_JS
// },
// // Run deterministic fixes as real shell commands so changes definitely land on disk.
// {
// name: "Fix code formatting",
// run: "yarn format:fix",
// "working-directory": DIR_WEBINY_JS,
// "continue-on-error": true
// },
// {
// name: "Fix ESLint issues (auto-fixable)",
// run: "yarn eslint:fix",
// "working-directory": DIR_WEBINY_JS,
// "continue-on-error": true
// },
// // Let Claude handle whatever can't be auto-fixed: adio, ts-configs,
// // remaining ESLint errors, and check-package-dependencies.
// {
// name: "Install Claude Code",
// run: "npm install -g @anthropic-ai/claude-code"
// },
// {
// name: "AI Fix Remaining Issues",
// "working-directory": DIR_WEBINY_JS,
// run: [
// `claude --dangerously-skip-permissions -p`,
// `"Some static analysis checks may still be failing. Fix any remaining issues:`,
// `1. Run 'yarn adio' — if it reports dependency errors, fix the relevant package.json files.`,
// `2. Run 'yarn check-ts-configs' — if it reports errors, fix them.`,
// `3. Run 'yarn eslint' — if there are still non-auto-fixable errors, read the affected files and fix them.`,
// `4. Run 'yarn check-package-dependencies' — if it reports errors, fix them.`,
// `Work in the current directory."`
// ].join(" ")
// },
// // Re-run yarn so yarn.lock is updated if package.json files were modified (e.g. by adio fixes).
// {
// name: "Update yarn.lock",
// run: "yarn",
// "working-directory": DIR_WEBINY_JS
// },
// {
// name: "Commit fixes",
// uses: "stefanzweifel/git-auto-commit-action@v5",
// with: {
// commit_message: "chore: ai fix static analysis [skip ci]",
// repository: DIR_WEBINY_JS
// }
// }
// ]
// }),
aiFixStaticAnalysis: createJob({
name: "AI Fix Static Analysis",
needs: ["constants", "staticCodeAnalysis"],
if: "failure() && needs.staticCodeAnalysis.result == 'failure' && needs.constants.outputs.is-fork-pr != 'true' && github.event.pull_request.user.login == 'adrians5j'",
permissions: { contents: "write" },
checkout: { path: DIR_WEBINY_JS },
env: { ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}" },
steps: [
...yarnCacheSteps,
{
name: "Install dependencies",
run: "yarn --immutable",
"working-directory": DIR_WEBINY_JS
},
// Run deterministic fixes as real shell commands so changes definitely land on disk.
{
name: "Fix code formatting",
run: "yarn format:fix",
"working-directory": DIR_WEBINY_JS,
"continue-on-error": true
},
{
name: "Fix lint issues (auto-fixable)",
run: "yarn lint:fix",
"working-directory": DIR_WEBINY_JS,
"continue-on-error": true
},
// Let Claude handle whatever can't be auto-fixed: adio, ts-configs,
// remaining lint errors, and check-package-dependencies.
{
name: "Install Claude Code",
run: "npm install -g @anthropic-ai/claude-code"
},
{
name: "AI Fix Remaining Issues",
"working-directory": DIR_WEBINY_JS,
run: [
`claude --dangerously-skip-permissions -p`,
`"Some static analysis checks may still be failing. Fix any remaining issues:`,
`1. Run 'yarn adio' — if it reports dependency errors, fix the relevant package.json files.`,
`2. Run 'yarn check-ts-configs' — if it reports errors, fix them.`,
`3. Run 'yarn lint' — if there are still non-auto-fixable errors, read the affected files and fix them.`,
`4. Run 'yarn check-package-dependencies' — if it reports errors, fix them.`,
`Work in the current directory."`
].join(" ")
},
// Re-run yarn so yarn.lock is updated if package.json files were modified (e.g. by adio fixes).
{
name: "Update yarn.lock",
run: "yarn",
"working-directory": DIR_WEBINY_JS
},
{
name: "Commit fixes",
uses: "stefanzweifel/git-auto-commit-action@v5",
with: {
commit_message: "chore: ai fix static analysis [skip ci]",
repository: DIR_WEBINY_JS
}
}
]
}),
...createVitestTestsJobs(),
...createVitestTestsJobs(ddbStorageOps),
...createVitestTestsJobs(ddbOsStorageOps)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wac/push.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export const push = createWorkflow({
{ name: "Check code formatting", run: "yarn format:check" },
{ name: "Check dependencies", run: "yarn adio" },
{ name: "Check TS configs", run: "yarn check-ts-configs" },
{ name: "ESLint", run: "yarn eslint" },
{ name: "Lint", run: "yarn lint" },
{
name: "Check Package Node Modules",
run: "yarn check-package-dependencies"
Expand Down
136 changes: 136 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react"],
"jsPlugins": ["eslint-plugin-lodash"],
"categories": {
"correctness": "off",
"suspicious": "off"
},
"env": {
"builtin": true
},
"globals": {
"node": "writable",
"commonjs": "writable",
"window": "writable",
"document": "writable"
},
"ignorePatterns": [
".github/**/*",
".idea/**/*",
".nx/**/*",
".pulumi/**/*",
".stormTests/**/*",
".swc/**/*",
".webiny/**/*",
".yarn/**/*",
"ai-context/**/*",
"coverage/**/*",
"devtools/**/*",
"docs/**/*",
"extensions/**/*",
"scripts/**/*",
"testing/**/*",
"**/node_modules/",
"**/dist/",
"**/lib/",
"**/build/",
"**/.out/",
"**/*.d.ts",
"idea.js",
"packages/**/planning/**/*",
"packages/admin-ui/.storybook/**/*",
"packages/admin-ui/storybook-static/**/*",
"packages/create-webiny-project/_templates/**/*"
],
"rules": {
"curly": ["error"],
"no-array-constructor": "error",
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["@aws-sdk/*"],
"message": "Please use @webiny/aws-sdk instead."
},
{
"group": ["@webiny/*/index.*"],
"message": "Do not import index.js/ts/* explicitly. Import the package root instead (e.g. `@webiny/utils`)."
}
]
}
],
"no-unused-expressions": "off",
"no-unused-vars": "warn",
"no-use-before-define": "off",
"lodash/import-scope": ["error", "method"],
"react/display-name": "error",
"react/jsx-key": "error",
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-undef": "error",
"react/no-children-prop": "error",
"react/no-danger-with-children": "error",
"react/no-direct-mutation-state": "error",
"react/no-find-dom-node": "error",
"react/no-is-mounted": "error",
"react/no-render-return-value": "error",
"react/no-string-refs": "error",
"react/no-unescaped-entities": "error",
"react/no-unknown-property": "error",
"react/no-unsafe": "off",
"react/react-in-jsx-scope": "error"
},
"overrides": [
{
"files": ["packages/**/*.{ts,tsx}"],
"plugins": ["typescript", "react"],
"rules": {
"typescript/ban-ts-comment": [
"error",
{
"ts-check": true,
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description",
"ts-expect-error": false
}
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "always",
"allowObjectTypes": "never"
}
],
"typescript/no-explicit-any": "off",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "off",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-non-null-assertion": "off",
"typescript/no-require-imports": "error",
"typescript/no-restricted-types": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-var-requires": "off",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error"
}
},
{
"files": ["packages/aws-sdk/**/*.{ts,tsx,js,jsx}"],
"rules": {
"no-restricted-imports": "off"
}
}
]
}
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ yarn adio
# Format changed files
yarn format > /dev/null 2>&1

# Run eslint
y eslint
# Run oxlint
yarn lint

# Make sure dependencies are in sync
yarn webiny sync-dependencies
Expand All @@ -61,7 +61,7 @@ If any of the steps fail, and you fix anything, you must rerun all scripts from
## Code Conventions

- **Formatting:** oxfmt with project defaults (`.oxfmtrc.json`)
- **Linting:** ESLint with project config (`.eslintrc`)
- **Linting:** Oxlint with project config (`.oxlintrc.json`)
- **Commit style:** Conventional Commits (`feat:`, `fix:`, `chore:`, etc.)
- **Branch naming:** `claude/issue-<number>` for Claude-generated branches
- **PR titles:** Mirror the commit style
Expand Down
Loading