🔧 Updated eslint configuration to comply with new version requirements
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
|
||||
//
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
|
||||
plugins: ['svelte3', '@typescript-eslint'],
|
||||
ignorePatterns: ['*.cjs'],
|
||||
overrides: [
|
||||
{ files: ['*.svelte'], processor: 'svelte3/svelte3' },
|
||||
{
|
||||
files: ['*.*'],
|
||||
rules: {
|
||||
'a11y-click-events-have-key-events': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }]
|
||||
},
|
||||
settings: {
|
||||
'svelte3/typescript': () => require('typescript')
|
||||
},
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
es2017: true,
|
||||
node: true
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,84 @@
|
||||
const { defineConfig, globalIgnores } = require('eslint/config');
|
||||
|
||||
const tsParser = require('@typescript-eslint/parser');
|
||||
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
|
||||
const globals = require('globals');
|
||||
const js = require('@eslint/js');
|
||||
const svelte = require('eslint-plugin-svelte');
|
||||
|
||||
module.exports = defineConfig([
|
||||
js.configs.recommended,
|
||||
svelte.configs.recommended,
|
||||
globalIgnores(['**/*.cjs', 'src/app.html']),
|
||||
{
|
||||
languageOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020,
|
||||
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.{ts,js}'],
|
||||
languageOptions: {
|
||||
parser: tsParser
|
||||
},
|
||||
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptEslint
|
||||
},
|
||||
|
||||
rules: {
|
||||
'no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_.*'
|
||||
}
|
||||
],
|
||||
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_.*'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.svelte'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
parser: tsParser,
|
||||
extraFileExtensions: ['.svelte']
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.svelte', '**/*.ts', '**/*.js'],
|
||||
|
||||
rules: {
|
||||
'a11y-click-events-have-key-events': 'off',
|
||||
'no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_.*'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_.*'
|
||||
}
|
||||
],
|
||||
'svelte/no-at-html-tags': 'warn',
|
||||
'svelte/require-each-key': 'warn'
|
||||
},
|
||||
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptEslint
|
||||
}
|
||||
}
|
||||
]);
|
||||
@@ -8,9 +8,9 @@
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . '!src/lib/i18n/locales/*.json' '!pnpm-lock.yaml' '!src/app.html' && eslint --ignore-path .gitignore .",
|
||||
"lint-without-format-checking": "eslint --ignore-path .gitignore .",
|
||||
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. . '!src/lib/i18n/locales/*.json'",
|
||||
"lint": "prettier --check --plugin-search-dir=. . '!src/lib/i18n/locales/*.json' '!pnpm-lock.yaml' '!src/app.html' && eslint .",
|
||||
"lint-without-format-checking": "eslint .",
|
||||
"format": "prettier --write --plugin-search-dir=. . '!src/lib/i18n/locales/*.json'",
|
||||
"run:prod": "node index.js",
|
||||
"translations-scan": "i18next-scanner --config i18next-scanner.config.engine.cjs src/**/*.svelte"
|
||||
},
|
||||
@@ -58,6 +58,7 @@
|
||||
"dompurify": "^3.3.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-svelte": "^3.17.0",
|
||||
"felte": "^1.3.0",
|
||||
"fuse.js": "^7.1.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
@@ -82,6 +83,7 @@
|
||||
"socket.io-client": "^4.8.1",
|
||||
"svelte": "^5.42.2",
|
||||
"svelte-check": "^4.3.3",
|
||||
"svelte-eslint-parser": "^1.6.0",
|
||||
"svelte-preprocess": "^6.0.3",
|
||||
"svelte-range-slider-pips": "^4.1.0",
|
||||
"svelte-tippy": "^1.3.2",
|
||||
|
||||
Reference in New Issue
Block a user