mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-11 04:32:47 +00:00
Update ESLint and TypeScript dependencies to latest major versions
Co-authored-by: TylerDixon <4308048+TylerDixon@users.noreply.github.com>
This commit is contained in:
78
eslint.config.mjs
Normal file
78
eslint.config.mjs
Normal file
@@ -0,0 +1,78 @@
|
||||
import eslint from '@eslint/js'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import github from 'eslint-plugin-github'
|
||||
import jest from 'eslint-plugin-jest'
|
||||
import globals from 'globals'
|
||||
|
||||
export default [
|
||||
// Ignore patterns
|
||||
{
|
||||
ignores: ['dist/**', 'lib/**', 'node_modules/**', '__tests__/fixtures/**', 'eslint.config.mjs'],
|
||||
},
|
||||
|
||||
// Base ESLint recommended rules
|
||||
eslint.configs.recommended,
|
||||
|
||||
// TypeScript ESLint recommended rules
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
// GitHub plugin recommended rules
|
||||
github.getFlatConfigs().recommended,
|
||||
|
||||
// Configuration for CommonJS JavaScript files
|
||||
{
|
||||
files: ['**/*.js'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2019,
|
||||
sourceType: 'script',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es6,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Disable specific rules for CommonJS files
|
||||
'github/filenames-match-regex': 'off',
|
||||
'import/no-commonjs': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'i18n-text/no-en': 'off',
|
||||
'import/no-namespace': 'off',
|
||||
'no-implicit-globals': 'off',
|
||||
'github/no-implicit-buggy-globals': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
// Configuration for TypeScript files
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2019,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es6,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Disable specific rules as in the original config
|
||||
'github/filenames-match-regex': 'off',
|
||||
'github/no-then': 'off',
|
||||
'i18n-text/no-en': 'off',
|
||||
'import/no-namespace': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
// Jest-specific configuration
|
||||
{
|
||||
files: ['**/*.test.ts', '**/*.test.js', '__tests__/**/*.ts'],
|
||||
...jest.configs['flat/recommended'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user