@kasoa/oxlint-config 0.0.6 → 0.0.8

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 CHANGED
@@ -15,7 +15,7 @@ pnpm add -D @kasoa/oxlint-config oxlint oxlint-tsgolint
15
15
  ## Usage
16
16
 
17
17
  Import the desired config in your `oxlint.config.ts`. Extend it with project-specific overrides as needed.
18
- The shared presets enable type-aware linting by default.
18
+ The shared presets are strict by default and designed for TypeScript-first projects.
19
19
 
20
20
  ### React Projects
21
21
 
@@ -23,10 +23,10 @@ The shared presets enable type-aware linting by default.
23
23
  export { react as default } from "@kasoa/oxlint-config/react";
24
24
  ```
25
25
 
26
- ### Node.js Projects
26
+ ### Server Projects
27
27
 
28
28
  ```ts
29
- export { node as default } from "@kasoa/oxlint-config/node";
29
+ export { server as default } from "@kasoa/oxlint-config/server";
30
30
  ```
31
31
 
32
32
  This preset is intended for server-side runtimes such as Node.js, Bun, and Workers-style server code.
@@ -42,13 +42,13 @@ export { base as default } from "@kasoa/oxlint-config/base";
42
42
  Use `defineConfig` to add project-specific rules:
43
43
 
44
44
  ```ts
45
- import { node } from "@kasoa/oxlint-config/node";
45
+ import { server } from "@kasoa/oxlint-config/server";
46
46
  import { defineConfig } from "oxlint";
47
47
 
48
48
  export default defineConfig({
49
- ...node,
49
+ ...server,
50
50
  rules: {
51
- ...node.rules,
51
+ ...server.rules,
52
52
  "no-console": "warn",
53
53
  },
54
54
  });
@@ -70,7 +70,7 @@ Type-aware linting is expected by default:
70
70
  ## Configurations
71
71
 
72
72
  - **`base`**: Core rules for TypeScript-first code quality, promise usage, import graph safety, and Vitest.
73
- - **`node`**: Extends `base` with server-runtime `node` plugin rules without assuming Node globals by default.
73
+ - **`server`**: Extends `base` with server-oriented lint rules.
74
74
  - **`react`**: Extends `base` with React, React performance, and JSX a11y rules.
75
75
 
76
76
  ## Author
@@ -0,0 +1,3 @@
1
+ import type { OxlintConfig } from "oxlint";
2
+ export declare const base: OxlintConfig;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,eAAO,MAAM,IAAI,EAAE,YAwHjB,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { defineConfig } from "oxlint";
2
+ export const base = defineConfig({
3
+ plugins: ["typescript", "unicorn", "oxc", "import", "promise", "vitest"],
4
+ options: {
5
+ typeAware: true,
6
+ },
7
+ categories: {
8
+ correctness: "error",
9
+ suspicious: "error",
10
+ pedantic: "error",
11
+ perf: "error",
12
+ style: "error",
13
+ },
14
+ rules: {
15
+ "func-style": "off",
16
+ "id-length": "off",
17
+ "capitalized-comments": "off",
18
+ "init-declarations": "off",
19
+ "no-magic-numbers": "off",
20
+ "no-ternary": "off",
21
+ "sort-imports": "off",
22
+ "sort-keys": "off",
23
+ "vars-on-top": "off",
24
+ complexity: ["error", { max: 10 }],
25
+ "default-case-last": "error",
26
+ eqeqeq: "error",
27
+ "getter-return": "error",
28
+ "grouped-accessor-pairs": ["error", "getBeforeSet"],
29
+ "max-classes-per-file": ["error", { max: 1 }],
30
+ "max-depth": ["error", { max: 3 }],
31
+ "max-lines-per-function": ["error", { max: 50, skipBlankLines: true, skipComments: true }],
32
+ "max-nested-callbacks": ["error", { max: 3 }],
33
+ "max-params": ["error", { max: 3 }],
34
+ "max-statements": ["error", { max: 10 }],
35
+ "no-console": ["error", { allow: ["info", "warn", "error"] }],
36
+ "no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
37
+ "no-param-reassign": ["error", { props: true }],
38
+ "no-undef": "error",
39
+ "no-unneeded-ternary": "error",
40
+ "no-unreachable": "error",
41
+ "no-useless-return": "error",
42
+ "prefer-template": "error",
43
+ "import/exports-last": "off",
44
+ "import/group-exports": "off",
45
+ "import/no-named-export": "off",
46
+ "import/no-namespace": "off",
47
+ "import/no-nodejs-modules": "off",
48
+ "import/prefer-default-export": "off",
49
+ "typescript/consistent-type-definitions": "off",
50
+ "import/no-cycle": "error",
51
+ "typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
52
+ "typescript/consistent-return": "error",
53
+ "typescript/consistent-type-exports": "error",
54
+ "typescript/consistent-type-imports": [
55
+ "error",
56
+ { prefer: "type-imports", fixStyle: "separate-type-imports" },
57
+ ],
58
+ "typescript/dot-notation": "error",
59
+ "typescript/no-confusing-void-expression": "error",
60
+ "typescript/no-explicit-any": "error",
61
+ "typescript/no-floating-promises": "error",
62
+ "typescript/no-misused-promises": "error",
63
+ "typescript/no-misused-spread": "error",
64
+ "typescript/no-require-imports": "error",
65
+ "typescript/no-unnecessary-condition": "error",
66
+ "typescript/no-unnecessary-qualifier": "error",
67
+ "typescript/no-unnecessary-type-arguments": "error",
68
+ "typescript/no-unnecessary-type-assertion": "error",
69
+ "typescript/no-unnecessary-type-parameters": "error",
70
+ "typescript/no-unsafe-argument": "error",
71
+ "typescript/no-unsafe-assignment": "error",
72
+ "typescript/no-unsafe-call": "error",
73
+ "typescript/no-unsafe-member-access": "error",
74
+ "typescript/no-unsafe-return": "error",
75
+ "typescript/no-useless-default-assignment": "error",
76
+ "typescript/non-nullable-type-assertion-style": "error",
77
+ "typescript/only-throw-error": "error",
78
+ "typescript/prefer-find": "error",
79
+ "typescript/prefer-nullish-coalescing": "error",
80
+ "typescript/prefer-optional-chain": "error",
81
+ "typescript/prefer-readonly": "error",
82
+ "typescript/prefer-readonly-parameter-types": "error",
83
+ "typescript/prefer-regexp-exec": "error",
84
+ "typescript/promise-function-async": "error",
85
+ "typescript/require-array-sort-compare": "error",
86
+ "typescript/restrict-plus-operands": "error",
87
+ "typescript/restrict-template-expressions": "error",
88
+ "typescript/return-await": "error",
89
+ "typescript/strict-boolean-expressions": "error",
90
+ "typescript/strict-void-return": "error",
91
+ "typescript/switch-exhaustiveness-check": "error",
92
+ "typescript/unbound-method": "error",
93
+ "typescript/use-unknown-in-catch-callback-variable": "error",
94
+ "unicorn/no-null": "off",
95
+ "unicorn/filename-case": ["error", { case: "kebabCase" }],
96
+ },
97
+ overrides: [
98
+ {
99
+ files: ["**/*.{cjs,cts}"],
100
+ env: {
101
+ node: true,
102
+ },
103
+ rules: {
104
+ "typescript/no-require-imports": "off",
105
+ },
106
+ },
107
+ {
108
+ files: ["**/tests/**", "**/__tests__/**", "**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"],
109
+ env: {
110
+ vitest: true,
111
+ },
112
+ rules: {
113
+ "max-lines-per-function": ["error", { max: 75, skipBlankLines: true, skipComments: true }],
114
+ "vitest/no-importing-vitest-globals": "off",
115
+ "vitest/max-nested-describe": ["error", { max: 3 }],
116
+ },
117
+ },
118
+ ],
119
+ });
@@ -0,0 +1,3 @@
1
+ import type { OxlintConfig } from "oxlint";
2
+ export declare const react: OxlintConfig;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,eAAO,MAAM,KAAK,EAAE,YA6BlB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from "oxlint";
2
+ import { base } from "../base/index.js";
3
+ export const react = defineConfig({
4
+ ...base,
5
+ plugins: [...(base.plugins ?? []), "react", "react-perf", "jsx-a11y"],
6
+ rules: {
7
+ ...base.rules,
8
+ "jsx-a11y/alt-text": "error",
9
+ "react/jsx-props-no-spreading": "off",
10
+ "react/exhaustive-deps": "error",
11
+ "react/jsx-key": "error",
12
+ "react/jsx-max-depth": ["error", { max: 4 }],
13
+ "react/jsx-no-constructed-context-values": "error",
14
+ "react/jsx-no-duplicate-props": "error",
15
+ "react/jsx-no-undef": "error",
16
+ "react/no-array-index-key": "error",
17
+ "react/no-children-prop": "error",
18
+ "react/no-danger-with-children": "error",
19
+ "react/no-direct-mutation-state": "error",
20
+ "react/no-find-dom-node": "error",
21
+ "react/no-string-refs": "error",
22
+ "react/no-unsafe": "error",
23
+ "react/no-unknown-property": "error",
24
+ "react/void-dom-elements-no-children": "error",
25
+ "react-perf/jsx-no-jsx-as-prop": "error",
26
+ "react-perf/jsx-no-new-array-as-prop": "error",
27
+ "react-perf/jsx-no-new-function-as-prop": "error",
28
+ "react-perf/jsx-no-new-object-as-prop": "error",
29
+ },
30
+ });
@@ -1,3 +1,4 @@
1
1
  import type { OxlintConfig } from "oxlint";
