@resolid/config 5.2.2 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,6 +20,14 @@ pnpm add -D @resolid/config oxlint typescript
20
20
  }
21
21
  ```
22
22
 
23
+ ### Node 项目
24
+
25
+ ```json
26
+ {
27
+ "extends": "@resolid/config/tsconfig/node.json"
28
+ }
29
+ ```
30
+
23
31
  ### React 项目
24
32
 
25
33
  ```json
@@ -34,8 +42,8 @@ pnpm add -D @resolid/config oxlint typescript
34
42
 
35
43
  ```js
36
44
  // oxlint.config.ts
37
- import javascriptConfig from "@resolid/config/oxlint/javascript";
38
45
  import { defineConfig } from "oxlint";
46
+ import javascriptConfig from "@resolid/config/oxlint/javascript";
39
47
 
40
48
  export default defineConfig({
41
49
  extends: [javascriptConfig],
@@ -46,8 +54,8 @@ export default defineConfig({
46
54
 
47
55
  ```js
48
56
  // oxlint.config.ts
49
- import typescriptConfig from "@resolid/config/oxlint/typescript";
50
57
  import { defineConfig } from "oxlint";
58
+ import typescriptConfig from "@resolid/config/oxlint/typescript";
51
59
 
52
60
  export default defineConfig({
53
61
  extends: [typescriptConfig],
@@ -64,8 +72,8 @@ pnpm add -D eslint-plugin-react-hooks eslint-plugin-react-you-might-not-need-an-
64
72
 
65
73
  ```js
66
74
  // oxlint.config.ts
67
- import reactConfig from "@resolid/config/oxlint/react";
68
75
  import { defineConfig } from "oxlint";
76
+ import reactConfig from "@resolid/config/oxlint/react";
69
77
 
70
78
  export default defineConfig({
71
79
  extends: [reactConfig],
@@ -76,13 +84,21 @@ export default defineConfig({
76
84
 
77
85
  ```js
78
86
  // oxlint.config.ts
87
+ import { defineConfig } from "oxlint";
79
88
  // 浏览器环境
80
89
  import browserConfig from "@resolid/config/oxlint/browser";
81
90
  // Node 环境
82
91
  import nodeConfig from "@resolid/config/oxlint/node";
83
- import { defineConfig } from "oxlint";
84
92
 
85
93
  export default defineConfig({
86
94
  extends: [browserConfig, nodeConfig],
87
95
  });
88
96
  ```
97
+
98
+ ## Oxfmt 配置
99
+
100
+ ```js
101
+ import { oxfmtConfig } from "@resolid/config/oxfmt";
102
+
103
+ export default oxfmtConfig({});
104
+ ```
@@ -4,18 +4,49 @@ import javascriptConfig from "./javascript.js";
4
4
  export default defineConfig({
5
5
  extends: [javascriptConfig],
6
6
  plugins: ["typescript"],
7
+ options: { typeAware: true, typeCheck: true },
7
8
  rules: {
9
+ "typescript/adjacent-overload-signatures": "warn",
8
10
  "typescript/array-type": "warn",
9
11
  "typescript/ban-ts-comment": "error",
10
- "typescript/consistent-type-imports": "error",
12
+ "typescript/class-literal-property-style": "warn",
13
+ "typescript/dot-notation": "error",
14
+ "typescript/consistent-generic-constructors": "warn",
15
+ "typescript/consistent-indexed-object-style": ["warn", "record"],
16
+ "typescript/consistent-type-assertions": [
17
+ "warn",
18
+ {
19
+ assertionStyle: "as",
20
+ },
21
+ ],
22
+ "typescript/consistent-type-definitions": ["warn", "type"],
23
+ "typescript/consistent-type-exports": [
24
+ "warn",
25
+ {
26
+ fixMixedExportsWithInlineTypeSpecifier: true,
27
+ },
28
+ ],
29
+ "typescript/consistent-type-imports": [
30
+ "error",
31
+ {
32
+ fixStyle: "inline-type-imports",
33
+ },
34
+ ],
11
35
 
36
+ "typescript/no-deprecated": "warn",
12
37
  "typescript/no-empty-object-type": "error",
13
38
  "typescript/no-explicit-any": "error",
14
39
  "typescript/no-import-type-side-effects": "error",
15
40
  "typescript/no-namespace": "error",
16
41
  "typescript/no-require-imports": "error",
42
+ "typescript/no-unnecessary-condition": "error",
43
+ "typescript/no-unnecessary-qualifier": "error",
44
+ "typescript/no-unnecessary-type-arguments": "error",
45
+ "typescript/no-unnecessary-type-assertion": "error",
17
46
  "typescript/no-unnecessary-type-constraint": "error",
47
+ "typescript/no-unnecessary-template-expression": "error",
18
48
  "typescript/no-unsafe-function-type": "error",
49
+ "typescript/no-useless-default-assignment": "error",
19
50
 
20
51
  "typescript/prefer-for-of": "error",
21
52
  "typescript/prefer-function-type": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolid/config",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "description": "Oxlint and Typescript config",
5
5
  "keywords": [
6
6
  "oxfmt",
@@ -47,14 +47,15 @@
47
47
  "lefthook": "^2.1.4",
48
48
  "oxfmt": "^0.41.0",
49
49
  "oxlint": "^1.56.0",
50
- "typescript": "^5.9.3"
50
+ "typescript": "^6.0.2"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "eslint-plugin-react-hooks": "^7.0.1",
54
54
  "eslint-plugin-react-you-might-not-need-an-effect": "^0.9.2",
55
55
  "oxfmt": "^0.41.0",
56
56
  "oxlint": "^1.56.0",
57
- "typescript": "^5.9.3"
57
+ "oxlint-tsgolint": "^0.17.2",
58
+ "typescript": "^6.0.2"
58
59
  },
59
60
  "peerDependenciesMeta": {
60
61
  "typescript": {
@@ -1,21 +1,20 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "compilerOptions": {
4
- "esModuleInterop": true,
5
- "skipLibCheck": true,
6
- "target": "es2022",
7
- "allowJs": true,
8
- "resolveJsonModule": true,
4
+ "module": "esnext",
5
+ "moduleResolution": "bundler",
9
6
  "moduleDetection": "force",
7
+ "noEmit": true,
8
+
9
+ "target": "es2022",
10
+
10
11
  "isolatedModules": true,
11
- "verbatimModuleSyntax": true,
12
- "strict": true,
13
- "noUncheckedSideEffectImports": true,
14
- "noFallthroughCasesInSwitch": true,
15
- "noImplicitOverride": true,
16
12
  "erasableSyntaxOnly": true,
17
- "module": "preserve",
18
- "noEmit": true,
19
- "lib": ["es2022", "dom", "dom.iterable"]
13
+
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "resolveJsonModule": true,
17
+
18
+ "lib": ["es2022", "dom"]
20
19
  }
21
20
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "types": ["node"]
6
+ }
7
+ }