@cocopalm/oxc-linter-config 0.1.0 → 0.2.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.ko.md +10 -13
- package/README.md +10 -13
- package/dist/{common.d.mts → base.d.mts} +1 -1
- package/dist/{common.mjs → base.mjs} +3 -3
- package/dist/react-compiler.d.mts +23 -0
- package/dist/react-compiler.mjs +24 -0
- package/package.json +9 -5
package/README.ko.md
CHANGED
|
@@ -26,11 +26,11 @@ touch oxlint.config.ts
|
|
|
26
26
|
// oxlint.config.ts
|
|
27
27
|
|
|
28
28
|
import { defineConfig } from 'oxlint'
|
|
29
|
-
import
|
|
29
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
30
30
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
31
31
|
|
|
32
32
|
export default defineConfig({
|
|
33
|
-
extends: [
|
|
33
|
+
extends: [baseConfig, reactConfig],
|
|
34
34
|
})
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -66,11 +66,11 @@ export default defineConfig({
|
|
|
66
66
|
// oxlint.config.ts
|
|
67
67
|
|
|
68
68
|
import { defineConfig } from 'oxlint'
|
|
69
|
-
import
|
|
69
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
70
70
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
71
71
|
|
|
72
72
|
export default defineConfig({
|
|
73
|
-
extends: [
|
|
73
|
+
extends: [baseConfig, reactConfig],
|
|
74
74
|
overrides: [
|
|
75
75
|
{
|
|
76
76
|
files: ['**/*.{ts,tsx}'],
|
|
@@ -88,10 +88,10 @@ export default defineConfig({
|
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
import { defineConfig } from 'oxlint'
|
|
91
|
-
import
|
|
91
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
92
92
|
|
|
93
93
|
export default defineConfig({
|
|
94
|
-
extends: [
|
|
94
|
+
extends: [baseConfig],
|
|
95
95
|
})
|
|
96
96
|
```
|
|
97
97
|
|
|
@@ -99,11 +99,11 @@ export default defineConfig({
|
|
|
99
99
|
|
|
100
100
|
```ts
|
|
101
101
|
import { defineConfig } from 'oxlint'
|
|
102
|
-
import
|
|
102
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
103
103
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
104
104
|
|
|
105
105
|
export default defineConfig({
|
|
106
|
-
extends: [
|
|
106
|
+
extends: [baseConfig, reactConfig],
|
|
107
107
|
})
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -111,11 +111,11 @@ export default defineConfig({
|
|
|
111
111
|
|
|
112
112
|
```ts
|
|
113
113
|
import { defineConfig } from 'oxlint'
|
|
114
|
-
import
|
|
114
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
115
115
|
import nodeConfig from '@cocopalm/oxc-linter-config/node'
|
|
116
116
|
|
|
117
117
|
export default defineConfig({
|
|
118
|
-
extends: [
|
|
118
|
+
extends: [baseConfig, nodeConfig],
|
|
119
119
|
})
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -145,6 +145,3 @@ export default defineConfig({
|
|
|
145
145
|
- [eslint-core](./docs/eslint-core.md)
|
|
146
146
|
- [eslint-react](./docs/eslint-react.md)
|
|
147
147
|
|
|
148
|
-
2. `react compiler` 관련 규칙들은 아직 oxc linter react plugin에서 지원하지 않기 때문에 적용되어있지 않습니다.
|
|
149
|
-
|
|
150
|
-
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
package/README.md
CHANGED
|
@@ -26,11 +26,11 @@ Import the configs and combine them using `defineConfig`.
|
|
|
26
26
|
// oxlint.config.ts
|
|
27
27
|
|
|
28
28
|
import { defineConfig } from 'oxlint'
|
|
29
|
-
import
|
|
29
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
30
30
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
31
31
|
|
|
32
32
|
export default defineConfig({
|
|
33
|
-
extends: [
|
|
33
|
+
extends: [baseConfig, reactConfig],
|
|
34
34
|
})
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -66,11 +66,11 @@ Add lint scripts to your `package.json`.
|
|
|
66
66
|
// oxlint.config.ts
|
|
67
67
|
|
|
68
68
|
import { defineConfig } from 'oxlint'
|
|
69
|
-
import
|
|
69
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
70
70
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
71
71
|
|
|
72
72
|
export default defineConfig({
|
|
73
|
-
extends: [
|
|
73
|
+
extends: [baseConfig, reactConfig],
|
|
74
74
|
overrides: [
|
|
75
75
|
{
|
|
76
76
|
files: ['**/*.{ts,tsx}'],
|
|
@@ -88,10 +88,10 @@ export default defineConfig({
|
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
import { defineConfig } from 'oxlint'
|
|
91
|
-
import
|
|
91
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
92
92
|
|
|
93
93
|
export default defineConfig({
|
|
94
|
-
extends: [
|
|
94
|
+
extends: [baseConfig],
|
|
95
95
|
})
|
|
96
96
|
```
|
|
97
97
|
|
|
@@ -99,11 +99,11 @@ export default defineConfig({
|
|
|
99
99
|
|
|
100
100
|
```ts
|
|
101
101
|
import { defineConfig } from 'oxlint'
|
|
102
|
-
import
|
|
102
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
103
103
|
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
104
104
|
|
|
105
105
|
export default defineConfig({
|
|
106
|
-
extends: [
|
|
106
|
+
extends: [baseConfig, reactConfig],
|
|
107
107
|
})
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -111,11 +111,11 @@ export default defineConfig({
|
|
|
111
111
|
|
|
112
112
|
```ts
|
|
113
113
|
import { defineConfig } from 'oxlint'
|
|
114
|
-
import
|
|
114
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
115
115
|
import nodeConfig from '@cocopalm/oxc-linter-config/node'
|
|
116
116
|
|
|
117
117
|
export default defineConfig({
|
|
118
|
-
extends: [
|
|
118
|
+
extends: [baseConfig, nodeConfig],
|
|
119
119
|
})
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -145,6 +145,3 @@ To check the progress, please refer to the following issue.
|
|
|
145
145
|
- [eslint-core](./docs/eslint-core.md)
|
|
146
146
|
- [eslint-react](./docs/eslint-react.md)
|
|
147
147
|
|
|
148
|
-
2. `react compiler` related rules are not applied because the oxc linter react plugin does not yet support them.
|
|
149
|
-
|
|
150
|
-
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from "oxlint";
|
|
2
|
-
//#region src/
|
|
3
|
-
var
|
|
2
|
+
//#region src/base.ts
|
|
3
|
+
var base_default = defineConfig({
|
|
4
4
|
plugins: ["eslint", "promise"],
|
|
5
5
|
rules: {
|
|
6
6
|
"eslint/no-unused-vars": ["error", {
|
|
@@ -84,4 +84,4 @@ var common_default = defineConfig({
|
|
|
84
84
|
]
|
|
85
85
|
});
|
|
86
86
|
//#endregion
|
|
87
|
-
export {
|
|
87
|
+
export { base_default as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/react-compiler.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
jsPlugins: string[];
|
|
4
|
+
rules: {
|
|
5
|
+
'react-hooks/config': "error";
|
|
6
|
+
'react-hooks/error-boundaries': "error";
|
|
7
|
+
'react-hooks/component-hook-factories': "error";
|
|
8
|
+
'react-hooks/gating': "error";
|
|
9
|
+
'react-hooks/globals': "error";
|
|
10
|
+
'react-hooks/immutability': "error";
|
|
11
|
+
'react-hooks/preserve-manual-memoization': "error";
|
|
12
|
+
'react-hooks/purity': "error";
|
|
13
|
+
'react-hooks/refs': "error";
|
|
14
|
+
'react-hooks/set-state-in-effect': "error";
|
|
15
|
+
'react-hooks/set-state-in-render': "error";
|
|
16
|
+
'react-hooks/static-components': "error";
|
|
17
|
+
'react-hooks/unsupported-syntax': "warn";
|
|
18
|
+
'react-hooks/use-memo': "error";
|
|
19
|
+
'react-hooks/incompatible-library': "warn";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { _default as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
//#region src/react-compiler.ts
|
|
3
|
+
var react_compiler_default = defineConfig({
|
|
4
|
+
jsPlugins: ["eslint-plugin-react-hooks"],
|
|
5
|
+
rules: {
|
|
6
|
+
"react-hooks/config": "error",
|
|
7
|
+
"react-hooks/error-boundaries": "error",
|
|
8
|
+
"react-hooks/component-hook-factories": "error",
|
|
9
|
+
"react-hooks/gating": "error",
|
|
10
|
+
"react-hooks/globals": "error",
|
|
11
|
+
"react-hooks/immutability": "error",
|
|
12
|
+
"react-hooks/preserve-manual-memoization": "error",
|
|
13
|
+
"react-hooks/purity": "error",
|
|
14
|
+
"react-hooks/refs": "error",
|
|
15
|
+
"react-hooks/set-state-in-effect": "error",
|
|
16
|
+
"react-hooks/set-state-in-render": "error",
|
|
17
|
+
"react-hooks/static-components": "error",
|
|
18
|
+
"react-hooks/unsupported-syntax": "warn",
|
|
19
|
+
"react-hooks/use-memo": "error",
|
|
20
|
+
"react-hooks/incompatible-library": "warn"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { react_compiler_default as default };
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocopalm/oxc-linter-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "oxc linter configuration",
|
|
5
5
|
"author": "puffcocos",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "./dist/
|
|
8
|
+
"main": "./dist/base.mjs",
|
|
9
9
|
"exports": {
|
|
10
|
-
"./
|
|
11
|
-
"import": "./dist/
|
|
12
|
-
"types": "./dist/
|
|
10
|
+
"./base": {
|
|
11
|
+
"import": "./dist/base.mjs",
|
|
12
|
+
"types": "./dist/base.d.mts"
|
|
13
13
|
},
|
|
14
14
|
"./react": {
|
|
15
15
|
"import": "./dist/react.mjs",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"./node": {
|
|
19
19
|
"import": "./dist/node.mjs",
|
|
20
20
|
"types": "./dist/node.d.mts"
|
|
21
|
+
},
|
|
22
|
+
"./react-compiler": {
|
|
23
|
+
"import": "./dist/react-compiler.mjs",
|
|
24
|
+
"types": "./dist/react-compiler.d.mts"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"files": [
|