Skip to content

Commit 7e56cc3

Browse files
committed
Update tsup to use node24 and migrate ESLint to flat config
1 parent b0097e2 commit 7e56cc3

File tree

3 files changed

+78
-75
lines changed

3 files changed

+78
-75
lines changed

.eslintrc.json

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

eslint.config.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import github from "eslint-plugin-github";
2+
import tseslint from "@typescript-eslint/eslint-plugin";
3+
import tsparser from "@typescript-eslint/parser";
4+
5+
export default [
6+
github.getFlatConfigs().recommended,
7+
...github.getFlatConfigs().typescript,
8+
{
9+
files: ["**/*.ts"],
10+
languageOptions: {
11+
parser: tsparser,
12+
parserOptions: {
13+
ecmaVersion: 9,
14+
sourceType: "module",
15+
project: "./tsconfig.json",
16+
},
17+
},
18+
plugins: {
19+
"@typescript-eslint": tseslint,
20+
},
21+
rules: {
22+
"i18n-text/no-en": "off",
23+
"eslint-comments/no-use": "off",
24+
"import/no-namespace": "off",
25+
"no-unused-vars": "off",
26+
"@typescript-eslint/no-unused-vars": [
27+
"error",
28+
{
29+
argsIgnorePattern: "^_",
30+
},
31+
],
32+
"@typescript-eslint/explicit-member-accessibility": [
33+
"error",
34+
{
35+
accessibility: "no-public",
36+
},
37+
],
38+
"@typescript-eslint/no-base-to-string": "error",
39+
"@typescript-eslint/no-require-imports": "error",
40+
"@typescript-eslint/array-type": "error",
41+
"@typescript-eslint/await-thenable": "error",
42+
"@typescript-eslint/ban-ts-comment": "error",
43+
camelcase: "error",
44+
"@typescript-eslint/consistent-type-assertions": "error",
45+
"@typescript-eslint/explicit-function-return-type": [
46+
"error",
47+
{
48+
allowExpressions: true,
49+
},
50+
],
51+
"func-call-spacing": ["error", "never"],
52+
"@typescript-eslint/no-array-constructor": "error",
53+
"@typescript-eslint/no-empty-interface": "error",
54+
"@typescript-eslint/no-explicit-any": "error",
55+
"@typescript-eslint/no-floating-promises": "error",
56+
"@typescript-eslint/no-extraneous-class": "error",
57+
"@typescript-eslint/no-for-in-array": "error",
58+
"@typescript-eslint/no-inferrable-types": "error",
59+
"@typescript-eslint/no-misused-new": "error",
60+
"@typescript-eslint/no-namespace": "error",
61+
"@typescript-eslint/no-non-null-assertion": "warn",
62+
"@typescript-eslint/no-unnecessary-qualifier": "error",
63+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
64+
"@typescript-eslint/no-useless-constructor": "error",
65+
"@typescript-eslint/no-var-requires": "error",
66+
"@typescript-eslint/prefer-for-of": "warn",
67+
"@typescript-eslint/prefer-function-type": "warn",
68+
"@typescript-eslint/prefer-includes": "error",
69+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
70+
"@typescript-eslint/promise-function-async": "error",
71+
"@typescript-eslint/require-array-sort-compare": "error",
72+
"@typescript-eslint/restrict-plus-operands": "error",
73+
// '@typescript-eslint/type-annotation-spacing': 'error',
74+
"@typescript-eslint/unbound-method": "error",
75+
},
76+
},
77+
];

tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
name,
66
entry: ["src/index.ts"],
77
format: ["esm"],
8-
target: "node20",
8+
target: "node24",
99
bundle: true,
1010
splitting: false,
1111
sourcemap: true,

0 commit comments

Comments
 (0)