81 lines
1.8 KiB
JavaScript
81 lines
1.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import sveltePlugin from 'eslint-plugin-svelte';
|
|
import svelteParser from 'svelte-eslint-parser';
|
|
import securityPlugin from 'eslint-plugin-security';
|
|
|
|
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',
|
|
HTMLElement: 'readonly',
|
|
HTMLImageElement: 'readonly',
|
|
HTMLInputElement: 'readonly',
|
|
HTMLButtonElement: 'readonly',
|
|
navigator: 'readonly',
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
localStorage: 'readonly',
|
|
Blob: 'readonly',
|
|
Event: 'readonly',
|
|
MouseEvent: 'readonly',
|
|
PointerEvent: 'readonly',
|
|
KeyboardEvent: 'readonly',
|
|
WheelEvent: 'readonly',
|
|
HTMLSelectElement: 'readonly',
|
|
HTMLDivElement: 'readonly',
|
|
URLSearchParams: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
svelte: sveltePlugin,
|
|
security: securityPlugin,
|
|
},
|
|
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',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: ['node_modules/**', '.svelte-kit/**', 'build/**', 'dist/**', 'archive/**'],
|
|
},
|
|
];
|