|
| 1 | +/** |
| 2 | + * Copyright 2025 actions-toolkit authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +import {defineConfig} from 'eslint/config'; |
| 18 | +import js from '@eslint/js'; |
| 19 | +import tseslint from '@typescript-eslint/eslint-plugin'; |
| 20 | +import vitest from '@vitest/eslint-plugin'; |
| 21 | +import globals from 'globals'; |
| 22 | +import eslintConfigPrettier from 'eslint-config-prettier/flat'; |
| 23 | +import eslintPluginPrettier from 'eslint-plugin-prettier'; |
| 24 | + |
| 25 | +export default defineConfig([ |
| 26 | + { |
| 27 | + ignores: ['.yarn/**/*', 'coverage/**/*', 'lib/**/*'] |
| 28 | + }, |
| 29 | + js.configs.recommended, |
| 30 | + ...tseslint.configs['flat/recommended'], |
| 31 | + eslintConfigPrettier, |
| 32 | + { |
| 33 | + languageOptions: { |
| 34 | + globals: { |
| 35 | + ...globals.node |
| 36 | + } |
| 37 | + } |
| 38 | + }, |
| 39 | + { |
| 40 | + files: ['__tests__/**'], |
| 41 | + ...vitest.configs.recommended, |
| 42 | + languageOptions: { |
| 43 | + globals: { |
| 44 | + ...globals.node, |
| 45 | + ...vitest.environments.env.globals |
| 46 | + } |
| 47 | + }, |
| 48 | + rules: { |
| 49 | + ...vitest.configs.recommended.rules, |
| 50 | + 'vitest/no-conditional-expect': 'error', |
| 51 | + 'vitest/no-disabled-tests': 0 |
| 52 | + } |
| 53 | + }, |
| 54 | + { |
| 55 | + plugins: { |
| 56 | + prettier: eslintPluginPrettier |
| 57 | + }, |
| 58 | + rules: { |
| 59 | + 'prettier/prettier': 'error', |
| 60 | + '@typescript-eslint/no-require-imports': [ |
| 61 | + 'error', |
| 62 | + { |
| 63 | + allowAsImport: true |
| 64 | + } |
| 65 | + ] |
| 66 | + } |
| 67 | + } |
| 68 | +]); |
0 commit comments