@cocopalm/oxc-linter-config 0.2.0 → 0.2.2
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 +20 -1
- package/README.md +20 -1
- package/dist/react-compiler.d.mts +19 -16
- package/dist/react-compiler.mjs +19 -16
- package/package.json +8 -2
package/README.ko.md
CHANGED
|
@@ -107,7 +107,26 @@ export default defineConfig({
|
|
|
107
107
|
})
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
3. **
|
|
110
|
+
3. **React Compiler를 사용하는 React 프로젝트**
|
|
111
|
+
|
|
112
|
+
> **참고:** `/react-compiler` 설정을 사용하려면 `eslint-plugin-react-hooks` 패키지가 필요합니다:
|
|
113
|
+
>
|
|
114
|
+
> ```bash
|
|
115
|
+
> pnpm add -D eslint-plugin-react-hooks
|
|
116
|
+
> ```
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import { defineConfig } from 'oxlint'
|
|
120
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
121
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
122
|
+
import reactCompilerConfig from '@cocopalm/oxc-linter-config/react-compiler'
|
|
123
|
+
|
|
124
|
+
export default defineConfig({
|
|
125
|
+
extends: [baseConfig, reactConfig, reactCompilerConfig],
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
4. **Node.js 프로젝트**
|
|
111
130
|
|
|
112
131
|
```ts
|
|
113
132
|
import { defineConfig } from 'oxlint'
|
package/README.md
CHANGED
|
@@ -107,7 +107,26 @@ export default defineConfig({
|
|
|
107
107
|
})
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
3. **
|
|
110
|
+
3. **React projects with React Compiler**
|
|
111
|
+
|
|
112
|
+
> **Note:** Using the `/react-compiler` config requires `eslint-plugin-react-hooks` to be installed:
|
|
113
|
+
>
|
|
114
|
+
> ```bash
|
|
115
|
+
> pnpm add -D eslint-plugin-react-hooks
|
|
116
|
+
> ```
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import { defineConfig } from 'oxlint'
|
|
120
|
+
import baseConfig from '@cocopalm/oxc-linter-config/base'
|
|
121
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
122
|
+
import reactCompilerConfig from '@cocopalm/oxc-linter-config/react-compiler'
|
|
123
|
+
|
|
124
|
+
export default defineConfig({
|
|
125
|
+
extends: [baseConfig, reactConfig, reactCompilerConfig],
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
4. **Node.js projects**
|
|
111
130
|
|
|
112
131
|
```ts
|
|
113
132
|
import { defineConfig } from 'oxlint'
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
//#region src/react-compiler.d.ts
|
|
2
2
|
declare const _default: {
|
|
3
|
-
jsPlugins:
|
|
3
|
+
jsPlugins: {
|
|
4
|
+
name: string;
|
|
5
|
+
specifier: string;
|
|
6
|
+
}[];
|
|
4
7
|
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";
|
|
8
|
+
'react-hooks-js/config': "error";
|
|
9
|
+
'react-hooks-js/error-boundaries': "error";
|
|
10
|
+
'react-hooks-js/component-hook-factories': "error";
|
|
11
|
+
'react-hooks-js/gating': "error";
|
|
12
|
+
'react-hooks-js/globals': "error";
|
|
13
|
+
'react-hooks-js/immutability': "error";
|
|
14
|
+
'react-hooks-js/preserve-manual-memoization': "error";
|
|
15
|
+
'react-hooks-js/purity': "error";
|
|
16
|
+
'react-hooks-js/refs': "error";
|
|
17
|
+
'react-hooks-js/set-state-in-effect': "error";
|
|
18
|
+
'react-hooks-js/set-state-in-render': "error";
|
|
19
|
+
'react-hooks-js/static-components': "error";
|
|
20
|
+
'react-hooks-js/unsupported-syntax': "warn";
|
|
21
|
+
'react-hooks-js/use-memo': "error";
|
|
22
|
+
'react-hooks-js/incompatible-library': "warn";
|
|
20
23
|
};
|
|
21
24
|
};
|
|
22
25
|
//#endregion
|
package/dist/react-compiler.mjs
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { defineConfig } from "oxlint";
|
|
2
2
|
//#region src/react-compiler.ts
|
|
3
3
|
var react_compiler_default = defineConfig({
|
|
4
|
-
jsPlugins: [
|
|
4
|
+
jsPlugins: [{
|
|
5
|
+
name: "react-hooks-js",
|
|
6
|
+
specifier: "eslint-plugin-react-hooks"
|
|
7
|
+
}],
|
|
5
8
|
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"
|
|
9
|
+
"react-hooks-js/config": "error",
|
|
10
|
+
"react-hooks-js/error-boundaries": "error",
|
|
11
|
+
"react-hooks-js/component-hook-factories": "error",
|
|
12
|
+
"react-hooks-js/gating": "error",
|
|
13
|
+
"react-hooks-js/globals": "error",
|
|
14
|
+
"react-hooks-js/immutability": "error",
|
|
15
|
+
"react-hooks-js/preserve-manual-memoization": "error",
|
|
16
|
+
"react-hooks-js/purity": "error",
|
|
17
|
+
"react-hooks-js/refs": "error",
|
|
18
|
+
"react-hooks-js/set-state-in-effect": "error",
|
|
19
|
+
"react-hooks-js/set-state-in-render": "error",
|
|
20
|
+
"react-hooks-js/static-components": "error",
|
|
21
|
+
"react-hooks-js/unsupported-syntax": "warn",
|
|
22
|
+
"react-hooks-js/use-memo": "error",
|
|
23
|
+
"react-hooks-js/incompatible-library": "warn"
|
|
21
24
|
}
|
|
22
25
|
});
|
|
23
26
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocopalm/oxc-linter-config",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "oxc linter configuration",
|
|
5
5
|
"author": "puffcocos",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,13 @@
|
|
|
46
46
|
"typescript": "^6.0.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"oxlint": "^1.57.0"
|
|
49
|
+
"oxlint": "^1.57.0",
|
|
50
|
+
"eslint-plugin-react-hooks": "^6.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"eslint-plugin-react-hooks": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
50
56
|
},
|
|
51
57
|
"scripts": {
|
|
52
58
|
"build": "tsdown"
|