@soybeanjs/oxc-config 0.0.2 → 0.0.3

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.en.md CHANGED
@@ -27,7 +27,7 @@ pnpm add -D @soybeanjs/oxc-config oxfmt oxlint
27
27
  Create `oxfmt.config.ts` at project root:
28
28
 
29
29
  ```ts
30
- import { fmt } from "@soybeanjs/oxc-config";
30
+ import { fmt } from '@soybeanjs/oxc-config';
31
31
 
32
32
  export default fmt;
33
33
  ```
@@ -35,7 +35,7 @@ export default fmt;
35
35
  You can also extend it:
36
36
 
37
37
  ```ts
38
- import { fmt } from "@soybeanjs/oxc-config";
38
+ import { fmt } from '@soybeanjs/oxc-config';
39
39
 
40
40
  export default {
41
41
  ...fmt,
@@ -95,7 +95,7 @@ Config (config, setting, constants...)
95
95
  Create `oxlint.config.ts` at project root:
96
96
 
97
97
  ```ts
98
- import { lint } from "@soybeanjs/oxc-config";
98
+ import { lint } from '@soybeanjs/oxc-config';
99
99
 
100
100
  export default lint;
101
101
  ```
@@ -115,24 +115,24 @@ A custom oxlint JS plugin that ensures `import type` always comes after `import`
115
115
 
116
116
  ```ts
117
117
  // ✅ Correct
118
- import { ref } from "vue";
119
- import type { Ref } from "vue";
118
+ import { ref } from 'vue';
119
+ import type { Ref } from 'vue';
120
120
 
121
121
  // ❌ Incorrect
122
- import type { Ref } from "vue";
123
- import { ref } from "vue";
122
+ import type { Ref } from 'vue';
123
+ import { ref } from 'vue';
124
124
  ```
125
125
 
126
126
  The exported `lint` config already includes this plugin and rule. To override or extend:
127
127
 
128
128
  ```ts
129
- import { lint } from "@soybeanjs/oxc-config";
129
+ import { lint } from '@soybeanjs/oxc-config';
130
130
 
131
131
  export default {
132
132
  ...lint,
133
- jsPlugins: ["@soybeanjs/oxc-config/import-type-order"],
133
+ jsPlugins: ['@soybeanjs/oxc-config/import-type-order'],
134
134
  rules: {
135
- "import-type-order/type-after-value": "warn"
135
+ 'import-type-order/type-after-value': 'warn'
136
136
  }
137
137
  };
138
138
  ```
package/README.md CHANGED
@@ -27,7 +27,7 @@ pnpm add -D @soybeanjs/oxc-config oxfmt oxlint
27
27
  在项目根目录创建 `oxfmt.config.ts`:
28
28
 
29
29
  ```ts
30
- import { fmt } from "@soybeanjs/oxc-config";
30
+ import { fmt } from '@soybeanjs/oxc-config';
31
31
 
32
32
  export default fmt;
33
33
  ```
@@ -35,7 +35,7 @@ export default fmt;
35
35
  也可以在此基础上扩展:
36
36
 
37
37
  ```ts
38
- import { fmt } from "@soybeanjs/oxc-config";
38
+ import { fmt } from '@soybeanjs/oxc-config';
39
39
 
