Skip to content

Commit 00d9655

Browse files
committed
feat: js to ts
1 parent 878d740 commit 00d9655

79 files changed

Lines changed: 4791 additions & 2812 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"env": {
3+
"es2022": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"@typescript-eslint/recommended"
8+
],
9+
"parser": "@typescript-eslint/parser",
10+
"parserOptions": {
11+
"ecmaVersion": "latest",
12+
"sourceType": "module",
13+
"project": "./tsconfig.json"
14+
},
15+
"plugins": [
16+
"@typescript-eslint"
17+
],
18+
"rules": {
19+
"@typescript-eslint/no-explicit-any": "warn",
20+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
21+
"@typescript-eslint/explicit-function-return-type": "off",
22+
"@typescript-eslint/no-inferrable-types": "off",
23+
"@typescript-eslint/no-non-null-assertion": "off",
24+
"@typescript-eslint/prefer-const": "warn",
25+
"@typescript-eslint/no-var-requires": "warn",
26+
"@typescript-eslint/ban-ts-comment": ["warn", {
27+
"ts-ignore": "allow-with-description"
28+
}],
29+
"prefer-const": "warn",
30+
"no-var": "error",
31+
"no-console": "warn",
32+
"eqeqeq": ["warn", "always"]
33+
},
34+
"ignorePatterns": [
35+
"build/",
36+
"dist/",
37+
"node_modules/",
38+
"test/",
39+
"docs/",
40+
"coverage/",
41+
"*.js"
42+
]
43+
}

build.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineBuildConfig } from "unbuild";
22

3-
const ENTRIES = ["./index"] as const;
3+
const ENTRIES = ["./index.ts"] as const;
44
const OUT_DIR = "build" as const;
55
const PACKAGE_NAME = "FormulaParser" as const;
66

@@ -24,6 +24,7 @@ function createNodeCjsMin() {
2424
platform: "node" as const,
2525
target: NODE_TARGET,
2626
minify: true,
27+
treeShaking: true,
2728
},
2829
},
2930
} as const;
@@ -60,7 +61,7 @@ function createBrowserBundle(format: BrowserFormat, minify = false) {
6061
}
6162

6263
export default defineBuildConfig([
63-
// Node: emit ESM + CJS (main/module/exports 对应)
64+
// Node: emit ESM + CJS (corresponding to main/module/exports)
6465
{
6566
entries: ENTRIES as unknown as string[],
6667
outDir: OUT_DIR,

formulas/error.js

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

0 commit comments

Comments
 (0)