mirror of
https://github.com/renovatebot/github-action.git
synced 2026-12-02 03:20:28 +00:00
chore: replace eslint and prettier with oxlint and oxfmt (#1089)
Co-authored-by: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
This commit is contained in:
1 parent
1e94228dc0
commit
5b781a415a
17 files changed
+673
-1029
No files matched your search
@@ -19,10 +19,7 @@
|
||||
},
|
||||
{
|
||||
"description": "Don't require approval for renovate",
|
||||
"matchPackageNames": [
|
||||
"ghcr.io/renovatebot/renovate",
|
||||
"renovatebot/github-action"
|
||||
],
|
||||
"matchPackageNames": ["ghcr.io/renovatebot/renovate", "renovatebot/github-action"],
|
||||
"dependencyDashboardApproval": false
|
||||
},
|
||||
{
|
||||
@@ -42,9 +39,7 @@
|
||||
{
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["README.md"],
|
||||
"matchStrings": [
|
||||
"uses: renovatebot/github-action@(?<currentValue>[^\\s]+)"
|
||||
],
|
||||
"matchStrings": ["uses: renovatebot/github-action@(?<currentValue>[^\\s]+)"],
|
||||
"depNameTemplate": "renovatebot/github-action",
|
||||
"datasourceTemplate": "github-releases"
|
||||
},
|
||||
|
||||
+2
-5
@@ -1,7 +1,4 @@
|
||||
{
|
||||
"*.{ts,tsx,js,jsx,json}": [
|
||||
"eslint --cache --fix",
|
||||
"prettier --cache --write"
|
||||
],
|
||||
"!*.{ts,tsx,js,jsx,json}": "prettier --cache --ignore-unknown --write"
|
||||
"*.{js,ts,cjs,mjs}": ["oxlint --fix", "oxfmt"],
|
||||
"!*.{js,ts,cjs,mjs}": "oxfmt --no-error-on-unmatched-pattern"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||
"singleQuote": true,
|
||||
"sortPackageJson": {},
|
||||
"ignorePatterns": ["LICENSE.md", "pnpm-lock.yaml"]
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": ["eslint", "typescript", "import", "vitest", "promise", "oxc"],
|
||||
"jsPlugins": ["@containerbase/oxlint-plugin"],
|
||||
"options": {
|
||||
"typeAware": true,
|
||||
"reportUnusedDisableDirectives": "error"
|
||||
},
|
||||
"categories": {
|
||||
"correctness": "error"
|
||||
},
|
||||
"env": {
|
||||
"builtin": true,
|
||||
"node": true
|
||||
},
|
||||
"ignorePatterns": ["dist/", "coverage/", ".claude/worktrees/", ".pnpm-store"],
|
||||
"rules": {
|
||||
"containerbase/enforce-ts-extension": "error",
|
||||
"containerbase/no-undeclared-dependencies": "error",
|
||||
"containerbase/organize-imports": "error",
|
||||
"containerbase/test-root-describe": "error",
|
||||
|
||||
"import/no-cycle": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/export": "error",
|
||||
|
||||
"curly": ["error", "all"],
|
||||
"no-var": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"no-empty": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
|
||||
"no-unused-expressions": "error",
|
||||
"no-empty-function": "error",
|
||||
"no-array-constructor": "error",
|
||||
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
"ignoreCase": false,
|
||||
"ignoreDeclarationSort": true,
|
||||
"ignoreMemberSort": false,
|
||||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
|
||||
}
|
||||
],
|
||||
|
||||
"typescript/unbound-method": ["error", { "ignoreStatic": true }],
|
||||
"typescript/restrict-plus-operands": "error",
|
||||
"typescript/restrict-template-expressions": "error",
|
||||
"typescript/no-empty-object-type": "error",
|
||||
"typescript/ban-ts-comment": "error",
|
||||
"typescript/no-explicit-any": "error",
|
||||
"typescript/no-namespace": "error",
|
||||
"typescript/no-non-null-assertion": "error",
|
||||
"typescript/no-require-imports": "error",
|
||||
"typescript/no-unsafe-argument": "error",
|
||||
"typescript/no-unsafe-assignment": "error",
|
||||
"typescript/no-unsafe-call": "error",
|
||||
"typescript/no-unsafe-member-access": "error",
|
||||
"typescript/no-unsafe-return": "error",
|
||||
"typescript/no-unsafe-function-type": "error",
|
||||
"typescript/no-wrapper-object-types": "error",
|
||||
"typescript/only-throw-error": "error",
|
||||
"typescript/prefer-promise-reject-errors": "error",
|
||||
"typescript/require-await": "error",
|
||||
"typescript/triple-slash-reference": "error",
|
||||
"typescript/no-unsafe-enum-comparison": "error",
|
||||
"typescript/no-unnecessary-type-assertion": "error",
|
||||
"typescript/no-redundant-type-constituents": "error",
|
||||
"typescript/no-duplicate-type-constituents": "error",
|
||||
"typescript/no-base-to-string": "error",
|
||||
"typescript/no-misused-promises": "error",
|
||||
"typescript/no-floating-promises": "error",
|
||||
"typescript/await-thenable": "error",
|
||||
"typescript/no-for-in-array": "error",
|
||||
"typescript/no-implied-eval": "error",
|
||||
"typescript/no-array-delete": "error",
|
||||
"typescript/no-this-alias": "error",
|
||||
|
||||
"promise/always-return": "error",
|
||||
"promise/catch-or-return": "error",
|
||||
"promise/no-return-wrap": "error",
|
||||
"promise/param-names": "error",
|
||||
"promise/valid-params": "error",
|
||||
|
||||
"vitest/require-mock-type-parameters": "off",
|
||||
"vitest/require-to-throw-message": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["tools/**", "commitlint.config.js"],
|
||||
"rules": {
|
||||
"containerbase/no-undeclared-dependencies": ["error", { "allowDevDependencies": true }],
|
||||
"typescript/no-explicit-any": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
.git/
|
||||
.vscode
|
||||
build/
|
||||
dist/
|
||||
coverage/
|
||||
LICENSE.md
|
||||
modules/
|
||||
node_modules/
|
||||
|
||||
/.pnpm-store
|
||||
/pnpm-lock.yaml
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"plugins": ["prettier-plugin-packagejson"]
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
import globals from 'globals';
|
||||
import js from '@eslint/js';
|
||||
import json from 'eslint-plugin-json';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
ignores: [
|
||||
'**/.git/',
|
||||
'**/.vscode',
|
||||
'**/build/',
|
||||
'**/dist/',
|
||||
'**/coverage/',
|
||||
'**/LICENSE.md',
|
||||
'**/modules/',
|
||||
'**/node_modules/',
|
||||
'!**/.*',
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked.map((config) => ({
|
||||
...config,
|
||||
files: ['**/*.{ts,js,mjs,cjs}'],
|
||||
})),
|
||||
...tseslint.configs.stylisticTypeChecked.map((config) => ({
|
||||
...config,
|
||||
files: ['**/*.{ts,js,mjs,cjs}'],
|
||||
})),
|
||||
{
|
||||
files: ['**/*.{ts,js,mjs,cjs}'],
|
||||
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'sort-imports': 'error',
|
||||
},
|
||||
},
|
||||
json.configs.recommended,
|
||||
{
|
||||
files: ['**/tsconfig.json', '**/tsconfig.*.json'],
|
||||
rules: {
|
||||
'json/*': ['error', { allowComments: true }],
|
||||
},
|
||||
},
|
||||
eslintConfigPrettier,
|
||||
);
|
||||
@@ -10,14 +10,7 @@ module.exports = {
|
||||
packageRules: [
|
||||
{
|
||||
description: 'lockFileMaintenance',
|
||||
matchUpdateTypes: [
|
||||
'pin',
|
||||
'digest',
|
||||
'patch',
|
||||
'minor',
|
||||
'major',
|
||||
'lockFileMaintenance',
|
||||
],
|
||||
matchUpdateTypes: ['pin', 'digest', 'patch', 'minor', 'major', 'lockFileMaintenance'],
|
||||
dependencyDashboardApproval: false,
|
||||
minimumReleaseAge: null,
|
||||
},
|
||||
|
||||
@@ -14,14 +14,7 @@
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "lockFileMaintenance",
|
||||
"matchUpdateTypes": [
|
||||
"pin",
|
||||
"digest",
|
||||
"patch",
|
||||
"minor",
|
||||
"major",
|
||||
"lockFileMaintenance"
|
||||
],
|
||||
"matchUpdateTypes": ["pin", "digest", "patch", "minor", "major", "lockFileMaintenance"],
|
||||
"dependencyDashboardApproval": false,
|
||||
"minimumReleaseAge": "1 day"
|
||||
}
|
||||
|
||||
+15
-22
@@ -7,27 +7,25 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/renovatebot/github-action/issues"
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"author": "Jeroen de Bruijn",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/renovatebot/github-action.git"
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"author": "Jeroen de Bruijn",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "run-s clean compile",
|
||||
"clean": "rimraf dist/",
|
||||
"compile": "node tools/compile.js",
|
||||
"lint": "run-s lint-es prettier",
|
||||
"lint:fix": "run-s lint-es:fix prettier-fix",
|
||||
"lint-es": "eslint .",
|
||||
"lint-es:file": "eslint",
|
||||
"lint-es:file:fix": "eslint --fix",
|
||||
"lint-es:fix": "eslint --fix .",
|
||||
"lint": "run-s lint:*",
|
||||
"lint:oxlint": "oxlint",
|
||||
"lint:oxfmt": "oxfmt --check",
|
||||
"fix": "run-s fix:*",
|
||||
"fix:oxlint": "oxlint --fix",
|
||||
"fix:oxfmt": "oxfmt",
|
||||
"prepare": "husky",
|
||||
"prettier": "prettier --cache --check --ignore-unknown \"{**/*,*}.*\"",
|
||||
"prettier-fix": "prettier --cache --write --ignore-unknown \"{**/*,*}.*\"",
|
||||
"release": "run-s clean build semantic-release",
|
||||
"semantic-release": "semantic-release",
|
||||
"start": "run-s build && node dist"
|
||||
@@ -39,33 +37,28 @@
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "21.2.4",
|
||||
"@commitlint/config-conventional": "21.2.4",
|
||||
"@eslint/js": "9.39.5",
|
||||
"@containerbase/oxlint-plugin": "1.0.5",
|
||||
"@semantic-release/git": "11.0.1",
|
||||
"@semantic-release/github": "12.0.10",
|
||||
"@semantic-release/npm": "13.2.0",
|
||||
"@tsconfig/node24": "24.0.5",
|
||||
"@tsconfig/strictest": "2.0.8",
|
||||
"@types/eslint-config-prettier": "6.11.3",
|
||||
"@types/node": "24.19.2",
|
||||
"conventional-changelog-conventionalcommits": "9.3.1",
|
||||
"esbuild": "0.28.2",
|
||||
"eslint": "9.39.5",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-json": "5.0.0",
|
||||
"globals": "17.13.0",
|
||||
"husky": "9.1.7",
|
||||
"lint-staged": "17.6.0",
|
||||
"npm-run-all2": "9.0.4",
|
||||
"prettier": "3.9.10",
|
||||
"prettier-plugin-packagejson": "3.0.2",
|
||||
"oxfmt": "0.74.0",
|
||||
"oxlint": "1.89.0",
|
||||
"oxlint-tsgolint": "7.0.2005",
|
||||
"rimraf": "6.1.3",
|
||||
"semantic-release": "25.0.9",
|
||||
"typescript": "5.9.3",
|
||||
"typescript-eslint": "8.72.0"
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"packageManager": "pnpm@10.34.7",
|
||||
"engines": {
|
||||
"node": ">=24.11.0",
|
||||
"pnpm": "^10.0.0"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@10.34.7"
|
||||
}
|
||||
Generated
+527
-856
File diff suppressed because it is too large.
Load diff
+1
-3
@@ -12,9 +12,7 @@ export class Docker {
|
||||
let version = input.getVersion();
|
||||
|
||||
if (image?.includes(':')) {
|
||||
info(
|
||||
`Docker image looks like it contains a version, using that as the image itself`,
|
||||
);
|
||||
info(`Docker image looks like it contains a version, using that as the image itself`);
|
||||
this.fullImageReference = image;
|
||||
return;
|
||||
}
|
||||
|
||||
+7
-16
@@ -1,5 +1,5 @@
|
||||
import { getInput, getMultilineInput, warning } from '@actions/core';
|
||||
import path from 'node:path';
|
||||
import { getInput, getMultilineInput, warning } from '@actions/core';
|
||||
|
||||
export interface EnvironmentVariable {
|
||||
key: string;
|
||||
@@ -28,15 +28,11 @@ export class Input {
|
||||
|
||||
constructor() {
|
||||
const envRegexInput = getInput('env-regex');
|
||||
const envRegex = envRegexInput
|
||||
? new RegExp(envRegexInput)
|
||||
: this.options.envRegex;
|
||||
const envRegex = envRegexInput ? new RegExp(envRegexInput) : this.options.envRegex;
|
||||
const additionalEnvVarNames = getMultilineInput('additional-env-list');
|
||||
this._environmentVariables = new Map(
|
||||
Object.entries(process.env)
|
||||
.filter(
|
||||
([key]) => envRegex.test(key) || additionalEnvVarNames.includes(key),
|
||||
)
|
||||
.filter(([key]) => envRegex.test(key) || additionalEnvVarNames.includes(key))
|
||||
.filter((pair): pair is [string, string] => pair[1] !== undefined),
|
||||
);
|
||||
for (const name of additionalEnvVarNames) {
|
||||
@@ -120,20 +116,15 @@ export class Input {
|
||||
}));
|
||||
}
|
||||
|
||||
private get(
|
||||
input: string,
|
||||
env: string,
|
||||
optional: boolean,
|
||||
): EnvironmentVariable {
|
||||
private get(input: string, env: string, optional: boolean): EnvironmentVariable {
|
||||
const fromInput = getInput(input);
|
||||
const fromEnv = this._environmentVariables.get(env);
|
||||
|
||||
if (fromInput === '' && fromEnv === undefined && !optional) {
|
||||
throw new Error(
|
||||
[
|
||||
`'${input}' MUST be passed using its input or the '${env}'`,
|
||||
'environment variable',
|
||||
].join(' '),
|
||||
[`'${input}' MUST be passed using its input or the '${env}'`, 'environment variable'].join(
|
||||
' ',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+6
-15
@@ -1,8 +1,8 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { exec, getExecOutput } from '@actions/exec';
|
||||
import { Docker } from './docker';
|
||||
import { Input } from './input';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
export class Renovate {
|
||||
static dockerGroupRegex = /^docker:x:(?<groupId>[1-9][0-9]*):/m;
|
||||
@@ -31,9 +31,7 @@ export class Renovate {
|
||||
const dockerArguments = this.input
|
||||
.toEnvironmentVariables()
|
||||
.map((e) => `--env ${e.key}`)
|
||||
.concat([
|
||||
`--env ${this.input.token.key}=${this.input.token.value} --env FORCE_COLOR=3`,
|
||||
]);
|
||||
.concat([`--env ${this.input.token.key}=${this.input.token.value} --env FORCE_COLOR=3`]);
|
||||
|
||||
const configurationFile = this.input.configurationFile();
|
||||
if (configurationFile !== null) {
|
||||
@@ -49,9 +47,7 @@ export class Renovate {
|
||||
const sockPath = this.input.dockerSocketHostPath();
|
||||
const stat = await fs.stat(sockPath);
|
||||
if (!stat.isSocket()) {
|
||||
throw new Error(
|
||||
`docker socket host path '${sockPath}' MUST exist and be a socket`,
|
||||
);
|
||||
throw new Error(`docker socket host path '${sockPath}' MUST exist and be a socket`);
|
||||
}
|
||||
|
||||
dockerArguments.push(
|
||||
@@ -129,13 +125,8 @@ export class Renovate {
|
||||
}
|
||||
|
||||
const configurationFile = this.input.configurationFile();
|
||||
if (
|
||||
configurationFile !== null &&
|
||||
!(await fs.stat(configurationFile.value)).isFile()
|
||||
) {
|
||||
throw new Error(
|
||||
`configuration file '${configurationFile.value}' MUST be an existing file`,
|
||||
);
|
||||
if (configurationFile !== null && !(await fs.stat(configurationFile.value)).isFile()) {
|
||||
throw new Error(`configuration file '${configurationFile.value}' MUST be an existing file`);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { build } from 'esbuild';
|
||||
import { env } from 'node:process';
|
||||
import { build } from 'esbuild';
|
||||
|
||||
await build({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"extends": [
|
||||
"@tsconfig/strictest/tsconfig.json",
|
||||
"@tsconfig/node24/tsconfig.json"
|
||||
],
|
||||
"extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/node24/tsconfig.json"],
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"extends": [
|
||||
"@tsconfig/strictest/tsconfig.json",
|
||||
"@tsconfig/node24/tsconfig.json"
|
||||
],
|
||||
"extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/node24/tsconfig.json"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
||||
Reference in new issue
Block a user