40
40
  export default {
41
41
  ...fmt,
@@ -95,7 +95,7 @@ Internal 别名排序层级(`order.json`):
95
95
  在项目根目录创建 `oxlint.config.ts`:
96
96
 
97
97
  ```ts
98
- import { lint } from "@soybeanjs/oxc-config";
98
+ import { lint } from '@soybeanjs/oxc-config';
99
99
 
100
100
  export default lint;
101
101
  ```
@@ -115,12 +115,12 @@ export default lint;
115
115
 
116
116
  ```ts
117
117
  // ✅ 正确
118
- import { ref } from "vue";
119
- import type { Ref } from "vue";
118
+ import { ref } from 'vue';
119
+ import type { Ref } from 'vue';
120
120
 
121
121
  // ❌ 错误
122
- import type { Ref } from "vue";
123
- import { ref } from "vue";
122
+ import type { Ref } from 'vue';
123
+ import { ref } from 'vue';
124
124
  ```
125
125
 
126
126
  在 `oxlint.config.ts` 中启用:
@@ -128,13 +128,13 @@ import { ref } from "vue";
128
128
  (导出的lint默认已经包含了插件和规则,这里仅展示如何覆盖或添加规则)
129
129
 
130
130
  ```ts
131
- import { lint } from "@soybeanjs/oxc-config";
131
+ import { lint } from '@soybeanjs/oxc-config';
132
132
 
133
133
  export default {
134
134
  ...lint,
135
- jsPlugins: ["@soybeanjs/oxc-config/import-type-order"],
135
+ jsPlugins: ['@soybeanjs/oxc-config/import-type-order'],
136
136
  rules: {
137
- "import-type-order/type-after-value": "warn"
137
+ 'import-type-order/type-after-value': 'warn'
138
138
  }
139
139
  };
140
140
  ```
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var external = [
3
3
  "vite",
4
4
  "@vitejs/**",
5
- "vite-plugin-*",
5
+ "vite-*",
6
6
  "tsdown",
7
7
  "unplugin-*",
8
8
  "vitest",
@@ -12,18 +12,32 @@ var external = [
12
12
  "vue",
13
13
  "@vue/**",
14
14
  "vue-router",
15
+ "vue-router/**",
15
16
  "@vueuse/**",
17
+ "vue-*",
16
18
  "nuxt",
17
19
  "@nuxt/**",
20
+ "nuxt-*",
18
21
  "react",
19
22
  "react-dom",
20
23
  "@react/**",
24
+ "react-*",
21
25
  "next",
22
26
  "@next/**",
23
27
  "pinia",
24
- "pinia-colada",
28
+ "pinia-*",
25
29
  "zustand",
26
30
  "jotai",
31
+ "unocss",
32
+ "unocss/**",
33
+ "@unocss/**",
34
+ "unocss-*",
35
+ "tailwindcss",
36
+ "@tailwindcss/**",
37
+ "tailwind-*",
38
+ "postcss",
39
+ "@postcss/**",
40
+ "postcss-*",
27
41
  "@soybeanjs/**",
28
42
  "nuxt-ui",
29
43
  "element-plus",
@@ -32,12 +46,6 @@ var external = [
32
46
  "naive-ui",
33
47
  "@arco-design/**",
34
48
  "@iconify/**",
35
- "tailwindcss",
36
- "@tailwindcss/**",
37
- "unocss",
38
- "@unocss/**",
39
- "postcss",
40
- "@postcss/**",
41
49
  "axios",
42
50
  "date-fns",
43
51
  "dayjs",
@@ -108,6 +116,8 @@ var internal = [
108
116
  const customGroups = [];
109
117
  const externalGroupNames = [];
110
118
  const internalGroupNames = [];
119
+ const parentGroupNames = [];
120
+ const siblingGroupNames = [];
111
121
  external.forEach((item, index) => {
112
122
  const groupName = `external-${index}`;
113
123
  externalGroupNames.push(groupName);
@@ -125,6 +135,20 @@ internal.forEach((item, index) => {
125
135
  elementNamePattern: [item],
126
136
  selector: "internal"
127
137
  });
138
+ const parentGroupName = `parent-${index}`;
139
+ parentGroupNames.push(parentGroupName);
140
+ customGroups.push({
141
+ groupName: parentGroupName,
142
+ elementNamePattern: [item.replace("@/", "**/")],
143
+ selector: "parent"
144
+ });
145
+ const siblingGroupName = `sibling-${index}`;
146
+ siblingGroupNames.push(siblingGroupName);
147
+ customGroups.push({
148
+ groupName: siblingGroupName,
149
+ elementNamePattern: [item.replace("@/", "**/")],
150
+ selector: "sibling"
151
+ });
128
152
  });
129
153
  const fmt = {
130
154
  printWidth: 120,
@@ -145,7 +169,9 @@ const fmt = {
145
169
  ...internalGroupNames,
146
170
  "internal",
147
171
  "subpath",
172
+ ...parentGroupNames,
148
173
  "parent",
174
+ ...siblingGroupNames,
149
175
  "sibling",
150
176
  "index",
151
177
  "style",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soybeanjs/oxc-config",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "SoybeanJS's oxlint and oxfmt config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -41,6 +41,7 @@
41
41
  }
42
42
  },
43
43
  "publishConfig": {
44
+ "access": "public",
44
45
  "registry": "https://registry.npmjs.org/"
45
46
  },
46
47
  "devDependencies": {
@@ -65,8 +66,8 @@
65
66
  "scripts": {
66
67
  "build": "tsdown",
67
68
  "commit": "soy git-commit",
68
- "lint": "oxlint --fix",
69
69
  "fmt": "oxfmt",
70
+ "lint": "oxlint --fix",
70
71
  "publish-pkg": "pnpm publish --access public",
71
72
  "release": "soy release",
72
73
  "typecheck": "tsc --noEmit --skipLibCheck",