|
| 1 | +const js = require('@eslint/js'); |
| 2 | +const typescript = require('@typescript-eslint/eslint-plugin'); |
| 3 | +const typescriptParser = require('@typescript-eslint/parser'); |
| 4 | + |
| 5 | +module.exports = [ |
| 6 | + js.configs.recommended, |
| 7 | + { |
| 8 | + files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], |
| 9 | + languageOptions: { |
| 10 | + parser: typescriptParser, |
| 11 | + parserOptions: { |
| 12 | + ecmaVersion: 'latest', |
| 13 | + sourceType: 'module', |
| 14 | + }, |
| 15 | + globals: { |
| 16 | + // Browser globals |
| 17 | + document: 'readonly', |
| 18 | + window: 'readonly', |
| 19 | + console: 'readonly', |
| 20 | + setTimeout: 'readonly', |
| 21 | + CustomEvent: 'readonly', |
| 22 | + HTMLElement: 'readonly', |
| 23 | + MouseEvent: 'readonly', |
| 24 | + // Jest globals |
| 25 | + describe: 'readonly', |
| 26 | + it: 'readonly', |
| 27 | + expect: 'readonly', |
| 28 | + // Stencil globals |
| 29 | + h: 'readonly', |
| 30 | + HTMLIonModalElement: 'readonly', |
| 31 | + HTMLIonInfiniteScrollElement: 'readonly', |
| 32 | + HTMLIonProgressBarElement: 'readonly', |
| 33 | + HTMLIonRefresherElement: 'readonly', |
| 34 | + HTMLIonReorderGroupElement: 'readonly' |
| 35 | + } |
| 36 | + }, |
| 37 | + plugins: { |
| 38 | + '@typescript-eslint': typescript, |
| 39 | + }, |
| 40 | + rules: { |
| 41 | + ...typescript.configs.recommended.rules, |
| 42 | + // Allow both 'h' and '_template_' to be unused |
| 43 | + '@typescript-eslint/no-unused-vars': ['error', { |
| 44 | + 'argsIgnorePattern': '^_', |
| 45 | + 'varsIgnorePattern': '^(h|_template_)$' |
| 46 | + }], |
| 47 | + // Allow any type in certain cases |
| 48 | + '@typescript-eslint/no-explicit-any': 'off' |
| 49 | + }, |
| 50 | + }, |
| 51 | +]; |
0 commit comments