|
| 1 | +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +import { includeIgnoreFile } from '@eslint/compat'; |
| 5 | +import eslint from '@eslint/js'; |
| 6 | +import headerPlugin from 'eslint-plugin-header'; |
| 7 | +import eslintPrettier from 'eslint-plugin-prettier/recommended'; |
| 8 | +import reactPlugin from 'eslint-plugin-react'; |
| 9 | +import unicornPlugin from 'eslint-plugin-unicorn'; |
| 10 | +import globals from 'globals'; |
| 11 | +import path from 'node:path'; |
| 12 | +import tsEslint from 'typescript-eslint'; |
| 13 | + |
| 14 | +// https://github.com/Stuk/eslint-plugin-header/issues/57 |
| 15 | +headerPlugin.rules.header.meta.schema = false; |
| 16 | + |
| 17 | +export default tsEslint.config( |
| 18 | + includeIgnoreFile(path.resolve('.gitignore')), |
| 19 | + { |
| 20 | + settings: { |
| 21 | + react: { version: 'detect' }, |
| 22 | + }, |
| 23 | + }, |
| 24 | + eslint.configs.recommended, |
| 25 | + tsEslint.configs.recommended, |
| 26 | + reactPlugin.configs.flat.recommended, |
| 27 | + eslintPrettier, |
| 28 | + { |
| 29 | + files: ['**/*.{js,mjs,ts,tsx}'], |
| 30 | + languageOptions: { |
| 31 | + globals: { |
| 32 | + ...globals.browser, |
| 33 | + }, |
| 34 | + }, |
| 35 | + plugins: { |
| 36 | + unicorn: unicornPlugin, |
| 37 | + header: headerPlugin, |
| 38 | + }, |
| 39 | + rules: { |
| 40 | + '@typescript-eslint/no-unused-vars': 'off', |
| 41 | + '@typescript-eslint/no-explicit-any': 'off', |
| 42 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 43 | + '@typescript-eslint/no-empty-function': 'off', |
| 44 | + '@typescript-eslint/no-namespace': 'off', |
| 45 | + 'header/header': [ |
| 46 | + 'error', |
| 47 | + 'line', |
| 48 | + [' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', ' SPDX-License-Identifier: Apache-2.0'], |
| 49 | + ], |
| 50 | + 'no-warning-comments': 'warn', |
| 51 | + 'react/display-name': 'off', |
| 52 | + }, |
| 53 | + }, |
| 54 | +); |
0 commit comments