@cocopalm/oxc-linter-config 0.0.24 → 0.1.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 +70 -56
- package/README.md +69 -55
- package/dist/common.d.mts +85 -0
- package/dist/common.mjs +87 -0
- package/dist/node.d.mts +7 -0
- package/dist/node.mjs +15 -0
- package/dist/react.d.mts +39 -0
- package/dist/react.mjs +51 -0
- package/package.json +24 -7
- package/oxlint-common.json +0 -67
- package/oxlint-node.json +0 -11
- package/oxlint-react.json +0 -45
package/README.ko.md
CHANGED
|
@@ -12,35 +12,29 @@ pnpm add -D oxlint @cocopalm/oxc-linter-config
|
|
|
12
12
|
|
|
13
13
|
## How to use
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
packages/oxc-linter-config/
|
|
17
|
-
├── oxlint-common.json # 모든 프로젝트에 공통 적용
|
|
18
|
-
├── oxlint-react.json # React/Next.js 프로젝트용
|
|
19
|
-
└── oxlint-node.json # Node.js 프로젝트용
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### .oxlintrc.json 설정하기
|
|
15
|
+
### oxlint.config.ts 설정하기
|
|
23
16
|
|
|
24
|
-
프로젝트 루트 디렉토리에
|
|
17
|
+
프로젝트 루트 디렉토리에 `oxlint.config.ts` 파일을 생성합니다.
|
|
25
18
|
|
|
26
19
|
```bash
|
|
27
|
-
touch .
|
|
20
|
+
touch oxlint.config.ts
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
`defineConfig`를 사용하여 config를 불러오고 조합합니다.
|
|
31
24
|
|
|
32
|
-
```
|
|
33
|
-
// .
|
|
25
|
+
```ts
|
|
26
|
+
// oxlint.config.ts
|
|
34
27
|
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
import { defineConfig } from 'oxlint'
|
|
29
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
30
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
31
|
+
|
|
32
|
+
export default defineConfig({
|
|
33
|
+
extends: [commonConfig, reactConfig],
|
|
34
|
+
})
|
|
41
35
|
```
|
|
42
36
|
|
|
43
|
-
`package.json
|
|
37
|
+
`package.json`에 린트 스크립트를 추가해주세요.
|
|
44
38
|
|
|
45
39
|
```json
|
|
46
40
|
// package.json
|
|
@@ -53,56 +47,76 @@ touch .oxlintrc.json
|
|
|
53
47
|
}
|
|
54
48
|
```
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
> **참고:** oxlint는 `oxlint.config.ts`를 Node.js `import()`로 로드합니다. **Node.js 22**에서는 TypeScript 지원이 기본으로 활성화되어 있지 않으므로 `--experimental-strip-types` 플래그가 필요합니다:
|
|
51
|
+
>
|
|
52
|
+
> ```json
|
|
53
|
+
> {
|
|
54
|
+
> "scripts": {
|
|
55
|
+
> "lint": "NODE_OPTIONS='--experimental-strip-types' oxlint .",
|
|
56
|
+
> "lint:fix": "NODE_OPTIONS='--experimental-strip-types' oxlint . --fix"
|
|
57
|
+
> }
|
|
58
|
+
> }
|
|
59
|
+
> ```
|
|
60
|
+
>
|
|
61
|
+
> **Node.js 23.6+** 에서는 TypeScript 지원이 stable로 승격되어 플래그 없이도 동작합니다.
|
|
62
|
+
|
|
63
|
+
### Rule Overrides
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// oxlint.config.ts
|
|
67
|
+
|
|
68
|
+
import { defineConfig } from 'oxlint'
|
|
69
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
70
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
71
|
+
|
|
72
|
+
export default defineConfig({
|
|
73
|
+
extends: [commonConfig, reactConfig],
|
|
74
|
+
overrides: [
|
|
67
75
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}
|
|
76
|
+
files: ['**/*.{ts,tsx}'],
|
|
77
|
+
rules: {
|
|
78
|
+
'eslint/no-unused-vars': 'off',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
})
|
|
75
83
|
```
|
|
76
84
|
|
|
77
85
|
### Examples
|
|
78
86
|
|
|
79
87
|
1. **Common 규칙만 사용** (vanilla JS/TS 프로젝트)
|
|
80
88
|
|
|
81
|
-
```
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
```ts
|
|
90
|
+
import { defineConfig } from 'oxlint'
|
|
91
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
92
|
+
|
|
93
|
+
export default defineConfig({
|
|
94
|
+
extends: [commonConfig],
|
|
95
|
+
})
|
|
85
96
|
```
|
|
86
97
|
|
|
87
98
|
2. **React 프로젝트**
|
|
88
99
|
|
|
89
|
-
```
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
```ts
|
|
101
|
+
import { defineConfig } from 'oxlint'
|
|
102
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
103
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
104
|
+
|
|
105
|
+
export default defineConfig({
|
|
106
|
+
extends: [commonConfig, reactConfig],
|
|
107
|
+
})
|
|
96
108
|
```
|
|
97
109
|
|
|
98
110
|
3. **Node.js 프로젝트**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
import { defineConfig } from 'oxlint'
|
|
114
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
115
|
+
import nodeConfig from '@cocopalm/oxc-linter-config/node'
|
|
116
|
+
|
|
117
|
+
export default defineConfig({
|
|
118
|
+
extends: [commonConfig, nodeConfig],
|
|
119
|
+
})
|
|
106
120
|
```
|
|
107
121
|
|
|
108
122
|
<br />
|
package/README.md
CHANGED
|
@@ -12,32 +12,26 @@ pnpm add -D oxlint @cocopalm/oxc-linter-config
|
|
|
12
12
|
|
|
13
13
|
## How to use
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
packages/oxc-linter-config/
|
|
17
|
-
├── oxlint-common.json # Common rules for all projects
|
|
18
|
-
├── oxlint-react.json # For React/Next.js projects
|
|
19
|
-
└── oxlint-node.json # For Node.js projects
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Setting up .oxlintrc.json
|
|
15
|
+
### Setting up oxlint.config.ts
|
|
23
16
|
|
|
24
|
-
Create
|
|
17
|
+
Create an `oxlint.config.ts` file in your project root directory.
|
|
25
18
|
|
|
26
19
|
```bash
|
|
27
|
-
touch .
|
|
20
|
+
touch oxlint.config.ts
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
Import the configs and combine them using `defineConfig`.
|
|
31
24
|
|
|
32
|
-
```
|
|
33
|
-
// .
|
|
25
|
+
```ts
|
|
26
|
+
// oxlint.config.ts
|
|
34
27
|
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
import { defineConfig } from 'oxlint'
|
|
29
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
30
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
31
|
+
|
|
32
|
+
export default defineConfig({
|
|
33
|
+
extends: [commonConfig, reactConfig],
|
|
34
|
+
})
|
|
41
35
|
```
|
|
42
36
|
|
|
43
37
|
Add lint scripts to your `package.json`.
|
|
@@ -53,56 +47,76 @@ Add lint scripts to your `package.json`.
|
|
|
53
47
|
}
|
|
54
48
|
```
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
> **Note:** oxlint loads `oxlint.config.ts` via Node.js `import()`. On **Node.js 22**, TypeScript support is not enabled by default, so you need to add `--experimental-strip-types`:
|
|
51
|
+
>
|
|
52
|
+
> ```json
|
|
53
|
+
> {
|
|
54
|
+
> "scripts": {
|
|
55
|
+
> "lint": "NODE_OPTIONS='--experimental-strip-types' oxlint .",
|
|
56
|
+
> "lint:fix": "NODE_OPTIONS='--experimental-strip-types' oxlint . --fix"
|
|
57
|
+
> }
|
|
58
|
+
> }
|
|
59
|
+
> ```
|
|
60
|
+
>
|
|
61
|
+
> On **Node.js 23.6+**, TypeScript support is stable and no flag is needed.
|
|
62
|
+
|
|
63
|
+
### Rule Overrides
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// oxlint.config.ts
|
|
67
|
+
|
|
68
|
+
import { defineConfig } from 'oxlint'
|
|
69
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
70
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
71
|
+
|
|
72
|
+
export default defineConfig({
|
|
73
|
+
extends: [commonConfig, reactConfig],
|
|
74
|
+
overrides: [
|
|
67
75
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}
|
|
76
|
+
files: ['**/*.{ts,tsx}'],
|
|
77
|
+
rules: {
|
|
78
|
+
'eslint/no-unused-vars': 'off',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
})
|
|
75
83
|
```
|
|
76
84
|
|
|
77
85
|
### Examples
|
|
78
86
|
|
|
79
87
|
1. **Common rules only** (vanilla JS/TS projects)
|
|
80
88
|
|
|
81
|
-
```
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
```ts
|
|
90
|
+
import { defineConfig } from 'oxlint'
|
|
91
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
92
|
+
|
|
93
|
+
export default defineConfig({
|
|
94
|
+
extends: [commonConfig],
|
|
95
|
+
})
|
|
85
96
|
```
|
|
86
97
|
|
|
87
98
|
2. **React projects**
|
|
88
99
|
|
|
89
|
-
```
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
```ts
|
|
101
|
+
import { defineConfig } from 'oxlint'
|
|
102
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
103
|
+
import reactConfig from '@cocopalm/oxc-linter-config/react'
|
|
104
|
+
|
|
105
|
+
export default defineConfig({
|
|
106
|
+
extends: [commonConfig, reactConfig],
|
|
107
|
+
})
|
|
96
108
|
```
|
|
97
109
|
|
|
98
110
|
3. **Node.js projects**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
import { defineConfig } from 'oxlint'
|
|
114
|
+
import commonConfig from '@cocopalm/oxc-linter-config/common'
|
|
115
|
+
import nodeConfig from '@cocopalm/oxc-linter-config/node'
|
|
116
|
+
|
|
117
|
+
export default defineConfig({
|
|
118
|
+
extends: [commonConfig, nodeConfig],
|
|
119
|
+
})
|
|
106
120
|
```
|
|
107
121
|
|
|
108
122
|
<br />
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//#region src/common.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
plugins: ("eslint" | "promise")[];
|
|
4
|
+
rules: {
|
|
5
|
+
'eslint/no-unused-vars': (string | {
|
|
6
|
+
argsIgnorePattern: string;
|
|
7
|
+
ignoreRestSiblings: boolean;
|
|
8
|
+
})[];
|
|
9
|
+
'eslint/no-useless-catch': "warn";
|
|
10
|
+
'eslint/valid-typeof': (string | {
|
|
11
|
+
requireStringLiterals: boolean;
|
|
12
|
+
})[];
|
|
13
|
+
'eslint/array-callback-return': (string | {
|
|
14
|
+
allowImplicit: boolean;
|
|
15
|
+
checkForEach: boolean;
|
|
16
|
+
})[];
|
|
17
|
+
'eslint/block-scoped-var': "warn";
|
|
18
|
+
'eslint/curly': string[];
|
|
19
|
+
'eslint/default-case-last': "error";
|
|
20
|
+
'eslint/eqeqeq': (string | {
|
|
21
|
+
null: string;
|
|
22
|
+
})[];
|
|
23
|
+
'eslint/func-style': (string | {
|
|
24
|
+
allowArrowFunctions: boolean;
|
|
25
|
+
})[];
|
|
26
|
+
'eslint/max-depth': (string | {
|
|
27
|
+
max: number;
|
|
28
|
+
})[];
|
|
29
|
+
'eslint/no-console': (string | {
|
|
30
|
+
allow: string[];
|
|
31
|
+
})[];
|
|
32
|
+
'eslint/no-duplicate-imports': (string | {
|
|
33
|
+
allowSeparateTypeImports: boolean;
|
|
34
|
+
})[];
|
|
35
|
+
'eslint/no-plusplus': "error";
|
|
36
|
+
'eslint/no-var': "error";
|
|
37
|
+
'eslint/prefer-rest-params': "error";
|
|
38
|
+
'eslint/prefer-spread': "error";
|
|
39
|
+
'eslint/prefer-template': "error";
|
|
40
|
+
'eslint/require-await': "error";
|
|
41
|
+
'import/named': "off";
|
|
42
|
+
'import/default': "off";
|
|
43
|
+
'import/namespace': "off";
|
|
44
|
+
'import/no-namespace': "error";
|
|
45
|
+
'import/no-self-import': "error";
|
|
46
|
+
'import/first': "error";
|
|
47
|
+
'import/no-unassigned-import': (string | {
|
|
48
|
+
allow: string[];
|
|
49
|
+
})[];
|
|
50
|
+
'promise/catch-or-return': (string | {
|
|
51
|
+
allowFinally: boolean;
|
|
52
|
+
})[];
|
|
53
|
+
'promise/prefer-await-to-callbacks': "error";
|
|
54
|
+
'promise/prefer-await-to-then': "error";
|
|
55
|
+
'promise/no-multiple-resolved': "error";
|
|
56
|
+
'promise/spec-only': "warn";
|
|
57
|
+
};
|
|
58
|
+
overrides: {
|
|
59
|
+
files: string[];
|
|
60
|
+
plugins: "typescript"[];
|
|
61
|
+
rules: {
|
|
62
|
+
'eslint/no-unused-vars': "off";
|
|
63
|
+
'typescript/no-unused-vars': (string | {
|
|
64
|
+
argsIgnorePattern: string;
|
|
65
|
+
ignoreRestSiblings: boolean;
|
|
66
|
+
})[];
|
|
67
|
+
'typescript/array-type': (string | {
|
|
68
|
+
default: string;
|
|
69
|
+
})[];
|
|
70
|
+
'typescript/consistent-indexed-object-style': string[];
|
|
71
|
+
'typescript/consistent-type-definitions': string[];
|
|
72
|
+
'typescript/consistent-type-imports': (string | {
|
|
73
|
+
prefer: string;
|
|
74
|
+
fixStyle: string;
|
|
75
|
+
})[];
|
|
76
|
+
'typescript/no-import-type-side-effects': "error";
|
|
77
|
+
'typescript/prefer-enum-initializers': "error";
|
|
78
|
+
'typescript/prefer-function-type': "error";
|
|
79
|
+
'typescript/prefer-literal-enum-member': "error";
|
|
80
|
+
};
|
|
81
|
+
}[];
|
|
82
|
+
ignorePatterns: string[];
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { _default as default };
|
package/dist/common.mjs
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
//#region src/common.ts
|
|
3
|
+
var common_default = defineConfig({
|
|
4
|
+
plugins: ["eslint", "promise"],
|
|
5
|
+
rules: {
|
|
6
|
+
"eslint/no-unused-vars": ["error", {
|
|
7
|
+
argsIgnorePattern: "^_+$",
|
|
8
|
+
ignoreRestSiblings: true
|
|
9
|
+
}],
|
|
10
|
+
"eslint/no-useless-catch": "warn",
|
|
11
|
+
"eslint/valid-typeof": ["error", { requireStringLiterals: true }],
|
|
12
|
+
"eslint/array-callback-return": ["error", {
|
|
13
|
+
allowImplicit: true,
|
|
14
|
+
checkForEach: true
|
|
15
|
+
}],
|
|
16
|
+
"eslint/block-scoped-var": "warn",
|
|
17
|
+
"eslint/curly": ["error", "all"],
|
|
18
|
+
"eslint/default-case-last": "error",
|
|
19
|
+
"eslint/eqeqeq": [
|
|
20
|
+
"error",
|
|
21
|
+
"always",
|
|
22
|
+
{ null: "ignore" }
|
|
23
|
+
],
|
|
24
|
+
"eslint/func-style": [
|
|
25
|
+
"error",
|
|
26
|
+
"declaration",
|
|
27
|
+
{ allowArrowFunctions: true }
|
|
28
|
+
],
|
|
29
|
+
"eslint/max-depth": ["warn", { max: 4 }],
|
|
30
|
+
"eslint/no-console": ["error", { allow: [
|
|
31
|
+
"info",
|
|
32
|
+
"warn",
|
|
33
|
+
"error"
|
|
34
|
+
] }],
|
|
35
|
+
"eslint/no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
36
|
+
"eslint/no-plusplus": "error",
|
|
37
|
+
"eslint/no-var": "error",
|
|
38
|
+
"eslint/prefer-rest-params": "error",
|
|
39
|
+
"eslint/prefer-spread": "error",
|
|
40
|
+
"eslint/prefer-template": "error",
|
|
41
|
+
"eslint/require-await": "error",
|
|
42
|
+
"import/named": "off",
|
|
43
|
+
"import/default": "off",
|
|
44
|
+
"import/namespace": "off",
|
|
45
|
+
"import/no-namespace": "error",
|
|
46
|
+
"import/no-self-import": "error",
|
|
47
|
+
"import/first": "error",
|
|
48
|
+
"import/no-unassigned-import": ["error", { allow: ["**/*.css", "**/*.scss"] }],
|
|
49
|
+
"promise/catch-or-return": ["error", { allowFinally: true }],
|
|
50
|
+
"promise/prefer-await-to-callbacks": "error",
|
|
51
|
+
"promise/prefer-await-to-then": "error",
|
|
52
|
+
"promise/no-multiple-resolved": "error",
|
|
53
|
+
"promise/spec-only": "warn"
|
|
54
|
+
},
|
|
55
|
+
overrides: [{
|
|
56
|
+
files: ["*.ts", "*.tsx"],
|
|
57
|
+
plugins: ["typescript"],
|
|
58
|
+
rules: {
|
|
59
|
+
"eslint/no-unused-vars": "off",
|
|
60
|
+
"typescript/no-unused-vars": ["error", {
|
|
61
|
+
argsIgnorePattern: "^_+$",
|
|
62
|
+
ignoreRestSiblings: true
|
|
63
|
+
}],
|
|
64
|
+
"typescript/array-type": ["error", { default: "array" }],
|
|
65
|
+
"typescript/consistent-indexed-object-style": ["error", "record"],
|
|
66
|
+
"typescript/consistent-type-definitions": ["error", "interface"],
|
|
67
|
+
"typescript/consistent-type-imports": ["error", {
|
|
68
|
+
prefer: "type-imports",
|
|
69
|
+
fixStyle: "separate-type-imports"
|
|
70
|
+
}],
|
|
71
|
+
"typescript/no-import-type-side-effects": "error",
|
|
72
|
+
"typescript/prefer-enum-initializers": "error",
|
|
73
|
+
"typescript/prefer-function-type": "error",
|
|
74
|
+
"typescript/prefer-literal-enum-member": "error"
|
|
75
|
+
}
|
|
76
|
+
}],
|
|
77
|
+
ignorePatterns: [
|
|
78
|
+
"node_modules/**",
|
|
79
|
+
"out/**",
|
|
80
|
+
"build/**",
|
|
81
|
+
"dist/**",
|
|
82
|
+
".next/**",
|
|
83
|
+
"next-env.d.ts"
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { common_default as default };
|
package/dist/node.d.mts
ADDED
package/dist/node.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
//#region src/node.ts
|
|
3
|
+
var node_default = defineConfig({
|
|
4
|
+
plugins: ["node"],
|
|
5
|
+
ignorePatterns: [
|
|
6
|
+
"node_modules/**",
|
|
7
|
+
"out/**",
|
|
8
|
+
"build/**",
|
|
9
|
+
"dist/**",
|
|
10
|
+
".next/**",
|
|
11
|
+
"next-env.d.ts"
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { node_default as default };
|
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/react.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
plugins: ("react" | "jsx-a11y" | "nextjs")[];
|
|
4
|
+
rules: {
|
|
5
|
+
'react/button-has-type': "warn";
|
|
6
|
+
'react/forward-ref-uses-ref': "error";
|
|
7
|
+
'react/jsx-boolean-value': (string | {
|
|
8
|
+
assumeUndefinedIsFalse: boolean;
|
|
9
|
+
})[];
|
|
10
|
+
'react/jsx-handler-names': (string | {
|
|
11
|
+
eventHandlerPrefix: string;
|
|
12
|
+
eventHandlerPropPrefix: string;
|
|
13
|
+
})[];
|
|
14
|
+
'react/jsx-no-useless-fragment': (string | {
|
|
15
|
+
allowExpressions: boolean;
|
|
16
|
+
})[];
|
|
17
|
+
'react/jsx-pascal-case': "error";
|
|
18
|
+
'react/no-namespace': "error";
|
|
19
|
+
'react/self-closing-comp': (string | {
|
|
20
|
+
component: boolean;
|
|
21
|
+
html: boolean;
|
|
22
|
+
})[];
|
|
23
|
+
'react/style-prop-object': "error";
|
|
24
|
+
'react/void-dom-elements-no-children': "error";
|
|
25
|
+
'jsx_a11y/click-events-have-key-events': "off";
|
|
26
|
+
'jsx_a11y/img-redundant-alt': "warn";
|
|
27
|
+
'jsx_a11y/media-has-caption': "off";
|
|
28
|
+
'jsx_a11y/mouse-events-have-key-events': "off";
|
|
29
|
+
'jsx_a11y/no-noninteractive-tabindex': "warn";
|
|
30
|
+
'jsx_a11y/no-redundant-roles': "warn";
|
|
31
|
+
'jsx_a11y/role-has-required-aria-props': "warn";
|
|
32
|
+
'jsx_a11y/role-supports-aria-props': "warn";
|
|
33
|
+
'jsx_a11y/tabindex-no-positive': "warn";
|
|
34
|
+
'jsx_a11y/prefer-tag-over-role': "warn";
|
|
35
|
+
};
|
|
36
|
+
ignorePatterns: string[];
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { _default as default };
|
package/dist/react.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
//#region src/react.ts
|
|
3
|
+
var react_default = defineConfig({
|
|
4
|
+
plugins: [
|
|
5
|
+
"react",
|
|
6
|
+
"nextjs",
|
|
7
|
+
"jsx-a11y"
|
|
8
|
+
],
|
|
9
|
+
rules: {
|
|
10
|
+
"react/button-has-type": "warn",
|
|
11
|
+
"react/forward-ref-uses-ref": "error",
|
|
12
|
+
"react/jsx-boolean-value": [
|
|
13
|
+
"warn",
|
|
14
|
+
"never",
|
|
15
|
+
{ assumeUndefinedIsFalse: true }
|
|
16
|
+
],
|
|
17
|
+
"react/jsx-handler-names": ["warn", {
|
|
18
|
+
eventHandlerPrefix: "handle",
|
|
19
|
+
eventHandlerPropPrefix: "on"
|
|
20
|
+
}],
|
|
21
|
+
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
|
|
22
|
+
"react/jsx-pascal-case": "error",
|
|
23
|
+
"react/no-namespace": "error",
|
|
24
|
+
"react/self-closing-comp": ["error", {
|
|
25
|
+
component: true,
|
|
26
|
+
html: true
|
|
27
|
+
}],
|
|
28
|
+
"react/style-prop-object": "error",
|
|
29
|
+
"react/void-dom-elements-no-children": "error",
|
|
30
|
+
"jsx_a11y/click-events-have-key-events": "off",
|
|
31
|
+
"jsx_a11y/img-redundant-alt": "warn",
|
|
32
|
+
"jsx_a11y/media-has-caption": "off",
|
|
33
|
+
"jsx_a11y/mouse-events-have-key-events": "off",
|
|
34
|
+
"jsx_a11y/no-noninteractive-tabindex": "warn",
|
|
35
|
+
"jsx_a11y/no-redundant-roles": "warn",
|
|
36
|
+
"jsx_a11y/role-has-required-aria-props": "warn",
|
|
37
|
+
"jsx_a11y/role-supports-aria-props": "warn",
|
|
38
|
+
"jsx_a11y/tabindex-no-positive": "warn",
|
|
39
|
+
"jsx_a11y/prefer-tag-over-role": "warn"
|
|
40
|
+
},
|
|
41
|
+
ignorePatterns: [
|
|
42
|
+
"node_modules/**",
|
|
43
|
+
"out/**",
|
|
44
|
+
"build/**",
|
|
45
|
+
"dist/**",
|
|
46
|
+
".next/**",
|
|
47
|
+
"next-env.d.ts"
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { react_default as default };
|
package/package.json
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocopalm/oxc-linter-config",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "oxc linter configuration",
|
|
5
5
|
"author": "puffcocos",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "./
|
|
8
|
+
"main": "./dist/common.mjs",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./common": {
|
|
11
|
+
"import": "./dist/common.mjs",
|
|
12
|
+
"types": "./dist/common.d.mts"
|
|
13
|
+
},
|
|
14
|
+
"./react": {
|
|
15
|
+
"import": "./dist/react.mjs",
|
|
16
|
+
"types": "./dist/react.d.mts"
|
|
17
|
+
},
|
|
18
|
+
"./node": {
|
|
19
|
+
"import": "./dist/node.mjs",
|
|
20
|
+
"types": "./dist/node.d.mts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
9
23
|
"files": [
|
|
10
|
-
"
|
|
11
|
-
"oxlint-react.json",
|
|
12
|
-
"oxlint-node.json"
|
|
24
|
+
"dist"
|
|
13
25
|
],
|
|
14
26
|
"keywords": [
|
|
15
27
|
"oxc",
|
|
@@ -25,9 +37,14 @@
|
|
|
25
37
|
"provenance": true
|
|
26
38
|
},
|
|
27
39
|
"devDependencies": {
|
|
28
|
-
"oxlint": "^1.
|
|
40
|
+
"oxlint": "^1.57.0",
|
|
41
|
+
"tsdown": "^0.21.6",
|
|
42
|
+
"typescript": "^6.0.2"
|
|
29
43
|
},
|
|
30
44
|
"peerDependencies": {
|
|
31
|
-
"oxlint": "^1.
|
|
45
|
+
"oxlint": "^1.57.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsdown"
|
|
32
49
|
}
|
|
33
50
|
}
|
package/oxlint-common.json
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": ["eslint", "promise"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_+$", "ignoreRestSiblings": true }],
|
|
5
|
-
"eslint/no-useless-catch": "warn",
|
|
6
|
-
"eslint/valid-typeof": ["error", { "requireStringLiterals": true }],
|
|
7
|
-
"eslint/array-callback-return": ["error", { "allowImplicit": true, "checkForEach": true }],
|
|
8
|
-
"eslint/block-scoped-var": "warn",
|
|
9
|
-
"eslint/curly": ["error", "all"],
|
|
10
|
-
"eslint/default-case-last": "error",
|
|
11
|
-
"eslint/eqeqeq": ["error", "always", { "null": "ignore" }],
|
|
12
|
-
"eslint/func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
|
13
|
-
"eslint/max-depth": ["warn", { "max": 4 }],
|
|
14
|
-
"eslint/no-console": ["error", { "allow": ["info", "warn", "error"] }],
|
|
15
|
-
"eslint/no-duplicate-imports": ["error", { "allowSeparateTypeImports": true }],
|
|
16
|
-
"eslint/no-plusplus": "error",
|
|
17
|
-
"eslint/no-var": "error",
|
|
18
|
-
"eslint/prefer-rest-params": "error",
|
|
19
|
-
"eslint/prefer-spread": "error",
|
|
20
|
-
"eslint/prefer-template": "error",
|
|
21
|
-
"eslint/require-await": "error",
|
|
22
|
-
"import/named": "off",
|
|
23
|
-
"import/default": "off",
|
|
24
|
-
"import/namespace": "off",
|
|
25
|
-
"import/no-namespace": "error",
|
|
26
|
-
"import/no-self-import": "error",
|
|
27
|
-
"import/first": "error",
|
|
28
|
-
"import/no-unassigned-import": ["error", { "allow": ["**/*.css", "**/*.scss"] }],
|
|
29
|
-
"promise/catch-or-return": ["error", { "allowFinally": true }],
|
|
30
|
-
"promise/prefer-await-to-callbacks": "error",
|
|
31
|
-
"promise/prefer-await-to-then": "error",
|
|
32
|
-
"promise/no-multiple-resolved": "error",
|
|
33
|
-
"promise/spec-only": "warn"
|
|
34
|
-
},
|
|
35
|
-
"overrides": [
|
|
36
|
-
{
|
|
37
|
-
"files": ["*.ts", "*.tsx"],
|
|
38
|
-
"plugins": ["typescript"],
|
|
39
|
-
"rules": {
|
|
40
|
-
"eslint/no-unused-vars": "off",
|
|
41
|
-
"typescript/no-unused-vars": [
|
|
42
|
-
"error",
|
|
43
|
-
{ "argsIgnorePattern": "^_+$", "ignoreRestSiblings": true }
|
|
44
|
-
],
|
|
45
|
-
"typescript/array-type": ["error", { "default": "array" }],
|
|
46
|
-
"typescript/consistent-indexed-object-style": ["error", "record"],
|
|
47
|
-
"typescript/consistent-type-definitions": ["error", "interface"],
|
|
48
|
-
"typescript/consistent-type-imports": [
|
|
49
|
-
"error",
|
|
50
|
-
{ "prefer": "type-imports", "fixStyle": "separate-type-imports" }
|
|
51
|
-
],
|
|
52
|
-
"typescript/no-import-type-side-effects": "error",
|
|
53
|
-
"typescript/prefer-enum-initializers": "error",
|
|
54
|
-
"typescript/prefer-function-type": "error",
|
|
55
|
-
"typescript/prefer-literal-enum-member": "error"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"ignorePatterns": [
|
|
60
|
-
"node_modules/**",
|
|
61
|
-
"out/**",
|
|
62
|
-
"build/**",
|
|
63
|
-
"dist/**",
|
|
64
|
-
".next/**",
|
|
65
|
-
"next-env.d.ts"
|
|
66
|
-
]
|
|
67
|
-
}
|
package/oxlint-node.json
DELETED
package/oxlint-react.json
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": ["react", "nextjs", "jsx-a11y"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"react/button-has-type": "warn",
|
|
5
|
-
"react/forward-ref-uses-ref": "error",
|
|
6
|
-
"react/jsx-boolean-value": ["warn", "never", { "assumeUndefinedIsFalse": true }],
|
|
7
|
-
"react/jsx-handler-names": [
|
|
8
|
-
"warn",
|
|
9
|
-
{
|
|
10
|
-
"eventHandlerPrefix": "handle",
|
|
11
|
-
"eventHandlerPropPrefix": "on"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"react/jsx-no-useless-fragment": ["warn", { "allowExpressions": true }],
|
|
15
|
-
"react/jsx-pascal-case": "error",
|
|
16
|
-
"react/no-namespace": "error",
|
|
17
|
-
"react/self-closing-comp": [
|
|
18
|
-
"error",
|
|
19
|
-
{
|
|
20
|
-
"component": true,
|
|
21
|
-
"html": true
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"react/style-prop-object": "error",
|
|
25
|
-
"react/void-dom-elements-no-children": "error",
|
|
26
|
-
"jsx_a11y/click-events-have-key-events": "off",
|
|
27
|
-
"jsx_a11y/img-redundant-alt": "warn",
|
|
28
|
-
"jsx_a11y/media-has-caption": "off",
|
|
29
|
-
"jsx_a11y/mouse-events-have-key-events": "off",
|
|
30
|
-
"jsx_a11y/no-noninteractive-tabindex": "warn",
|
|
31
|
-
"jsx_a11y/no-redundant-roles": "warn",
|
|
32
|
-
"jsx_a11y/role-has-required-aria-props": "warn",
|
|
33
|
-
"jsx_a11y/role-supports-aria-props": "warn",
|
|
34
|
-
"jsx_a11y/tabindex-no-positive": "warn",
|
|
35
|
-
"jsx_a11y/prefer-tag-over-role": "warn"
|
|
36
|
-
},
|
|
37
|
-
"ignorePatterns": [
|
|
38
|
-
"node_modules/**",
|
|
39
|
-
"out/**",
|
|
40
|
-
"build/**",
|
|
41
|
-
"dist/**",
|
|
42
|
-
".next/**",
|
|
43
|
-
"next-env.d.ts"
|
|
44
|
-
]
|
|
45
|
-
}
|