Watch
1
0
Fork
You've already forked push-to-registry
0
mirror of https://github.com/redhat-actions/push-to-registry.git synced 2026-11-16 19:39:34 +00:00
push-to-registry/eslint.config.mjs
Christopher Brown c584183e22
Fix incomplete URL substring sanitization (CodeQL alert) (#124)
Replace `image.includes("amazonaws.com")` with a check for dots or
colons in the first path segment, which reliably detects any
fully-qualified registry hostname — not just AWS ECR.

Adds unit tests for getFullDockerImageName using Node's built-in test
runner.

Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-07-28 16:28:54 +01:00

53 lines
2 KiB
JavaScript

import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
"node_modules/",
"dist/",
"out/",
"lib/",
"eslint.config.mjs",
"src/**/*.test.ts",
],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
ecmaVersion: 2024,
sourceType: "module",
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Style rules carried over from the project's existing config
"brace-style": ["error", "stroustrup", { allowSingleLine: true }],
"curly": "error",
"eqeqeq": ["error", "smart"],
"no-console": "error",
"quotes": ["error", "double", { allowTemplateLiterals: true }],
"indent": ["error", 4],
// TypeScript rules
"@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: true }],
"@typescript-eslint/prefer-for-of": "error",
// Disable rules that conflict with the existing code style
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
},
},
);