-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: lint repository with eslint config and format with prettier (#739
- Loading branch information
Showing
169 changed files
with
5,152 additions
and
4,057 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,10 +1,19 @@ | ||
{ | ||
"extends": [ | ||
"@nuxtjs/eslint-config-typescript" | ||
], | ||
"extends": ["eslint-config-unjs"], | ||
"rules": { | ||
"import/no-named-as-default-member": "off", | ||
"import/default": "off", | ||
"no-console": "off" | ||
"space-before-function-paren": 0, | ||
"arrow-parens": 0, | ||
"comma-dangle": 0, | ||
"semi": 0, | ||
"unicorn/prevent-abbreviations": 0, | ||
"quotes": 0, | ||
"keyword-spacing": 0, | ||
"no-undef": 0, | ||
"unicorn/catch-error-name": 0, | ||
"unicorn/no-null": 0, | ||
"unicorn/no-useless-undefined": 0, | ||
"unicorn/no-await-expression-member": 0, | ||
"unicorn/no-array-push-push": 0, | ||
"unicorn/filename-case": 0 | ||
} | ||
} |
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 |
---|---|---|
|
@@ -35,4 +35,3 @@ Examples: | |
|
||
- [ ] I have linked an issue or discussion. | ||
- [ ] I have updated the documentation accordingly. | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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,22 +1,20 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
import { defineBuildConfig } from "unbuild"; | ||
|
||
export default defineBuildConfig({ | ||
declaration: true, | ||
name: 'nitro', | ||
name: "nitro", | ||
entries: [ | ||
'src/index', | ||
'src/cli', | ||
{ input: 'src/runtime/', outDir: 'dist/runtime', format: 'esm' } | ||
"src/index", | ||
"src/cli", | ||
{ input: "src/runtime/", outDir: "dist/runtime", format: "esm" }, | ||
], | ||
dependencies: [ | ||
'@cloudflare/kv-asset-handler', | ||
'@netlify/functions', | ||
'@nuxt/devalue', | ||
'destr', | ||
'ofetch', | ||
'ora' | ||
"@cloudflare/kv-asset-handler", | ||
"@netlify/functions", | ||
"@nuxt/devalue", | ||
"destr", | ||
"ofetch", | ||
"ora", | ||
], | ||
externals: [ | ||
'@nuxt/schema' | ||
] | ||
}) | ||
externals: ["@nuxt/schema"], | ||
}); |
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 +1 @@ | ||
export default defineEventHandler(() => 'Nitro is amazing!') | ||
export default defineEventHandler(() => "Nitro is amazing!"); |
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 +1,3 @@ | ||
export default defineEventHandler(event => `Hello ${event.context.params.name}!`) | ||
export default defineEventHandler( | ||
(event) => `Hello ${event.context.params.name}!` | ||
); |
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 +1 @@ | ||
export default defineEventHandler(() => 'Test get handler') | ||
export default defineEventHandler(() => "Test get handler"); |
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 +1 @@ | ||
export default defineEventHandler(() => 'Test post handler') | ||
export default defineEventHandler(() => "Test post handler"); |
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,4 +1,3 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import { defineNitroConfig } from "nitropack"; | ||
|
||
export default defineNitroConfig({ | ||
}) | ||
export default defineNitroConfig({}); |
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,4 +1,3 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import { defineNitroConfig } from "nitropack"; | ||
|
||
export default defineNitroConfig({ | ||
}) | ||
export default defineNitroConfig({}); |
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,4 +1,4 @@ | ||
export default defineCachedEventHandler(async () => { | ||
await new Promise(resolve => setTimeout(resolve, 1000)) | ||
return `Response generated at ${new Date().toISOString()} (took 1 second)` | ||
}) | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
return `Response generated at ${new Date().toISOString()} (took 1 second)`; | ||
}); |
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 @@ | ||
import type { NitroErrorHandler } from 'nitropack' | ||
import type { NitroErrorHandler } from "nitropack"; | ||
|
||
export default <NitroErrorHandler> function (error, event) { | ||
event.res.end('[custom error handler] ' + error.stack) | ||
} | ||
export default <NitroErrorHandler>function (error, event) { | ||
event.res.end("[custom error handler] " + error.stack); | ||
}; |
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,7 +1,7 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import errorHandler from './error' | ||
import { defineNitroConfig } from "nitropack"; | ||
import errorHandler from "./error"; | ||
|
||
export default defineNitroConfig({ | ||
errorHandler: '~/error', | ||
devErrorHandler: errorHandler | ||
}) | ||
errorHandler: "~/error", | ||
devErrorHandler: errorHandler, | ||
}); |
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,3 @@ | ||
export default defineEventHandler(() => { | ||
throw new Error('Example Error!') | ||
}) | ||
throw new Error("Example 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import { defineNitroConfig } from "nitropack"; | ||
|
||
export default defineNitroConfig({ | ||
}) | ||
export default defineNitroConfig({}); |
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 +1 @@ | ||
export default defineEventHandler(() => '<h1>nitro is amazing!</h1>') | ||
export default defineEventHandler(() => "<h1>nitro is amazing!</h1>"); |
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,3 @@ | ||
export default defineEventHandler((event) => { | ||
event.context.auth = { name: 'User ' + Math.round(Math.random() * 100) } | ||
}) | ||
event.context.auth = { name: "User " + Math.round(Math.random() * 100) }; | ||
}); |
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,4 +1,3 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import { defineNitroConfig } from "nitropack"; | ||
|
||
export default defineNitroConfig({ | ||
}) | ||
export default defineNitroConfig({}); |
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,3 @@ | ||
export default defineEventHandler(event => ({ | ||
auth: event.context.auth | ||
})) | ||
export default defineEventHandler((event) => ({ | ||
auth: event.context.auth, | ||
})); |
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,7 +1,5 @@ | ||
import { defineNitroConfig } from 'nitropack' | ||
import { defineNitroConfig } from "nitropack"; | ||
|
||
export default defineNitroConfig({ | ||
plugins: [ | ||
'~/plugins/test' | ||
] | ||
}) | ||
plugins: ["~/plugins/test"], | ||
}); |
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,3 @@ | ||
export default defineNitroPlugin((_nitroApp) => { | ||
console.log('Nitro plugin!') | ||
}) | ||
console.log("Nitro plugin!"); | ||
}); |
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,3 @@ | ||
import { eventHandler } from 'h3' | ||
import { eventHandler } from "h3"; | ||
|
||
export default eventHandler(() => '<h1>Hello Nitro!</h1>') | ||
export default eventHandler(() => "<h1>Hello Nitro!</h1>"); |
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,4 +1,4 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": ["."] | ||
"extends": "../tsconfig.json", | ||
"include": ["."] | ||
} |
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,4 +1,3 @@ | ||
import { defineNitroConfig } from '../src' | ||
import { defineNitroConfig } from "../src"; | ||
|
||
export default defineNitroConfig({ | ||
}) | ||
export default defineNitroConfig({}); |
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,3 @@ | ||
import { eventHandler } from 'h3' | ||
import { eventHandler } from "h3"; | ||
|
||
export default eventHandler(() => '<h1>Hello Nitro!</h1>') | ||
export default eventHandler(() => "<h1>Hello Nitro!</h1>"); |
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.