@scaleway/oxlint-config 0.1.17 → 0.2.1
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 +7 -24
- package/configs/index.json +47 -13
- package/package.json +6 -3
- package/configs/typescript.json +0 -42
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Scaleway's shareable configuration for [oxlint](https://oxc.rs/docs/guide/usage/linter.html).
|
|
4
4
|
|
|
5
|
+
> ⚠️ This package does not follow semver for now. Breaking can be introduced in minor/patch versions
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -14,7 +16,7 @@ Create a `.oxlintrc.json` file in your project root:
|
|
|
14
16
|
|
|
15
17
|
```json
|
|
16
18
|
{
|
|
17
|
-
"extends": ["
|
|
19
|
+
"extends": ["./node_modules/@scaleway/oxlint-config/configs/index.json"]
|
|
18
20
|
}
|
|
19
21
|
```
|
|
20
22
|
|
|
@@ -26,28 +28,10 @@ For React projects, extend the React configuration:
|
|
|
26
28
|
|
|
27
29
|
```json
|
|
28
30
|
{
|
|
29
|
-
"extends": [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#### TypeScript
|
|
34
|
-
|
|
35
|
-
For TypeScript projects, extend the TypeScript configuration:
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"extends": ["@scaleway/oxlint-config", "@scaleway/oxlint-config/typescript"]
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
#### Combined React and TypeScript
|
|
45
|
-
|
|
46
|
-
For React projects using TypeScript, extend both configurations:
|
|
47
|
-
|
|
48
|
-
```json
|
|
49
|
-
{
|
|
50
|
-
"extends": ["@scaleway/oxlint-config", "@scaleway/oxlint-config/react", "@scaleway/oxlint-config/typescript"]
|
|
31
|
+
"extends": [
|
|
32
|
+
"./node_modules/@scaleway/oxlint-config/configs/index.json",
|
|
33
|
+
"./node_modules/@scaleway/oxlint-config/configs/react.json"
|
|
34
|
+
]
|
|
51
35
|
}
|
|
52
36
|
```
|
|
53
37
|
|
|
@@ -55,7 +39,6 @@ For React projects using TypeScript, extend both configurations:
|
|
|
55
39
|
|
|
56
40
|
1. **Base rules** (`@scaleway/oxlint-config`): Core rules for all JavaScript/TypeScript projects
|
|
57
41
|
2. **React rules** (`@scaleway/oxlint-config/react`): React-specific rules
|
|
58
|
-
3. **TypeScript rules** (`@scaleway/oxlint-config/typescript`): TypeScript-specific rules
|
|
59
42
|
|
|
60
43
|
## License
|
|
61
44
|
|
package/configs/index.json
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "../node_modules/oxlint/configuration_schema.json",
|
|
3
|
-
"
|
|
4
|
-
"correctness": "deny",
|
|
5
|
-
"nursery": "off",
|
|
6
|
-
"pedantic": "deny",
|
|
7
|
-
"perf": "deny",
|
|
8
|
-
"restriction": "deny",
|
|
9
|
-
"style": "deny",
|
|
10
|
-
"suspicious": "deny"
|
|
11
|
-
},
|
|
12
|
-
"plugins": ["import", "node", "oxc", "unicorn"],
|
|
3
|
+
"plugins": ["typescript", "eslint", "import", "node", "oxc", "unicorn"],
|
|
13
4
|
"rules": {
|
|
14
5
|
"capitalized-comments": "off",
|
|
15
6
|
|
|
@@ -58,7 +49,7 @@
|
|
|
58
49
|
"eslint/no-dupe-else-if": "error",
|
|
59
50
|
"eslint/no-dupe-keys": "error",
|
|
60
51
|
"eslint/no-duplicate-case": "error",
|
|
61
|
-
"eslint/no-duplicate-imports": "
|
|
52
|
+
"eslint/no-duplicate-imports": ["error", { "allowSeparateTypeImports": true }],
|
|
62
53
|
"eslint/no-empty": "error",
|
|
63
54
|
"eslint/no-empty-character-class": "error",
|
|
64
55
|
"eslint/no-empty-function": "off",
|
|
@@ -131,7 +122,7 @@
|
|
|
131
122
|
"eslint/valid-typeof": "error",
|
|
132
123
|
"eslint/yoda": "error",
|
|
133
124
|
|
|
134
|
-
"import/consistent-type-specifier-style": "error",
|
|
125
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
135
126
|
"import/default": "error",
|
|
136
127
|
"import/export": "error",
|
|
137
128
|
"import/no-default-export": "off",
|
|
@@ -172,6 +163,49 @@
|
|
|
172
163
|
"unicorn/no-null": "off",
|
|
173
164
|
"unicorn/no-useless-undefined": "off",
|
|
174
165
|
"unicorn/prefer-object-from-entries": "off",
|
|
175
|
-
"unicorn/prefer-string-replace-all": "off"
|
|
166
|
+
"unicorn/prefer-string-replace-all": "off",
|
|
167
|
+
"unicorn/no-typeof-undefined": "error",
|
|
168
|
+
"unicorn/number-literal-case": "error",
|
|
169
|
+
|
|
170
|
+
// Typescript
|
|
171
|
+
"typescript/adjacent-overload-signatures": "error",
|
|
172
|
+
"typescript/array-type": "error",
|
|
173
|
+
"typescript/ban-ts-comment": "error",
|
|
174
|
+
"typescript/ban-tslint-comment": "off",
|
|
175
|
+
"typescript/ban-types": "error",
|
|
176
|
+
"typescript/consistent-indexed-object-style": "off",
|
|
177
|
+
"typescript/consistent-type-definitions": ["error", "type"],
|
|
178
|
+
"typescript/consistent-type-exports": "error",
|
|
179
|
+
"typescript/explicit-function-return-type": "off",
|
|
180
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
181
|
+
"typescript/no-duplicate-enum-values": "error",
|
|
182
|
+
"typescript/no-empty-interface": "error",
|
|
183
|
+
"typescript/no-explicit-any": "error",
|
|
184
|
+
"typescript/no-extra-non-null-assertion": "error",
|
|
185
|
+
"typescript/no-magic-numbers": "off",
|
|
186
|
+
"typescript/no-misused-new": "error",
|
|
187
|
+
"typescript/no-namespace": "error",
|
|
188
|
+
"typescript/no-non-null-asserted-optional-chain": "error",
|
|
189
|
+
"typescript/no-non-null-assertion": "off",
|
|
190
|
+
"typescript/no-this-alias": "error",
|
|
191
|
+
"typescript/no-unnecessary-type-arguments": "off",
|
|
192
|
+
"typescript/no-unnecessary-type-constraint": "error",
|
|
193
|
+
"typescript/no-unnecessary-type-conversion": "off",
|
|
194
|
+
"typescript/no-unsafe-declaration-merging": "error",
|
|
195
|
+
"typescript/no-unsafe-member-access": "error",
|
|
196
|
+
"typescript/no-var-requires": "error",
|
|
197
|
+
"typescript/prefer-as-const": "error",
|
|
198
|
+
"typescript/prefer-enum-initializers": "off",
|
|
199
|
+
"typescript/prefer-readonly-parameter-types": "off",
|
|
200
|
+
"typescript/prefer-for-of": "error",
|
|
201
|
+
"typescript/prefer-function-type": "off",
|
|
202
|
+
"typescript/prefer-literal-enum-member": "off",
|
|
203
|
+
"typescript/prefer-regexp-exec": "off",
|
|
204
|
+
"typescript/prefer-ts-expect-error": "off",
|
|
205
|
+
"typescript/triple-slash-reference": "error",
|
|
206
|
+
"typescript/no-unsafe-return": "error",
|
|
207
|
+
"typescript/no-unsafe-assignment": "error",
|
|
208
|
+
"typescript/no-unsafe-argument": "error",
|
|
209
|
+
"typescript/no-inferrable-types": "error"
|
|
176
210
|
}
|
|
177
211
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/oxlint-config",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Scaleway's shareable configuration for oxlint",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"oxlint-config",
|
|
10
10
|
"scaleway"
|
|
11
11
|
],
|
|
12
|
+
"homepage": "https://github.com/scaleway/scaleway-lib/tree/main/packages/oxlint-config",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/scaleway/scaleway-lib/issues"
|
|
15
|
+
},
|
|
12
16
|
"license": "MIT",
|
|
13
17
|
"repository": {
|
|
14
18
|
"type": "git",
|
|
@@ -21,14 +25,13 @@
|
|
|
21
25
|
"exports": {
|
|
22
26
|
".": "./configs/index.json",
|
|
23
27
|
"./react": "./configs/react.json",
|
|
24
|
-
"./typescript": "./configs/typescript.json",
|
|
25
28
|
"./vitest": "./configs/vitest.json"
|
|
26
29
|
},
|
|
27
30
|
"publishConfig": {
|
|
28
31
|
"access": "public"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"oxlint": "1.
|
|
34
|
+
"oxlint": "1.72.0"
|
|
32
35
|
},
|
|
33
36
|
"peerDependencies": {
|
|
34
37
|
"oxlint": ">=1.55.0"
|
package/configs/typescript.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../node_modules/oxlint/configuration_schema.json",
|
|
3
|
-
"extends": ["./index.json"],
|
|
4
|
-
"plugins": ["typescript"],
|
|
5
|
-
"rules": {
|
|
6
|
-
"typescript/adjacent-overload-signatures": "error",
|
|
7
|
-
"typescript/array-type": "error",
|
|
8
|
-
"typescript/ban-ts-comment": "error",
|
|
9
|
-
"typescript/ban-tslint-comment": "off",
|
|
10
|
-
"typescript/ban-types": "error",
|
|
11
|
-
"typescript/consistent-indexed-object-style": "off",
|
|
12
|
-
"typescript/consistent-type-definitions": ["error", "type"],
|
|
13
|
-
"typescript/consistent-type-exports": "error",
|
|
14
|
-
"typescript/explicit-function-return-type": "off",
|
|
15
|
-
"typescript/explicit-module-boundary-types": "off",
|
|
16
|
-
"typescript/no-duplicate-enum-values": "error",
|
|
17
|
-
"typescript/no-empty-interface": "error",
|
|
18
|
-
"typescript/no-explicit-any": "error",
|
|
19
|
-
"typescript/no-extra-non-null-assertion": "error",
|
|
20
|
-
"typescript/no-magic-numbers": "off",
|
|
21
|
-
"typescript/no-misused-new": "error",
|
|
22
|
-
"typescript/no-namespace": "error",
|
|
23
|
-
"typescript/no-non-null-asserted-optional-chain": "error",
|
|
24
|
-
"typescript/no-non-null-assertion": "off",
|
|
25
|
-
"typescript/no-this-alias": "error",
|
|
26
|
-
"typescript/no-unnecessary-type-arguments": "off",
|
|
27
|
-
"typescript/no-unnecessary-type-constraint": "error",
|
|
28
|
-
"typescript/no-unnecessary-type-conversion": "off",
|
|
29
|
-
"typescript/no-unsafe-declaration-merging": "error",
|
|
30
|
-
"typescript/no-unsafe-member-access": "error",
|
|
31
|
-
"typescript/no-var-requires": "error",
|
|
32
|
-
"typescript/prefer-as-const": "error",
|
|
33
|
-
"typescript/prefer-enum-initializers": "off",
|
|
34
|
-
"typescript/prefer-readonly-parameter-types": "off",
|
|
35
|
-
"typescript/prefer-for-of": "error",
|
|
36
|
-
"typescript/prefer-function-type": "off",
|
|
37
|
-
"typescript/prefer-literal-enum-member": "off",
|
|
38
|
-
"typescript/prefer-regexp-exec": "off",
|
|
39
|
-
"typescript/prefer-ts-expect-error": "off",
|
|
40
|
-
"typescript/triple-slash-reference": "error"
|
|
41
|
-
}
|
|
42
|
-
}
|