chore: use globals in eslint config
This commit is contained in:
parent
823bb74a26
commit
18edfdc4d3
4 changed files with 1292 additions and 3669 deletions
|
@ -1,16 +1,28 @@
|
|||
import globals from 'globals'
|
||||
import eslintPluginAstro from 'eslint-plugin-astro'
|
||||
import jsPlugin from '@eslint/js'
|
||||
import astroSwGlobals from '@ayco/astro-sw/globals'
|
||||
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
...astroSwGlobals,
|
||||
},
|
||||
},
|
||||
},
|
||||
// add more generic rule sets here, such as:
|
||||
// js.configs.recommended,
|
||||
jsPlugin.configs.recommended,
|
||||
...eslintPluginAstro.configs['recommended'],
|
||||
...eslintPluginAstro.configs['jsx-a11y-recommended'],
|
||||
{
|
||||
ignores: [
|
||||
'dist/*',
|
||||
'.output/*',
|
||||
'.nitro/*',
|
||||
'node-modules*',
|
||||
'.astro/*',
|
||||
'node_modules*',
|
||||
'site/*',
|
||||
'templates/*',
|
||||
],
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
"@astro-reactive/form": "^0.10.0",
|
||||
"@astro-reactive/validator": "^0.5.0",
|
||||
"@astrojs/sitemap": "^3.2.1",
|
||||
"@ayco/astro-sw": "^0.8.8",
|
||||
"@ayco/astro-sw": "^0.8.12",
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@typescript-eslint/parser": "^8.18.2",
|
||||
"astro": "^5.0.5",
|
||||
"astro-github-stats": "^0.7.1",
|
||||
|
@ -28,6 +29,7 @@
|
|||
"eslint": "^9.17.0",
|
||||
"eslint-plugin-astro": "^1.3.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"globals": "^15.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-astro": "^0.14.1"
|
||||
|
|
4937
pnpm-lock.yaml
4937
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -44,6 +44,7 @@ const networkFirst = async ({ request, fallbackUrl }) => {
|
|||
putInCache(request, responseFromNetwork.clone())
|
||||
console.info('using network response', responseFromNetwork.url)
|
||||
return responseFromNetwork
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (error) {
|
||||
// Try get the resource from the cache
|
||||
const responseFromCache = await cache.match(request)
|
||||
|
@ -69,6 +70,7 @@ const networkFirst = async ({ request, fallbackUrl }) => {
|
|||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
self.addEventListener('activate', (event) => {
|
||||
console.info('activating service worker...')
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue