@kasoa/oxlint-config 0.0.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 +80 -0
- package/dist/eslint.config.d.ts +2 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +1 -0
- package/dist/oxlint.config.d.ts +2 -0
- package/dist/oxlint.config.d.ts.map +1 -0
- package/dist/oxlint.config.js +1 -0
- package/dist/src/base/index.d.ts +43 -0
- package/dist/src/base/index.d.ts.map +1 -0
- package/dist/src/base/index.js +35 -0
- package/dist/src/node/index.d.ts +60 -0
- package/dist/src/node/index.d.ts.map +1 -0
- package/dist/src/node/index.js +26 -0
- package/dist/src/react/index.d.ts +62 -0
- package/dist/src/react/index.d.ts.map +1 -0
- package/dist/src/react/index.js +28 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @kasoa/oxlint-config
|
|
2
|
+
|
|
3
|
+
Kasoa's Oxlint config
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install Oxlint, typed linting support, and the config:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add -D @kasoa/oxlint-config oxlint oxlint-tsgolint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Note**: Requires Node.js >=24 and a TypeScript setup.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Import the desired config in your `oxlint.config.ts`. Extend it with project-specific overrides as needed.
|
|
18
|
+
|
|
19
|
+
### React Projects
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
export { react as default } from "@kasoa/oxlint-config/react";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Node.js Projects
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
export { node as default } from "@kasoa/oxlint-config/node";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Base Config
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
export { base as default } from "@kasoa/oxlint-config/base";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Custom Overrides
|
|
38
|
+
|
|
39
|
+
Use `defineConfig` to add project-specific rules:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { node } from "@kasoa/oxlint-config/node";
|
|
43
|
+
import { defineConfig } from "oxlint";
|
|
44
|
+
|
|
45
|
+
export default defineConfig({
|
|
46
|
+
...node,
|
|
47
|
+
rules: {
|
|
48
|
+
...node.rules,
|
|
49
|
+
"no-console": "warn",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Suggested Scripts
|
|
55
|
+
|
|
56
|
+
Type-aware linting is expected by default:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"scripts": {
|
|
61
|
+
"lint": "oxlint --type-aware --fix .",
|
|
62
|
+
"format": "oxfmt ."
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Configurations
|
|
68
|
+
|
|
69
|
+
- **`base`**: Core rules for TypeScript-first code quality.
|
|
70
|
+
- **`node`**: Extends `base` with Node.js, import cycle, and test rules.
|
|
71
|
+
- **`react`**: Extends `base` with React, JSX a11y, import cycle, and test rules.
|
|
72
|
+
|
|
73
|
+
## Author
|
|
74
|
+
|
|
75
|
+
Emmanuel Chucks
|
|
76
|
+
https://github.com/emmanuelchucks
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { node as default } from "@kasoa/eslint-config/node";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxlint.config.d.ts","sourceRoot":"","sources":["../oxlint.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { node as default } from "./dist/src/node/index.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const base: {
|
|
2
|
+
plugins: ("import" | "oxc" | "typescript" | "unicorn" | "vitest")[];
|
|
3
|
+
rules: {
|
|
4
|
+
"default-case-last": "error";
|
|
5
|
+
eqeqeq: "error";
|
|
6
|
+
"grouped-accessor-pairs": string[];
|
|
7
|
+
"max-params": "warn";
|
|
8
|
+
"no-alert": "error";
|
|
9
|
+
"no-console": (string | {
|
|
10
|
+
allow: string[];
|
|
11
|
+
})[];
|
|
12
|
+
"no-constructor-return": "error";
|
|
13
|
+
"no-else-return": (string | {
|
|
14
|
+
allowElseIf: boolean;
|
|
15
|
+
})[];
|
|
16
|
+
"no-param-reassign": (string | {
|
|
17
|
+
props: boolean;
|
|
18
|
+
})[];
|
|
19
|
+
"no-unneeded-ternary": "error";
|
|
20
|
+
"no-useless-return": "error";
|
|
21
|
+
"prefer-template": "error";
|
|
22
|
+
"typescript/ban-ts-comment": (string | {
|
|
23
|
+
minimumDescriptionLength: number;
|
|
24
|
+
})[];
|
|
25
|
+
"typescript/consistent-type-imports": "error";
|
|
26
|
+
"typescript/no-explicit-any": "warn";
|
|
27
|
+
"typescript/no-floating-promises": "error";
|
|
28
|
+
"typescript/no-misused-promises": "error";
|
|
29
|
+
"typescript/no-unsafe-assignment": "warn";
|
|
30
|
+
"typescript/no-unsafe-call": "warn";
|
|
31
|
+
"typescript/no-unsafe-member-access": "warn";
|
|
32
|
+
"typescript/no-unsafe-return": "warn";
|
|
33
|
+
"typescript/no-require-imports": "off";
|
|
34
|
+
"typescript/require-array-sort-compare": "error";
|
|
35
|
+
"typescript/switch-exhaustiveness-check": "error";
|
|
36
|
+
"typescript/await-thenable": "error";
|
|
37
|
+
"getter-return": "error";
|
|
38
|
+
"no-undef": "error";
|
|
39
|
+
"no-unreachable": "error";
|
|
40
|
+
"typescript/prefer-optional-chain": "warn";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCf,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
export const base = defineConfig({
|
|
3
|
+
plugins: ["typescript", "unicorn", "oxc", "import", "vitest"],
|
|
4
|
+
rules: {
|
|
5
|
+
"default-case-last": "error",
|
|
6
|
+
eqeqeq: "error",
|
|
7
|
+
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
8
|
+
"max-params": "warn",
|
|
9
|
+
"no-alert": "error",
|
|
10
|
+
"no-console": ["warn", { allow: ["info", "warn", "error"] }],
|
|
11
|
+
"no-constructor-return": "error",
|
|
12
|
+
"no-else-return": ["error", { allowElseIf: false }],
|
|
13
|
+
"no-param-reassign": ["error", { props: false }],
|
|
14
|
+
"no-unneeded-ternary": "error",
|
|
15
|
+
"no-useless-return": "error",
|
|
16
|
+
"prefer-template": "error",
|
|
17
|
+
"typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
|
|
18
|
+
"typescript/consistent-type-imports": "error",
|
|
19
|
+
"typescript/no-explicit-any": "warn",
|
|
20
|
+
"typescript/no-floating-promises": "error",
|
|
21
|
+
"typescript/no-misused-promises": "error",
|
|
22
|
+
"typescript/no-unsafe-assignment": "warn",
|
|
23
|
+
"typescript/no-unsafe-call": "warn",
|
|
24
|
+
"typescript/no-unsafe-member-access": "warn",
|
|
25
|
+
"typescript/no-unsafe-return": "warn",
|
|
26
|
+
"typescript/no-require-imports": "off",
|
|
27
|
+
"typescript/require-array-sort-compare": "error",
|
|
28
|
+
"typescript/switch-exhaustiveness-check": "error",
|
|
29
|
+
"typescript/await-thenable": "error",
|
|
30
|
+
"getter-return": "error",
|
|
31
|
+
"no-undef": "error",
|
|
32
|
+
"no-unreachable": "error",
|
|
33
|
+
"typescript/prefer-optional-chain": "warn",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const node: {
|
|
2
|
+
plugins: ("import" | "node" | "oxc" | "typescript" | "unicorn" | "vitest")[];
|
|
3
|
+
env: {
|
|
4
|
+
node: true;
|
|
5
|
+
vitest: true;
|
|
6
|
+
};
|
|
7
|
+
rules: {
|
|
8
|
+
"default-case-last": "error";
|
|
9
|
+
eqeqeq: "error";
|
|
10
|
+
"grouped-accessor-pairs": string[];
|
|
11
|
+
"max-params": "warn";
|
|
12
|
+
"no-alert": "error";
|
|
13
|
+
"no-console": (string | {
|
|
14
|
+
allow: string[];
|
|
15
|
+
})[];
|
|
16
|
+
"no-constructor-return": "error";
|
|
17
|
+
"no-else-return": (string | {
|
|
18
|
+
allowElseIf: boolean;
|
|
19
|
+
})[];
|
|
20
|
+
"no-param-reassign": (string | {
|
|
21
|
+
props: boolean;
|
|
22
|
+
})[];
|
|
23
|
+
"no-unneeded-ternary": "error";
|
|
24
|
+
"no-useless-return": "error";
|
|
25
|
+
"prefer-template": "error";
|
|
26
|
+
"typescript/ban-ts-comment": (string | {
|
|
27
|
+
minimumDescriptionLength: number;
|
|
28
|
+
})[];
|
|
29
|
+
"typescript/consistent-type-imports": "error";
|
|
30
|
+
"typescript/no-explicit-any": "warn";
|
|
31
|
+
"typescript/no-floating-promises": "error";
|
|
32
|
+
"typescript/no-misused-promises": "error";
|
|
33
|
+
"typescript/no-unsafe-assignment": "warn";
|
|
34
|
+
"typescript/no-unsafe-call": "warn";
|
|
35
|
+
"typescript/no-unsafe-member-access": "warn";
|
|
36
|
+
"typescript/no-unsafe-return": "warn";
|
|
37
|
+
"typescript/no-require-imports": "off";
|
|
38
|
+
"typescript/require-array-sort-compare": "error";
|
|
39
|
+
"typescript/switch-exhaustiveness-check": "error";
|
|
40
|
+
"typescript/await-thenable": "error";
|
|
41
|
+
"getter-return": "error";
|
|
42
|
+
"no-undef": "error";
|
|
43
|
+
"no-unreachable": "error";
|
|
44
|
+
"typescript/prefer-optional-chain": "warn";
|
|
45
|
+
"import/no-cycle": "error";
|
|
46
|
+
"node/no-exports-assign": "error";
|
|
47
|
+
"vitest/no-focused-tests": "error";
|
|
48
|
+
"vitest/no-disabled-tests": "error";
|
|
49
|
+
"vitest/no-standalone-expect": "error";
|
|
50
|
+
};
|
|
51
|
+
overrides: {
|
|
52
|
+
files: string[];
|
|
53
|
+
rules: {
|
|
54
|
+
"vitest/max-nested-describe": (string | {
|
|
55
|
+
max: number;
|
|
56
|
+
})[];
|
|
57
|
+
};
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
import { base } from "../base/index.js";
|
|
3
|
+
export const node = defineConfig({
|
|
4
|
+
...base,
|
|
5
|
+
plugins: [...base.plugins, "node"],
|
|
6
|
+
env: {
|
|
7
|
+
node: true,
|
|
8
|
+
vitest: true,
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
...base.rules,
|
|
12
|
+
"import/no-cycle": "error",
|
|
13
|
+
"node/no-exports-assign": "error",
|
|
14
|
+
"vitest/no-focused-tests": "error",
|
|
15
|
+
"vitest/no-disabled-tests": "error",
|
|
16
|
+
"vitest/no-standalone-expect": "error",
|
|
17
|
+
},
|
|
18
|
+
overrides: [
|
|
19
|
+
{
|
|
20
|
+
files: ["**/tests/**", "**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
|
|
21
|
+
rules: {
|
|
22
|
+
"vitest/max-nested-describe": ["warn", { max: 3 }],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const react: {
|
|
2
|
+
plugins: ("import" | "jsx-a11y" | "oxc" | "react" | "typescript" | "unicorn" | "vitest")[];
|
|
3
|
+
env: {
|
|
4
|
+
vitest: true;
|
|
5
|
+
};
|
|
6
|
+
rules: {
|
|
7
|
+
"default-case-last": "error";
|
|
8
|
+
eqeqeq: "error";
|
|
9
|
+
"grouped-accessor-pairs": string[];
|
|
10
|
+
"max-params": "warn";
|
|
11
|
+
"no-alert": "error";
|
|
12
|
+
"no-console": (string | {
|
|
13
|
+
allow: string[];
|
|
14
|
+
})[];
|
|
15
|
+
"no-constructor-return": "error";
|
|
16
|
+
"no-else-return": (string | {
|
|
17
|
+
allowElseIf: boolean;
|
|
18
|
+
})[];
|
|
19
|
+
"no-param-reassign": (string | {
|
|
20
|
+
props: boolean;
|
|
21
|
+
})[];
|
|
22
|
+
"no-unneeded-ternary": "error";
|
|
23
|
+
"no-useless-return": "error";
|
|
24
|
+
"prefer-template": "error";
|
|
25
|
+
"typescript/ban-ts-comment": (string | {
|
|
26
|
+
minimumDescriptionLength: number;
|
|
27
|
+
})[];
|
|
28
|
+
"typescript/consistent-type-imports": "error";
|
|
29
|
+
"typescript/no-explicit-any": "warn";
|
|
30
|
+
"typescript/no-floating-promises": "error";
|
|
31
|
+
"typescript/no-misused-promises": "error";
|
|
32
|
+
"typescript/no-unsafe-assignment": "warn";
|
|
33
|
+
"typescript/no-unsafe-call": "warn";
|
|
34
|
+
"typescript/no-unsafe-member-access": "warn";
|
|
35
|
+
"typescript/no-unsafe-return": "warn";
|
|
36
|
+
"typescript/no-require-imports": "off";
|
|
37
|
+
"typescript/require-array-sort-compare": "error";
|
|
38
|
+
"typescript/switch-exhaustiveness-check": "error";
|
|
39
|
+
"typescript/await-thenable": "error";
|
|
40
|
+
"getter-return": "error";
|
|
41
|
+
"no-undef": "error";
|
|
42
|
+
"no-unreachable": "error";
|
|
43
|
+
"typescript/prefer-optional-chain": "warn";
|
|
44
|
+
"import/no-cycle": "error";
|
|
45
|
+
"react/jsx-key": "error";
|
|
46
|
+
"react/no-direct-mutation-state": "error";
|
|
47
|
+
"react/no-unknown-property": "error";
|
|
48
|
+
"jsx-a11y/alt-text": "error";
|
|
49
|
+
"vitest/no-focused-tests": "error";
|
|
50
|
+
"vitest/no-disabled-tests": "error";
|
|
51
|
+
"vitest/no-standalone-expect": "error";
|
|
52
|
+
};
|
|
53
|
+
overrides: {
|
|
54
|
+
files: string[];
|
|
55
|
+
rules: {
|
|
56
|
+
"vitest/max-nested-describe": (string | {
|
|
57
|
+
max: number;
|
|
58
|
+
})[];
|
|
59
|
+
};
|
|
60
|
+
}[];
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBhB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
import { base } from "../base/index.js";
|
|
3
|
+
export const react = defineConfig({
|
|
4
|
+
...base,
|
|
5
|
+
plugins: [...base.plugins, "react", "jsx-a11y"],
|
|
6
|
+
env: {
|
|
7
|
+
vitest: true,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
...base.rules,
|
|
11
|
+
"import/no-cycle": "error",
|
|
12
|
+
"react/jsx-key": "error",
|
|
13
|
+
"react/no-direct-mutation-state": "error",
|
|
14
|
+
"react/no-unknown-property": "error",
|
|
15
|
+
"jsx-a11y/alt-text": "error",
|
|
16
|
+
"vitest/no-focused-tests": "error",
|
|
17
|
+
"vitest/no-disabled-tests": "error",
|
|
18
|
+
"vitest/no-standalone-expect": "error",
|
|
19
|
+
},
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
files: ["**/tests/**", "**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
|
|
23
|
+
rules: {
|
|
24
|
+
"vitest/max-nested-describe": ["warn", { max: 3 }],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kasoa/oxlint-config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Kasoa's Oxlint configurations",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"kasoa",
|
|
7
|
+
"linter",
|
|
8
|
+
"oxlint"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/emmanuelchucks/kasoa/tree/main/packages/oxlint-config",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/emmanuelchucks/kasoa/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Emmanuel Chucks",
|
|
17
|
+
"email": "hi@emmanuelchucks.com",
|
|
18
|
+
"url": "https://emmanuelchucks.com"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/emmanuelchucks/kasoa.git",
|
|
23
|
+
"directory": "packages/oxlint-config"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"exports": {
|
|
30
|
+
"./base": "./dist/src/base/index.js",
|
|
31
|
+
"./node": "./dist/src/node/index.js",
|
|
32
|
+
"./react": "./dist/src/react/index.js"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.2.3",
|
|
39
|
+
"@typescript/native-preview": "^7.0.0-dev.20260211.1",
|
|
40
|
+
"oxfmt": "^0.31.0",
|
|
41
|
+
"oxlint": "^1.46.0",
|
|
42
|
+
"oxlint-tsgolint": "^0.12.0",
|
|
43
|
+
"@kasoa/tsconfig": "0.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"oxlint": "^1.46.0",
|
|
47
|
+
"oxlint-tsgolint": "^0.12.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=24"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "tsgo --watch",
|
|
54
|
+
"build": "tsgo",
|
|
55
|
+
"lint": "oxlint --type-aware --fix .",
|
|
56
|
+
"format": "oxfmt .",
|
|
57
|
+
"typecheck": "tsgo --noEmit",
|
|
58
|
+
"test": "echo 'No tests'"
|
|
59
|
+
}
|
|
60
|
+
}
|