2023-05-18 17:43:09 +02:00
|
|
|
/** @type {import('eslint').Linter.Config} */
|
2022-05-21 09:23:55 +02:00
|
|
|
module.exports = {
|
2023-07-01 06:50:47 +02:00
|
|
|
root: true,
|
2024-02-02 05:18:00 +02:00
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:svelte/recommended',
|
|
|
|
'plugin:unicorn/recommended',
|
|
|
|
],
|
2023-07-01 06:50:47 +02:00
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
plugins: ['@typescript-eslint'],
|
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
2024-02-02 05:18:00 +02:00
|
|
|
ecmaVersion: 2022,
|
2023-07-01 06:50:47 +02:00
|
|
|
extraFileExtensions: ['.svelte'],
|
2024-03-01 02:28:54 +02:00
|
|
|
tsconfigRootDir: __dirname,
|
2024-02-27 18:37:37 +02:00
|
|
|
project: ['./tsconfig.json'],
|
2023-07-01 06:50:47 +02:00
|
|
|
},
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es2017: true,
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['*.svelte'],
|
|
|
|
parser: 'svelte-eslint-parser',
|
|
|
|
parserOptions: {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
globals: {
|
|
|
|
NodeJS: true,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
// Allow underscore (_) variables
|
|
|
|
argsIgnorePattern: '^_$',
|
|
|
|
varsIgnorePattern: '^_$',
|
|
|
|
},
|
|
|
|
],
|
2023-11-28 22:16:27 +02:00
|
|
|
curly: 2,
|
2024-02-27 18:37:37 +02:00
|
|
|
'unicorn/no-useless-undefined': 'off',
|
|
|
|
'unicorn/prefer-spread': 'off',
|
|
|
|
'unicorn/no-null': 'off',
|
|
|
|
'unicorn/prevent-abbreviations': 'off',
|
|
|
|
'unicorn/no-nested-ternary': 'off',
|
|
|
|
'unicorn/consistent-function-scoping': 'off',
|
|
|
|
'unicorn/prefer-top-level-await': 'off',
|
2024-04-08 18:45:46 +02:00
|
|
|
'unicorn/import-style': 'off',
|
2024-02-27 18:37:37 +02:00
|
|
|
// TODO: set recommended-type-checked and remove these rules
|
|
|
|
'@typescript-eslint/await-thenable': 'error',
|
|
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
|
|
'@typescript-eslint/no-misused-promises': 'error',
|
|
|
|
'@typescript-eslint/require-await': 'error',
|
2023-07-01 06:50:47 +02:00
|
|
|
},
|
2022-05-21 09:23:55 +02:00
|
|
|
};
|