generated from SillyTavern/Extension-WebpackTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
35 lines (34 loc) · 1.47 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default defineConfig([
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ files: ['**/*.{js,mjs,cjs,ts}'], languageOptions: { globals: globals.browser } },
{ files: ['**/*.{js,mjs,cjs,ts}'], plugins: { js }, extends: ['js/recommended'] },
tseslint.configs.recommended,
{
ignores: ['**/dist/**', '**/node_modules/**'],
},
{
rules: {
'prefer-const': 'error',
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
'no-control-regex': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'require-yield': 'off',
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'indent': ['error', 4, { SwitchCase: 1, FunctionDeclaration: { parameters: 'first' } }],
'comma-dangle': ['error', 'always-multiline'],
'eol-last': ['error', 'always'],
'no-trailing-spaces': 'error',
'object-curly-spacing': ['error', 'always'],
'space-infix-ops': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-cond-assign': 'error',
'no-unneeded-ternary': 'error',
'no-irregular-whitespace': ['error', { skipStrings: true, skipTemplates: true }],
},
},
]);