|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT license. |
| 3 | + |
| 4 | +// cSpell:ignore ganchev |
| 5 | + |
| 6 | +import { defineConfig } from 'eslint/config'; |
| 7 | + |
| 8 | +import tseslint from 'typescript-eslint'; |
| 9 | +import eslintPrettierRecommended from 'eslint-plugin-prettier/recommended'; |
| 10 | +import header from '@tony.ganchev/eslint-plugin-header'; |
| 11 | + |
| 12 | +export default defineConfig( |
| 13 | + { |
| 14 | + ignores: ['**/dist'], |
| 15 | + }, |
| 16 | + tseslint.configs.recommended, |
| 17 | + eslintPrettierRecommended, |
| 18 | + { |
| 19 | + files: ['**/**.{ts,js}'], |
| 20 | + |
| 21 | + languageOptions: { |
| 22 | + parser: tseslint.parser, |
| 23 | + ecmaVersion: 6, |
| 24 | + sourceType: 'module', |
| 25 | + }, |
| 26 | + |
| 27 | + plugins: { |
| 28 | + header, |
| 29 | + '@typescript-eslint': tseslint.plugin, |
| 30 | + }, |
| 31 | + |
| 32 | + rules: { |
| 33 | + 'no-unused-vars': 'off', |
| 34 | + '@typescript-eslint/no-unused-vars': [ |
| 35 | + 'error', |
| 36 | + { |
| 37 | + args: 'all', |
| 38 | + argsIgnorePattern: '^_', |
| 39 | + caughtErrors: 'all', |
| 40 | + caughtErrorsIgnorePattern: '^_', |
| 41 | + destructuredArrayIgnorePattern: '^_', |
| 42 | + varsIgnorePattern: '^_', |
| 43 | + }, |
| 44 | + ], |
| 45 | + 'header/header': [ |
| 46 | + 'error', |
| 47 | + 'line', |
| 48 | + [ |
| 49 | + ' Copyright (c) Microsoft Corporation.', |
| 50 | + ' Licensed under the MIT license.', |
| 51 | + ], |
| 52 | + 2, |
| 53 | + ], |
| 54 | + 'prettier/prettier': [ |
| 55 | + 'error', |
| 56 | + { |
| 57 | + singleQuote: true, |
| 58 | + jsxSingleQuote: true, |
| 59 | + endOfLine: 'auto', |
| 60 | + printWidth: 80, |
| 61 | + }, |
| 62 | + ], |
| 63 | + }, |
| 64 | + }, |
| 65 | +); |
0 commit comments