| 1 | module.exports = { |
| 2 | root: true, |
| 3 | plugins: [ |
| 4 | 'jest', |
| 5 | 'playwright', |
| 6 | ], |
| 7 | extends: [ |
| 8 | 'eslint:recommended', |
| 9 | 'plugin:jest/recommended', |
| 10 | 'plugin:playwright/recommended', |
| 11 | ], |
| 12 | env: { |
| 13 | es6: true, |
| 14 | node: true, |
| 15 | 'jest/globals': true, |
| 16 | }, |
| 17 | parserOptions: { |
| 18 | ecmaVersion: 'latest', |
| 19 | sourceType: 'module', |
| 20 | }, |
| 21 | overrides: [ |
| 22 | ], |
| 23 | ignorePatterns: [ |
| 24 | '*.min.js', |
| 25 | 'node_modules/**/*', |
| 26 | ], |
| 27 | globals: { |
| 28 | SillyTavern: 'readonly', |
| 29 | }, |
| 30 | rules: { |
| 31 | 'no-unused-vars': ['error', { args: 'none' }], |
| 32 | 'no-control-regex': 'off', |
| 33 | 'no-constant-condition': ['error', { checkLoops: false }], |
| 34 | 'require-yield': 'off', |
| 35 | 'quotes': ['error', 'single'], |
| 36 | 'semi': ['error', 'always'], |
| 37 | 'indent': ['error', 4, { SwitchCase: 1, FunctionDeclaration: { parameters: 'first' } }], |
| 38 | 'comma-dangle': ['error', 'always-multiline'], |
| 39 | 'eol-last': ['error', 'always'], |
| 40 | 'no-trailing-spaces': 'error', |
| 41 | 'object-curly-spacing': ['error', 'always'], |
| 42 | 'space-infix-ops': 'error', |
| 43 | 'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }], |
| 44 | 'no-cond-assign': 'error', |
| 45 | |
| 46 | // These rules should eventually be enabled. |
| 47 | 'no-async-promise-executor': 'off', |
| 48 | 'no-inner-declarations': 'off', |
| 49 | }, |
| 50 | settings: { |
| 51 | jest: { |
| 52 | version: 29, |
| 53 | }, |
| 54 | }, |
| 55 | }; |