128 lines
2.8 KiB
JavaScript
128 lines
2.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import securityPlugin from 'eslint-plugin-security';
|
|
import sveltePlugin from 'eslint-plugin-svelte';
|
|
import svelteParser from 'svelte-eslint-parser';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,svelte}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 2020,
|
|
},
|
|
globals: {
|
|
fetch: 'readonly',
|
|
caches: 'readonly',
|
|
URL: 'readonly',
|
|
console: 'readonly',
|
|
Element: 'readonly',
|
|
EventListener: 'readonly',
|
|
HTMLElement: 'readonly',
|
|
HTMLImageElement: 'readonly',
|
|
HTMLInputElement: 'readonly',
|
|
HTMLTextAreaElement: 'readonly',
|
|
HTMLSelectElement: 'readonly',
|
|
HTMLDivElement: 'readonly',
|
|
SVGSVGElement: 'readonly',
|
|
navigator: 'readonly',
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
Blob: 'readonly',
|
|
Event: 'readonly',
|
|
MouseEvent: 'readonly',
|
|
TouchEvent: 'readonly',
|
|
Touch: 'readonly',
|
|
WheelEvent: 'readonly',
|
|
KeyboardEvent: 'readonly',
|
|
URLSearchParams: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
localStorage: 'readonly',
|
|
sessionStorage: 'readonly',
|
|
Response: 'readonly',
|
|
Request: 'readonly',
|
|
Headers: 'readonly',
|
|
FormData: 'readonly',
|
|
ServiceWorkerRegistration: 'readonly',
|
|
location: 'readonly',
|
|
history: 'readonly',
|
|
addEventListener: 'readonly',
|
|
removeEventListener: 'readonly',
|
|
requestAnimationFrame: 'readonly',
|
|
queueMicrotask: 'readonly',
|
|
atob: 'readonly',
|
|
btoa: 'readonly',
|
|
alert: 'readonly',
|
|
prompt: 'readonly',
|
|
XMLSerializer: 'readonly',
|
|
Image: 'readonly',
|
|
FileReader: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
security: securityPlugin,
|
|
svelte: sveltePlugin,
|
|
},
|
|
rules: {
|
|
...tsPlugin.configs.recommended.rules,
|
|
...securityPlugin.configs.recommended.rules,
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.svelte'],
|
|
languageOptions: {
|
|
parser: svelteParser,
|
|
parserOptions: {
|
|
parser: tsParser,
|
|
},
|
|
},
|
|
plugins: {
|
|
svelte: sveltePlugin,
|
|
},
|
|
rules: {
|
|
...sveltePlugin.configs.recommended.rules,
|
|
},
|
|
},
|
|
{
|
|
files: ['bin/**/*.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
process: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ['static/sw.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
self: 'readonly',
|
|
caches: 'readonly',
|
|
fetch: 'readonly',
|
|
URL: 'readonly',
|
|
console: 'readonly',
|
|
Response: 'readonly',
|
|
Request: 'readonly',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'.svelte-kit/**',
|
|
'build/**',
|
|
'dist/**',
|
|
'archive/**',
|
|
'desktop/frontend_dist/**',
|
|
'wailsjs/**',
|
|
],
|
|
},
|
|
];
|