Skip to content

Commit b8d154c

Browse files
authored
Merge pull request #937 from git-for-windows/dependabot/npm_and_yarn/eslint-9.26.0
Bump eslint from 8.57.1 to 9.26.0
2 parents 2193652 + a65e475 commit b8d154c

File tree

9 files changed

+1815
-599
lines changed

9 files changed

+1815
-599
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 57 deletions
This file was deleted.

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import jest from "eslint-plugin-jest";
3+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
4+
import stylistic from "@stylistic/eslint-plugin";
5+
import antiTrojanSource from "eslint-plugin-anti-trojan-source";
6+
import globals from "globals";
7+
import tsParser from "@typescript-eslint/parser";
8+
import path from "node:path";
9+
import { fileURLToPath } from "node:url";
10+
import js from "@eslint/js";
11+
import { FlatCompat } from "@eslint/eslintrc";
12+
13+
const __filename = fileURLToPath(import.meta.url);
14+
const __dirname = path.dirname(__filename);
15+
const compat = new FlatCompat({
16+
baseDirectory: __dirname,
17+
recommendedConfig: js.configs.recommended,
18+
allConfig: js.configs.all
19+
});
20+
21+
export default defineConfig([
22+
globalIgnores(["**/dist/", "**/lib/", "**/node_modules/", "**/jest.config.js"]),
23+
{
24+
extends: compat.extends("plugin:github/recommended"),
25+
26+
plugins: {
27+
jest,
28+
"@typescript-eslint": typescriptEslint,
29+
"@stylistic": stylistic,
30+
"anti-trojan-source": antiTrojanSource,
31+
},
32+
33+
files: ["**/*.ts"],
34+
35+
languageOptions: {
36+
globals: {
37+
...globals.node,
38+
...globals.jest,
39+
},
40+
41+
parser: tsParser,
42+
ecmaVersion: 9,
43+
sourceType: "module",
44+
45+
parserOptions: {
46+
project: "./tsconfig.json",
47+
},
48+
},
49+
50+
rules: {
51+
"@typescript-eslint/array-type": "error",
52+
"@typescript-eslint/await-thenable": "error",
53+
"@typescript-eslint/ban-ts-comment": "error",
54+
"@typescript-eslint/consistent-type-assertions": "error",
55+
56+
"@typescript-eslint/explicit-function-return-type": ["error", {
57+
allowExpressions: true,
58+
}],
59+
60+
"@typescript-eslint/explicit-member-accessibility": ["error", {
61+
accessibility: "no-public",
62+
}],
63+
64+
"@stylistic/func-call-spacing": ["error", "never"],
65+
"@typescript-eslint/no-array-constructor": "error",
66+
"@typescript-eslint/no-empty-interface": "error",
67+
"@typescript-eslint/no-explicit-any": "error",
68+
"@typescript-eslint/no-extraneous-class": "error",
69+
"@typescript-eslint/no-for-in-array": "error",
70+
"@typescript-eslint/no-inferrable-types": "error",
71+
"@typescript-eslint/no-misused-new": "error",
72+
"@typescript-eslint/no-namespace": "error",
73+
"@typescript-eslint/no-non-null-assertion": "warn",
74+
"@typescript-eslint/no-require-imports": "error",
75+
"@typescript-eslint/no-unnecessary-qualifier": "error",
76+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
77+
"@typescript-eslint/no-unused-vars": "off",
78+
"@typescript-eslint/no-useless-constructor": "error",
79+
"@typescript-eslint/no-var-requires": "error",
80+
"@typescript-eslint/prefer-for-of": "warn",
81+
"@typescript-eslint/prefer-function-type": "warn",
82+
"@typescript-eslint/prefer-includes": "error",
83+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
84+
"@typescript-eslint/promise-function-async": "error",
85+
"@typescript-eslint/require-array-sort-compare": "error",
86+
"@typescript-eslint/restrict-plus-operands": "error",
87+
"@stylistic/semi": ["error", "never"],
88+
"@stylistic/type-annotation-spacing": "error",
89+
"@typescript-eslint/unbound-method": "error",
90+
"anti-trojan-source/no-bidi": "error",
91+
camelcase: "off",
92+
"eslint-comments/no-use": "off",
93+
"filenames/match-regex": "off",
94+
"i18n-text/no-en": "off",
95+
"import/no-namespace": "off",
96+
"no-unused-vars": "off",
97+
semi: "off",
98+
},
99+
},
100+
]);

main.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@ import {readdirSync, unlinkSync} from 'fs'
55

66
async function run(): Promise<void> {
77
try {
8-
const {
9-
artifactName,
10-
stripPrefix,
11-
download,
12-
bytesToExtract,
13-
cacheId
14-
} = await get(
15-
core.getInput('repository'),
16-
core.getInput('definitionId'),
17-
core.getInput('artifact'),
18-
core.getInput('stripPrefix'),
19-
core.getInput('reasonFilter')
20-
)
8+
const {artifactName, stripPrefix, download, bytesToExtract, cacheId} =
9+
await get(
10+
core.getInput('repository'),
11+
core.getInput('definitionId'),
12+
core.getInput('artifact'),
13+
core.getInput('stripPrefix'),
14+
core.getInput('reasonFilter')
15+
)
2116
const outputDirectory = core.getInput('path') || artifactName
2217
let useCache = core.getInput('cache') === 'true'
2318
const verbose: number | boolean = ((input?: string) =>
@@ -29,6 +24,7 @@ async function run(): Promise<void> {
2924
try {
3025
return readdirSync(path).length === 0
3126
} catch (e) {
27+
/* eslint @typescript-eslint/no-explicit-any: "off" */
3228
return e instanceof Object && (e as any).code === 'ENOENT'
3329
}
3430
}
@@ -72,7 +68,9 @@ async function run(): Promise<void> {
7268
core.warning(`Failed to cache ${cacheId}`)
7369
}
7470
} catch (e) {
75-
core.warning(`Failed to cache ${cacheId}: ${e instanceof Error && e.message}`)
71+
core.warning(
72+
`Failed to cache ${cacheId}: ${e instanceof Error && e.message}`
73+
)
7674
}
7775

7876
if (storeZipAs) {

0 commit comments

Comments
 (0)