-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
168 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
{ | ||
"extends": ["eslint-config-unjs"] | ||
"extends": ["eslint-config-unjs"], | ||
"rules": { | ||
"unicorn/no-null": "off", | ||
"require-await": "error", | ||
"unicorn/filename-case": "off", | ||
"unicorn/no-process-exit": "error", | ||
"unicorn/prefer-ternary": "error", | ||
"unicorn/prefer-top-level-await": "off", | ||
"no-useless-constructor": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_", | ||
}, | ||
], | ||
"@typescript-eslint/no-namespace": "error", | ||
"camelcase": "off", | ||
"unicorn/prefer-code-point": "error", | ||
"unicorn/prefer-string-slice": "off", | ||
"unicorn/prefer-at": "off", | ||
"unicorn/explicit-length-check": "off", | ||
"unicorn/prefer-set-has": "off", | ||
"no-empty": [ | ||
"error", | ||
{ | ||
"allowEmptyCatch": true, | ||
}, | ||
], | ||
"prefer-const": "error", | ||
"unicorn/no-empty-file": "error", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: CI Linting | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
linting: | ||
name: Run Linting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Enable Corepack | ||
run: corepack enable | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Lint JavaScript | ||
run: pnpm run lint:js | ||
|
||
- name: Check formatting | ||
run: pnpm run lint:format | ||
|
||
- name: Type checking | ||
run: pnpm run lint:types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
import { DurableObjectState } from "@cloudflare/workers-types"; | ||
import type { Env } from "nitro-cloudflare-dev"; | ||
|
||
export class Workflows { | ||
constructor(state: DurableObjectState, env: Env) {} | ||
|
||
async fetch(request: Request) { | ||
fetch() { | ||
return new Response("Hello World"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import fs from "fs/promises"; | ||
import fs from "node:fs/promises"; | ||
if (process.env.CI) { | ||
const content = Object.entries(process.env) | ||
.filter(([k]) => k.startsWith("NITRO")) | ||
.map(([k, v]) => `${k}="${v}"`) | ||
.concat(["NITRO_TEST=true", "GITHUB_TOKEN=" + process.env.GITHUB_TOKEN!]) | ||
.join("\n"); | ||
const content = [ | ||
...Object.entries(process.env) | ||
.filter(([k]) => k.startsWith("NITRO")) | ||
.map(([k, v]) => `${k}="${v}"`), | ||
"NITRO_TEST=true", | ||
"GITHUB_TOKEN=" + process.env.GITHUB_TOKEN!, | ||
].join("\n"); | ||
await fs.writeFile(".dev.vars", content); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default defineEventHandler((event) => { | ||
if (handleCors(event, {})) { | ||
return; | ||
console.log("CORS was successfully handled"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default defineNitroPlugin((nitro) => { | ||
nitro.hooks.hook("error", async (error, { event }) => { | ||
nitro.hooks.hook("error", (error, { event }) => { | ||
console.error(`${event?.path} Application error:`, error); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.