2
+ export declare const BASE_PLUGINS: readonly ["typescript", "unicorn", "oxc", "import", "promise"];
2
3
  export declare const base: OxlintConfig;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,eAAO,MAAM,IAAI,EAAE,YAwHjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,eAAO,MAAM,YAAY,gEAAiE,CAAC;AAE3F,eAAO,MAAM,IAAI,EAAE,YA8JjB,CAAC"}
@@ -1,7 +1,13 @@
1
1
  import { defineConfig } from "oxlint";
2
+ export const BASE_PLUGINS = ["typescript", "unicorn", "oxc", "import", "promise"];
2
3
  export const base = defineConfig({
3
- plugins: ["typescript", "unicorn", "oxc", "import", "promise", "vitest"],
4
+ plugins: [...BASE_PLUGINS],
5
+ env: {
6
+ serviceworker: true,
7
+ worker: true,
8
+ },
4
9
  options: {
10
+ reportUnusedDisableDirectives: "error",
5
11
  typeAware: true,
6
12
  },
7
13
  categories: {
@@ -15,6 +21,7 @@ export const base = defineConfig({
15
21
  "func-style": "off",
16
22
  "id-length": "off",
17
23
  "capitalized-comments": "off",
24
+ curly: ["error", "multi-line", "consistent"],
18
25
  "init-declarations": "off",
19
26
  "no-magic-numbers": "off",
20
27
  "no-ternary": "off",
@@ -29,12 +36,16 @@ export const base = defineConfig({
29
36
  "max-classes-per-file": ["error", { max: 1 }],
30
37
  "max-depth": ["error", { max: 3 }],
31
38
  "max-lines-per-function": ["error", { max: 50, skipBlankLines: true, skipComments: true }],
39
+ "import/no-unassigned-import": "off",
32
40
  "max-nested-callbacks": ["error", { max: 3 }],
33
41
  "max-params": ["error", { max: 3 }],
34
42
  "max-statements": ["error", { max: 10 }],
43
+ "no-alert": "error",
44
+ "no-bitwise": "error",
35
45
  "no-console": ["error", { allow: ["info", "warn", "error"] }],
36
46
  "no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
37
47
  "no-param-reassign": ["error", { props: true }],
48
+ "no-plusplus": "error",
38
49
  "no-undef": "error",
39
50
  "no-unneeded-ternary": "error",
40
51
  "no-unreachable": "error",
@@ -42,6 +53,7 @@ export const base = defineConfig({
42
53
  "prefer-template": "error",
43
54
  "import/exports-last": "off",
44
55
  "import/group-exports": "off",
56
+ "import/no-anonymous-default-export": "off",
45
57
  "import/no-named-export": "off",
46
58
  "import/no-namespace": "off",
47
59
  "import/no-nodejs-modules": "off",
@@ -57,10 +69,13 @@ export const base = defineConfig({
57
69
  ],
58
70
  "typescript/dot-notation": "error",
59
71
  "typescript/no-confusing-void-expression": "error",
72
+ "typescript/no-dynamic-delete": "error",
73
+ "typescript/no-empty-object-type": "error",
60
74
  "typescript/no-explicit-any": "error",
61
75
  "typescript/no-floating-promises": "error",
62
76
  "typescript/no-misused-promises": "error",
63
77
  "typescript/no-misused-spread": "error",
78
+ "typescript/no-non-null-assertion": "error",
64
79
  "typescript/no-require-imports": "error",
65
80
  "typescript/no-unnecessary-condition": "error",
66
81
  "typescript/no-unnecessary-qualifier": "error",
@@ -91,6 +106,7 @@ export const base = defineConfig({
91
106
  "typescript/switch-exhaustiveness-check": "error",
92
107
  "typescript/unbound-method": "error",
93
108
  "typescript/use-unknown-in-catch-callback-variable": "error",
109
+ "unicorn/no-abusive-eslint-disable": "error",
94
110
  "unicorn/no-null": "off",
95
111
  "unicorn/filename-case": ["error", { case: "kebabCase" }],
96
112
  },
@@ -105,7 +121,19 @@ export const base = defineConfig({
105
121
  },
106
122
  },
107
123
  {
108
- files: ["**/tests/**", "**/__tests__/**", "**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"],
124
+ files: ["**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"],
125
+ rules: {
126
+ "func-names": "off",
127
+ },
128
+ },
129
+ {
130
+ files: [
131
+ "**/test/**",
132
+ "**/tests/**",
133
+ "**/__tests__/**",
134
+ "**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}",
135
+ ],
136
+ plugins: [...BASE_PLUGINS, "vitest"],
109
137
  env: {
110
138
  vitest: true,
111
139
  },
@@ -115,5 +143,16 @@ export const base = defineConfig({
115
143
  "vitest/max-nested-describe": ["error", { max: 3 }],
116
144
  },
117
145
  },
146
+ {
147
+ files: [
148
+ "**/worker-configuration.d.ts",
149
+ "**/generated/**",
150
+ "**/*.generated.{js,jsx,ts,tsx,mjs,cjs,mts,cts,d.ts}",
151
+ ],
152
+ rules: {
153
+ "max-lines": "off",
154
+ "unicorn/no-abusive-eslint-disable": "off",
155
+ },
156
+ },
118
157
  ],
119
158
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,eAAO,MAAM,KAAK,EAAE,YA6BlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,eAAO,MAAM,KAAK,EAAE,YAkClB,CAAC"}
@@ -7,6 +7,7 @@ export const react = defineConfig({
7
7
  ...base.rules,
8
8
  "jsx-a11y/alt-text": "error",
9
9
  "react/jsx-props-no-spreading": "off",
10
+ "react/react-in-jsx-scope": "off",
10
11
  "react/exhaustive-deps": "error",
11
12
  "react/jsx-key": "error",
12
13
  "react/jsx-max-depth": ["error", { max: 4 }],
@@ -15,10 +16,14 @@ export const react = defineConfig({
15
16
  "react/jsx-no-undef": "error",
16
17
  "react/no-array-index-key": "error",
17
18
  "react/no-children-prop": "error",
19
+ "react/no-clone-element": "error",
20
+ "react/no-danger": "error",
18
21
  "react/no-danger-with-children": "error",
19
22
  "react/no-direct-mutation-state": "error",
20
23
  "react/no-find-dom-node": "error",
24
+ "react/no-react-children": "error",
21
25
  "react/no-string-refs": "error",
26
+ "react/style-prop-object": "off",
22
27
  "react/no-unsafe": "error",
23
28
  "react/no-unknown-property": "error",
24
29
  "react/void-dom-elements-no-children": "error",
@@ -0,0 +1,3 @@
1
+ import type { OxlintConfig } from "oxlint";
2
+ export declare const server: OxlintConfig;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,eAAO,MAAM,MAAM,EAAE,YAWnB,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import { defineConfig } from "oxlint";
2
2
  import { base } from "../base/index.js";
3
- export const node = defineConfig({
3
+ export const server = defineConfig({
4
4
  ...base,
5
5
  plugins: [...(base.plugins ?? []), "node"],
6
+ globals: {
7
+ ...base.globals,
8
+ WebSocketPair: "readonly",
9
+ },
6
10
  rules: {
7
11
  ...base.rules,
8
12
  "node/no-exports-assign": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasoa/oxlint-config",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Kasoa's Oxlint configurations",
5
5
  "keywords": [
6
6
  "kasoa",
@@ -28,18 +28,18 @@
28
28
  "type": "module",
29
29
  "exports": {
30
30
  "./base": "./dist/src/base/index.js",
31
- "./node": "./dist/src/node/index.js",
31
+ "./server": "./dist/src/server/index.js",
32
32
  "./react": "./dist/src/react/index.js"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/node": "^25.3.0",
39
- "@typescript/native-preview": "^7.0.0-dev.20260224.1",
40
- "oxfmt": "^0.36.0",
41
- "oxlint": "^1.51.0",
42
- "oxlint-tsgolint": "^0.16.0"
38
+ "@types/node": "^25.5.0",
39
+ "@typescript/native-preview": "^7.0.0-dev.20260319.1",
40
+ "oxfmt": "^0.41.0",
41
+ "oxlint": "^1.56.0",
42
+ "oxlint-tsgolint": "^0.17.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "oxlint": ">=1.51.0 <2",
@@ -1,3 +0,0 @@
1
- import type { OxlintConfig } from "oxlint";
2
- export declare const node: OxlintConfig;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,eAAO,MAAM,IAAI,EAAE,YAOjB,CAAC"}