Files
github-pages-deploy-action/eslint.config.mjs
Copilot 70f9f52642 chore: merge all open Dependabot dependency updates (#1967)
* chore: merge all Dependabot dependency updates with fixes

- Update @actions/core/exec/github/io to v3/v9 (ESM-only)
- Update @eslint/js to v10, @typescript-eslint/* to 8.58, eslint-plugin-jest/prettier
- Update jest 29→30, typescript 5.8→6.0, @types/jest/node, prettier, rimraf, ts-jest
- Update lodash 4.17→4.18 (yarn.lock only)
- Add CJS test stubs for ESM-only @actions/* packages
- Update tsconfig.json: target es2022, add types for node+jest
- Update jest.config.js: moduleNameMapper for stubs, remove jest-circus runner
- Fix new lint rules: preserve-caught-error and no-useless-assignment

Agent-Logs-Url: https://github.com/JamesIves/github-pages-deploy-action/sessions/2a6d68c0-eab5-4c98-a927-2525b124ca87

Co-authored-by: JamesIves <10888441+JamesIves@users.noreply.github.com>

* refactor: convert project to proper ESM

- package.json: add "type": "module" for ESM runtime + nodenext compilation
- tsconfig.json: module/moduleResolution → nodenext (ESM output with .js extensions)
- src/*.ts: add .js extensions to all relative imports
- __tests__/*.test.ts: add .js to relative imports, remove jest.mock() factories for @actions/*
- jest.config.js → jest.config.cjs: CJS jest config, moduleNameMapper strips .js for ts-jest
- __mocks__/@actions/*.js + package.json: proper Jest manual mocks (CJS, with functional
  implementations for integration tests) replacing __tests__/stubs/ workaround
- eslint.config.mjs: ignore __mocks__/** instead of __tests__/stubs/**

Agent-Logs-Url: https://github.com/JamesIves/github-pages-deploy-action/sessions/c73b8f61-87f7-4eab-8e99-d363a69f6e66

Co-authored-by: JamesIves <10888441+JamesIves@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JamesIves <10888441+JamesIves@users.noreply.github.com>
2026-04-05 14:33:48 -04:00

76 lines
2.0 KiB
JavaScript

import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslintConfigPrettier from 'eslint-config-prettier'
import jest from 'eslint-plugin-jest'
export default tseslint.config(
{
ignores: ['lib/**', '__mocks__/**']
},
eslintConfigPrettier,
jest.configs['flat/recommended'],
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
process: true,
module: true
}
},
rules: {
'jest/no-conditional-expect': 'off',
'@typescript-eslint/no-restricted-types': [
'error',
{
types: {
Number: {
message: 'Use number instead',
fixWith: 'number'
},
String: {
message: 'Use string instead',
fixWith: 'string'
},
Boolean: {
message: 'Use boolean instead',
fixWith: 'boolean'
},
Object: {
message: 'Use object instead',
fixWith: 'object'
},
'{}': {
message: 'Use object instead',
fixWith: 'object'
},
Symbol: {
message: 'Use symbol instead',
fixWith: 'symbol'
}
}
}
],
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'object-shorthand': ['error', 'always'],
'prefer-destructuring': [
'error',
{
array: false,
object: true
},
{
enforceForRenamedProperties: false
}
],
'no-console': ['error', {allow: ['warn', 'error']}],
'no-alert': 'error',
'no-debugger': 'error'
}
}
)