@haltcase/style 8.0.0 → 8.0.1-canary.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/dist/.editorconfig +15 -0
- package/dist/editorconfig/index.d.ts +6 -0
- package/dist/editorconfig/index.js +8 -0
- package/dist/oxfmt/index.d.ts +8 -0
- package/dist/oxfmt/index.js +57 -0
- package/dist/oxlint/configs/base.d.ts +190 -0
- package/dist/oxlint/configs/base.js +39 -0
- package/dist/oxlint/configs/next.d.ts +25 -0
- package/dist/oxlint/configs/next.js +38 -0
- package/dist/oxlint/configs/node.d.ts +16 -0
- package/dist/oxlint/configs/node.js +11 -0
- package/dist/oxlint/configs/react.d.ts +7 -0
- package/dist/oxlint/configs/react.js +27 -0
- package/dist/oxlint/configs/tanstack-router.d.ts +22 -0
- package/dist/oxlint/configs/tanstack-router.js +22 -0
- package/dist/oxlint/configs/tanstack-start.d.ts +23 -0
- package/dist/oxlint/configs/tanstack-start.js +22 -0
- package/dist/oxlint/configs/testing.d.ts +16 -0
- package/dist/oxlint/configs/testing.js +11 -0
- package/dist/oxlint/configs/typescript.d.ts +77 -0
- package/dist/oxlint/configs/typescript.js +18 -0
- package/dist/oxlint/constants.d.ts +26 -0
- package/dist/oxlint/constants.js +37 -0
- package/dist/oxlint/index.d.ts +34 -0
- package/dist/oxlint/index.js +51 -0
- package/dist/oxlint/rules/best-practice.d.ts +181 -0
- package/dist/oxlint/rules/best-practice.js +177 -0
- package/dist/oxlint/rules/imports.d.ts +67 -0
- package/dist/oxlint/rules/imports.js +67 -0
- package/dist/oxlint/rules/jsx-a11y.d.ts +8 -0
- package/dist/oxlint/rules/jsx-a11y.js +6 -0
- package/dist/oxlint/rules/playwright-test.d.ts +25 -0
- package/dist/oxlint/rules/playwright-test.js +26 -0
- package/dist/oxlint/rules/possible-errors.d.ts +28 -0
- package/dist/oxlint/rules/possible-errors.js +29 -0
- package/dist/oxlint/rules/react-x.d.ts +38 -0
- package/dist/oxlint/rules/react-x.js +38 -0
- package/dist/oxlint/rules/react.d.ts +28 -0
- package/dist/oxlint/rules/react.js +20 -0
- package/dist/oxlint/rules/restriction.d.ts +22 -0
- package/dist/oxlint/rules/restriction.js +22 -0
- package/dist/oxlint/rules/stylistic-jsx.d.ts +15 -0
- package/dist/oxlint/rules/stylistic-jsx.js +15 -0
- package/dist/oxlint/rules/stylistic.d.ts +88 -0
- package/dist/oxlint/rules/stylistic.js +74 -0
- package/dist/oxlint/rules/typescript/declaration-files.d.ts +8 -0
- package/dist/oxlint/rules/typescript/declaration-files.js +6 -0
- package/dist/oxlint/rules/typescript/index.d.ts +107 -0
- package/dist/oxlint/rules/typescript/index.js +103 -0
- package/dist/oxlint/rules/variables.d.ts +25 -0
- package/dist/oxlint/rules/variables.js +26 -0
- package/dist/oxlint/utils/eslint-compat.d.ts +9 -0
- package/dist/oxlint/utils/eslint-compat.js +35 -0
- package/dist/stylelint/_base.d.ts +6 -0
- package/dist/stylelint/_base.js +40 -0
- package/dist/stylelint/index.d.ts +6 -0
- package/dist/stylelint/index.js +18 -0
- package/dist/stylelint/modules.d.ts +6 -0
- package/dist/stylelint/modules.js +19 -0
- package/dist/stylelint/standard.d.ts +4 -0
- package/dist/stylelint/standard.js +5 -0
- package/dist/stylelint/tailwind.d.ts +6 -0
- package/dist/stylelint/tailwind.js +11 -0
- package/dist/typescript/tsconfig.base.json +14 -0
- package/dist/typescript/tsconfig.bundler.json +17 -0
- package/dist/typescript/tsconfig.next.json +36 -0
- package/dist/typescript/tsconfig.node-ts.json +10 -0
- package/dist/typescript/tsconfig.node.json +4 -0
- package/dist/typescript/tsconfig.node22.json +12 -0
- package/dist/typescript/tsconfig.node24.json +12 -0
- package/dist/typescript/tsconfig.node26.json +11 -0
- package/dist/typescript/tsconfig.web.json +8 -0
- package/dist/vite-plus/index.d.ts +11 -0
- package/dist/vite-plus/index.js +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/playwright-test.d.ts
|
|
4
|
+
declare const playwrightTestRules: {
|
|
5
|
+
/**
|
|
6
|
+
* Require lowercase test names.
|
|
7
|
+
*
|
|
8
|
+
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
9
|
+
*/
|
|
10
|
+
"playwright/prefer-lowercase-title": string;
|
|
11
|
+
/**
|
|
12
|
+
* Require using `toHaveLength` over explicitly checking lengths.
|
|
13
|
+
*
|
|
14
|
+
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
15
|
+
*/
|
|
16
|
+
"playwright/prefer-to-have-length": string;
|
|
17
|
+
/**
|
|
18
|
+
* Require test cases and hooks to be inside a `test.describe` block.
|
|
19
|
+
*
|
|
20
|
+
* 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
21
|
+
*/
|
|
22
|
+
"playwright/require-top-level-describe": string;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { playwrightTestRules };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/oxlint/rules/playwright-test.ts
|
|
5
|
+
const playwrightTestRules = {
|
|
6
|
+
/**
|
|
7
|
+
* Require lowercase test names.
|
|
8
|
+
*
|
|
9
|
+
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
10
|
+
*/
|
|
11
|
+
"playwright/prefer-lowercase-title": "error",
|
|
12
|
+
/**
|
|
13
|
+
* Require using `toHaveLength` over explicitly checking lengths.
|
|
14
|
+
*
|
|
15
|
+
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
16
|
+
*/
|
|
17
|
+
"playwright/prefer-to-have-length": "error",
|
|
18
|
+
/**
|
|
19
|
+
* Require test cases and hooks to be inside a `test.describe` block.
|
|
20
|
+
*
|
|
21
|
+
* 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
|
|
22
|
+
*/
|
|
23
|
+
"playwright/require-top-level-describe": "error"
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { playwrightTestRules };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/possible-errors.d.ts
|
|
4
|
+
declare const possibleErrorsRules: {
|
|
5
|
+
/**
|
|
6
|
+
* Disallow the use of console.
|
|
7
|
+
*/
|
|
8
|
+
"no-console": "error";
|
|
9
|
+
/**
|
|
10
|
+
* Disallow expressions where the operation doesn't affect the value.
|
|
11
|
+
*/
|
|
12
|
+
"no-constant-binary-expression": "error";
|
|
13
|
+
/**
|
|
14
|
+
* Disallow returning values from Promise executor functions.
|
|
15
|
+
*/
|
|
16
|
+
"no-promise-executor-return": "error";
|
|
17
|
+
/**
|
|
18
|
+
* Disallow template literal placeholder syntax in regular strings, as
|
|
19
|
+
* these are likely errors.
|
|
20
|
+
*/
|
|
21
|
+
"no-template-curly-in-string": "error";
|
|
22
|
+
/**
|
|
23
|
+
* Disallow loops with a body that allows only one iteration.
|
|
24
|
+
*/
|
|
25
|
+
"no-unreachable-loop": "error";
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { possibleErrorsRules };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/oxlint/rules/possible-errors.ts
|
|
5
|
+
const possibleErrorsRules = {
|
|
6
|
+
/**
|
|
7
|
+
* Disallow the use of console.
|
|
8
|
+
*/
|
|
9
|
+
"no-console": "error",
|
|
10
|
+
/**
|
|
11
|
+
* Disallow expressions where the operation doesn't affect the value.
|
|
12
|
+
*/
|
|
13
|
+
"no-constant-binary-expression": "error",
|
|
14
|
+
/**
|
|
15
|
+
* Disallow returning values from Promise executor functions.
|
|
16
|
+
*/
|
|
17
|
+
"no-promise-executor-return": "error",
|
|
18
|
+
/**
|
|
19
|
+
* Disallow template literal placeholder syntax in regular strings, as
|
|
20
|
+
* these are likely errors.
|
|
21
|
+
*/
|
|
22
|
+
"no-template-curly-in-string": "error",
|
|
23
|
+
/**
|
|
24
|
+
* Disallow loops with a body that allows only one iteration.
|
|
25
|
+
*/
|
|
26
|
+
"no-unreachable-loop": "error"
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { possibleErrorsRules };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/react-x.d.ts
|
|
4
|
+
declare const reactXRules: {
|
|
5
|
+
"@eslint-react/exhaustive-deps": "off";
|
|
6
|
+
"@eslint-react/rules-of-hooks": "off";
|
|
7
|
+
"@eslint-react/no-array-index-key": "off";
|
|
8
|
+
"@eslint-react/no-clone-element": "off";
|
|
9
|
+
"@eslint-react/no-direct-mutation-state": "off";
|
|
10
|
+
"@eslint-react/jsx-no-comment-textnodes": "off";
|
|
11
|
+
"@eslint-react/jsx-no-useless-fragment": "off";
|
|
12
|
+
"@eslint-react/jsx-no-namespace": "off";
|
|
13
|
+
"@eslint-react/dom-no-find-dom-node": "off";
|
|
14
|
+
"@eslint-react/dom-no-missing-button-type": "off";
|
|
15
|
+
"@eslint-react/dom-no-missing-iframe-sandbox": "off";
|
|
16
|
+
"@eslint-react/dom-no-render-return-value": "off";
|
|
17
|
+
"@eslint-react/dom-no-script-url": "off";
|
|
18
|
+
"@eslint-react/dom-no-unknown-property": "off";
|
|
19
|
+
"@eslint-react/dom-no-void-elements-with-children": "off";
|
|
20
|
+
"@eslint-react/no-set-state-in-component-did-mount": "off";
|
|
21
|
+
"@eslint-react/no-set-state-in-component-did-update": "off";
|
|
22
|
+
"@eslint-react/no-set-state-in-component-will-update": "off";
|
|
23
|
+
"@eslint-react/no-unsafe-component-will-mount": "off";
|
|
24
|
+
"@eslint-react/no-unsafe-component-will-receive-props": "off";
|
|
25
|
+
"@eslint-react/no-unsafe-component-will-update": "off";
|
|
26
|
+
"@eslint-react/error-boundaries": "off";
|
|
27
|
+
"@eslint-react/globals": "off";
|
|
28
|
+
"@eslint-react/immutability": "off";
|
|
29
|
+
"@eslint-react/purity": "off";
|
|
30
|
+
"@eslint-react/refs": "off";
|
|
31
|
+
"@eslint-react/set-state-in-effect": "off";
|
|
32
|
+
"@eslint-react/set-state-in-render": "off";
|
|
33
|
+
"@eslint-react/static-components": "off";
|
|
34
|
+
"@eslint-react/unsupported-syntax": "off";
|
|
35
|
+
"@eslint-react/use-memo": "off";
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { reactXRules };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
const reactXRules = {
|
|
5
|
+
"@eslint-react/exhaustive-deps": "off",
|
|
6
|
+
"@eslint-react/rules-of-hooks": "off",
|
|
7
|
+
"@eslint-react/no-array-index-key": "off",
|
|
8
|
+
"@eslint-react/no-clone-element": "off",
|
|
9
|
+
"@eslint-react/no-direct-mutation-state": "off",
|
|
10
|
+
"@eslint-react/jsx-no-comment-textnodes": "off",
|
|
11
|
+
"@eslint-react/jsx-no-useless-fragment": "off",
|
|
12
|
+
"@eslint-react/jsx-no-namespace": "off",
|
|
13
|
+
"@eslint-react/dom-no-find-dom-node": "off",
|
|
14
|
+
"@eslint-react/dom-no-missing-button-type": "off",
|
|
15
|
+
"@eslint-react/dom-no-missing-iframe-sandbox": "off",
|
|
16
|
+
"@eslint-react/dom-no-render-return-value": "off",
|
|
17
|
+
"@eslint-react/dom-no-script-url": "off",
|
|
18
|
+
"@eslint-react/dom-no-unknown-property": "off",
|
|
19
|
+
"@eslint-react/dom-no-void-elements-with-children": "off",
|
|
20
|
+
"@eslint-react/no-set-state-in-component-did-mount": "off",
|
|
21
|
+
"@eslint-react/no-set-state-in-component-did-update": "off",
|
|
22
|
+
"@eslint-react/no-set-state-in-component-will-update": "off",
|
|
23
|
+
"@eslint-react/no-unsafe-component-will-mount": "off",
|
|
24
|
+
"@eslint-react/no-unsafe-component-will-receive-props": "off",
|
|
25
|
+
"@eslint-react/no-unsafe-component-will-update": "off",
|
|
26
|
+
"@eslint-react/error-boundaries": "off",
|
|
27
|
+
"@eslint-react/globals": "off",
|
|
28
|
+
"@eslint-react/immutability": "off",
|
|
29
|
+
"@eslint-react/purity": "off",
|
|
30
|
+
"@eslint-react/refs": "off",
|
|
31
|
+
"@eslint-react/set-state-in-effect": "off",
|
|
32
|
+
"@eslint-react/set-state-in-render": "off",
|
|
33
|
+
"@eslint-react/static-components": "off",
|
|
34
|
+
"@eslint-react/unsupported-syntax": "off",
|
|
35
|
+
"@eslint-react/use-memo": "off"
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { reactXRules };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/react.d.ts
|
|
4
|
+
declare const reactRules: {
|
|
5
|
+
"react/react-compiler": "error";
|
|
6
|
+
"react/forbid-component-props": ["error", {
|
|
7
|
+
forbid: string[];
|
|
8
|
+
}];
|
|
9
|
+
"react/jsx-filename-extension": ["error", {
|
|
10
|
+
extensions: string[];
|
|
11
|
+
}];
|
|
12
|
+
"react/jsx-max-depth": ["error", {
|
|
13
|
+
max: number;
|
|
14
|
+
}];
|
|
15
|
+
"react/no-unstable-nested-components": ["error", {
|
|
16
|
+
allowAsProps: true;
|
|
17
|
+
}];
|
|
18
|
+
"react/jsx-props-no-spreading": "off";
|
|
19
|
+
"react/no-multi-comp": "off";
|
|
20
|
+
"react/react-in-jsx-scope": "off";
|
|
21
|
+
"react-perf/jsx-no-jsx-as-prop": "off";
|
|
22
|
+
"react/jsx-no-literals": "off";
|
|
23
|
+
"react-perf/jsx-no-new-array-as-prop": "off";
|
|
24
|
+
"react-perf/jsx-no-new-function-as-prop": "off";
|
|
25
|
+
"react-perf/jsx-no-new-object-as-prop": "off";
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { reactRules };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
const reactRules = {
|
|
5
|
+
"react/jsx-props-no-spreading": "off",
|
|
6
|
+
"react/no-multi-comp": "off",
|
|
7
|
+
"react/react-in-jsx-scope": "off",
|
|
8
|
+
"react-perf/jsx-no-jsx-as-prop": "off",
|
|
9
|
+
"react/jsx-no-literals": "off",
|
|
10
|
+
"react-perf/jsx-no-new-array-as-prop": "off",
|
|
11
|
+
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
12
|
+
"react-perf/jsx-no-new-object-as-prop": "off",
|
|
13
|
+
"react/react-compiler": "error",
|
|
14
|
+
"react/forbid-component-props": ["error", { forbid: ["style"] }],
|
|
15
|
+
"react/jsx-filename-extension": ["error", { extensions: ["tsx", "jsx"] }],
|
|
16
|
+
"react/jsx-max-depth": ["error", { max: 12 }],
|
|
17
|
+
"react/no-unstable-nested-components": ["error", { allowAsProps: true }]
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { reactRules };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/restriction.d.ts
|
|
4
|
+
declare const restrictionRules: {
|
|
5
|
+
"node/no-process-env": "off";
|
|
6
|
+
"oxc/no-async-await": "off";
|
|
7
|
+
"oxc/no-rest-spread-properties": "off";
|
|
8
|
+
"oxc/no-optional-chaining": "off";
|
|
9
|
+
complexity: ["error", {
|
|
10
|
+
max: number;
|
|
11
|
+
variant: "modified";
|
|
12
|
+
}];
|
|
13
|
+
"no-await-in-loop": "off";
|
|
14
|
+
"no-continue": "off";
|
|
15
|
+
"no-eq-null": "off";
|
|
16
|
+
"no-plusplus": "off";
|
|
17
|
+
"no-ternary": "off";
|
|
18
|
+
"no-undefined": "off";
|
|
19
|
+
"no-void": "off";
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { restrictionRules };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
const restrictionRules = {
|
|
5
|
+
"node/no-process-env": "off",
|
|
6
|
+
"oxc/no-async-await": "off",
|
|
7
|
+
"oxc/no-rest-spread-properties": "off",
|
|
8
|
+
"oxc/no-optional-chaining": "off",
|
|
9
|
+
complexity: ["error", {
|
|
10
|
+
max: 200,
|
|
11
|
+
variant: "modified"
|
|
12
|
+
}],
|
|
13
|
+
"no-await-in-loop": "off",
|
|
14
|
+
"no-continue": "off",
|
|
15
|
+
"no-eq-null": "off",
|
|
16
|
+
"no-plusplus": "off",
|
|
17
|
+
"no-ternary": "off",
|
|
18
|
+
"no-undefined": "off",
|
|
19
|
+
"no-void": "off"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { restrictionRules };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/stylistic-jsx.d.ts
|
|
4
|
+
declare const stylisticJsxRules: {
|
|
5
|
+
/**
|
|
6
|
+
* Disallow extra closing tags for components without children.
|
|
7
|
+
*
|
|
8
|
+
* Components without children can be self-closed to avoid unnecessary extra closing tag.
|
|
9
|
+
*
|
|
10
|
+
* 🔧 Fixable - https://eslint.style/rules/jsx/jsx-self-closing-comp
|
|
11
|
+
*/
|
|
12
|
+
"@stylistic/jsx/jsx-self-closing-comp": string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { stylisticJsxRules };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/oxlint/rules/stylistic-jsx.ts
|
|
5
|
+
const stylisticJsxRules = {
|
|
6
|
+
/**
|
|
7
|
+
* Disallow extra closing tags for components without children.
|
|
8
|
+
*
|
|
9
|
+
* Components without children can be self-closed to avoid unnecessary extra closing tag.
|
|
10
|
+
*
|
|
11
|
+
* 🔧 Fixable - https://eslint.style/rules/jsx/jsx-self-closing-comp
|
|
12
|
+
*/
|
|
13
|
+
"@stylistic/jsx/jsx-self-closing-comp": "error" };
|
|
14
|
+
//#endregion
|
|
15
|
+
export { stylisticJsxRules };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/stylistic.d.ts
|
|
4
|
+
declare const stylisticRules: {
|
|
5
|
+
/**
|
|
6
|
+
* Require function expressions to have a name.
|
|
7
|
+
*/
|
|
8
|
+
"func-names": ["error", "as-needed"];
|
|
9
|
+
"id-length": ["error", {
|
|
10
|
+
min: number;
|
|
11
|
+
properties: "never";
|
|
12
|
+
exceptions: string[];
|
|
13
|
+
}];
|
|
14
|
+
"max-depth": ["error", {
|
|
15
|
+
max: number;
|
|
16
|
+
}];
|
|
17
|
+
"max-lines": ["error", {
|
|
18
|
+
max: number;
|
|
19
|
+
}];
|
|
20
|
+
"max-lines-per-function": ["error", {
|
|
21
|
+
max: number;
|
|
22
|
+
skipComments: true;
|
|
23
|
+
skipBlankLines: true;
|
|
24
|
+
}];
|
|
25
|
+
"max-params": ["error", {
|
|
26
|
+
countThis: "never";
|
|
27
|
+
max: number;
|
|
28
|
+
}];
|
|
29
|
+
"max-statements": ["error", {
|
|
30
|
+
max: number;
|
|
31
|
+
}];
|
|
32
|
+
/**
|
|
33
|
+
* Require a capital letter for constructors.
|
|
34
|
+
*/
|
|
35
|
+
"new-cap": ["error", {
|
|
36
|
+
capIsNew: false;
|
|
37
|
+
}];
|
|
38
|
+
/**
|
|
39
|
+
* Disallow use of the Array constructor.
|
|
40
|
+
*/
|
|
41
|
+
"no-array-constructor": "error";
|
|
42
|
+
/**
|
|
43
|
+
* Disallow use of bitwise operators.
|
|
44
|
+
*/
|
|
45
|
+
"no-bitwise": "error";
|
|
46
|
+
"no-duplicate-imports": ["error", {
|
|
47
|
+
allowSeparateTypeImports: true;
|
|
48
|
+
}];
|
|
49
|
+
/**
|
|
50
|
+
* Disallow if as the only statement in an else block.
|
|
51
|
+
*/
|
|
52
|
+
"no-lonely-if": "error";
|
|
53
|
+
/**
|
|
54
|
+
* Disallow use of chained assignment expressions.
|
|
55
|
+
*/
|
|
56
|
+
"no-multi-assign": ["error"];
|
|
57
|
+
/**
|
|
58
|
+
* Disallow ternary operators when simpler alternatives exist.
|
|
59
|
+
*/
|
|
60
|
+
"no-unneeded-ternary": "error";
|
|
61
|
+
/**
|
|
62
|
+
* Require using arrow functions for callbacks.
|
|
63
|
+
*/
|
|
64
|
+
"prefer-arrow-callback": ["error", {
|
|
65
|
+
allowNamedFunctions: true;
|
|
66
|
+
}];
|
|
67
|
+
/**
|
|
68
|
+
* Require use of an object spread over Object.assign.
|
|
69
|
+
*/
|
|
70
|
+
"prefer-object-spread": "error";
|
|
71
|
+
"unicorn/max-nested-calls": ["error", {
|
|
72
|
+
max: number;
|
|
73
|
+
}];
|
|
74
|
+
"unicorn/no-nested-ternary": "error";
|
|
75
|
+
"capitalized-comments": "off";
|
|
76
|
+
"init-declarations": "off";
|
|
77
|
+
"no-inline-comments": "off";
|
|
78
|
+
"no-magic-numbers": "off";
|
|
79
|
+
"no-nested-ternary": "off";
|
|
80
|
+
"sort-imports": "off";
|
|
81
|
+
"sort-keys": "off";
|
|
82
|
+
"sort-vars": "off";
|
|
83
|
+
"promise/prefer-await-to-callbacks": "off";
|
|
84
|
+
"unicorn/import-style": "off";
|
|
85
|
+
"unicorn/no-null": "off";
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { stylisticRules };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
const stylisticRules = {
|
|
5
|
+
"capitalized-comments": "off",
|
|
6
|
+
"init-declarations": "off",
|
|
7
|
+
"no-inline-comments": "off",
|
|
8
|
+
"no-magic-numbers": "off",
|
|
9
|
+
"no-nested-ternary": "off",
|
|
10
|
+
"sort-imports": "off",
|
|
11
|
+
"sort-keys": "off",
|
|
12
|
+
"sort-vars": "off",
|
|
13
|
+
"promise/prefer-await-to-callbacks": "off",
|
|
14
|
+
"unicorn/import-style": "off",
|
|
15
|
+
"unicorn/no-null": "off",
|
|
16
|
+
/**
|
|
17
|
+
* Require function expressions to have a name.
|
|
18
|
+
*/
|
|
19
|
+
"func-names": ["error", "as-needed"],
|
|
20
|
+
"id-length": ["error", {
|
|
21
|
+
min: 2,
|
|
22
|
+
properties: "never",
|
|
23
|
+
exceptions: ["T", "_"]
|
|
24
|
+
}],
|
|
25
|
+
"max-depth": ["error", { max: 5 }],
|
|
26
|
+
"max-lines": ["error", { max: 3e3 }],
|
|
27
|
+
"max-lines-per-function": ["error", {
|
|
28
|
+
max: 1500,
|
|
29
|
+
skipComments: true,
|
|
30
|
+
skipBlankLines: true
|
|
31
|
+
}],
|
|
32
|
+
"max-params": ["error", {
|
|
33
|
+
countThis: "never",
|
|
34
|
+
max: 5
|
|
35
|
+
}],
|
|
36
|
+
"max-statements": ["error", { max: 80 }],
|
|
37
|
+
/**
|
|
38
|
+
* Require a capital letter for constructors.
|
|
39
|
+
*/
|
|
40
|
+
"new-cap": ["error", { capIsNew: false }],
|
|
41
|
+
/**
|
|
42
|
+
* Disallow use of the Array constructor.
|
|
43
|
+
*/
|
|
44
|
+
"no-array-constructor": "error",
|
|
45
|
+
/**
|
|
46
|
+
* Disallow use of bitwise operators.
|
|
47
|
+
*/
|
|
48
|
+
"no-bitwise": "error",
|
|
49
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
50
|
+
/**
|
|
51
|
+
* Disallow if as the only statement in an else block.
|
|
52
|
+
*/
|
|
53
|
+
"no-lonely-if": "error",
|
|
54
|
+
/**
|
|
55
|
+
* Disallow use of chained assignment expressions.
|
|
56
|
+
*/
|
|
57
|
+
"no-multi-assign": ["error"],
|
|
58
|
+
/**
|
|
59
|
+
* Disallow ternary operators when simpler alternatives exist.
|
|
60
|
+
*/
|
|
61
|
+
"no-unneeded-ternary": "error",
|
|
62
|
+
/**
|
|
63
|
+
* Require using arrow functions for callbacks.
|
|
64
|
+
*/
|
|
65
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
66
|
+
/**
|
|
67
|
+
* Require use of an object spread over Object.assign.
|
|
68
|
+
*/
|
|
69
|
+
"prefer-object-spread": "error",
|
|
70
|
+
"unicorn/max-nested-calls": ["error", { max: 5 }],
|
|
71
|
+
"unicorn/no-nested-ternary": "error"
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { stylisticRules };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/typescript/declaration-files.d.ts
|
|
4
|
+
declare const typescriptDeclarationFilesRules: {
|
|
5
|
+
"import/unambiguous": "off";
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { typescriptDeclarationFilesRules };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/oxlint/rules/typescript/index.d.ts
|
|
4
|
+
declare const typescriptBaseRules: {
|
|
5
|
+
/**
|
|
6
|
+
* Require consistent usage of type exports.
|
|
7
|
+
*/
|
|
8
|
+
"typescript/consistent-type-exports": "error";
|
|
9
|
+
/**
|
|
10
|
+
* Require consistent usage of type imports.
|
|
11
|
+
*/
|
|
12
|
+
"typescript/consistent-type-imports": "error";
|
|
13
|
+
/**
|
|
14
|
+
* Require explicit return types on functions and class methods.
|
|
15
|
+
*/
|
|
16
|
+
"typescript/explicit-function-return-type": ["error", {
|
|
17
|
+
allowExpressions: true;
|
|
18
|
+
allowFunctionsWithoutTypeParameters: true;
|
|
19
|
+
allowTypedFunctionExpressions: true;
|
|
20
|
+
}];
|
|
21
|
+
/**
|
|
22
|
+
* Require using function property types in method signatures.
|
|
23
|
+
*
|
|
24
|
+
* These have enhanced typechecking, whereas method signatures do not.
|
|
25
|
+
*/
|
|
26
|
+
"typescript/method-signature-style": ["error", "property"];
|
|
27
|
+
/**
|
|
28
|
+
* Prevent `void` type expressions from being used in misleading locations
|
|
29
|
+
* such as being assigned to a variable, provided as a function argument,
|
|
30
|
+
* or returned from a function (except concise arrow functions).
|
|
31
|
+
*/
|
|
32
|
+
"typescript/no-confusing-void-expression": ["error", {
|
|
33
|
+
ignoreArrowShorthand: true;
|
|
34
|
+
}];
|
|
35
|
+
"typescript/no-empty-interface": ["error", {
|
|
36
|
+
allowSingleExtends: true;
|
|
37
|
+
}];
|
|
38
|
+
/**
|
|
39
|
+
* Disallow accidentally using the "empty object" type (`{}`).
|
|
40
|
+
*/
|
|
41
|
+
"typescript/no-empty-object-type": ["error", {
|
|
42
|
+
allowInterfaces: "with-single-extends";
|
|
43
|
+
allowWithName: string;
|
|
44
|
+
}];
|
|
45
|
+
/**
|
|
46
|
+
* Disallow Promises in places not designed to handle them.
|
|
47
|
+
*
|
|
48
|
+
* Function arguments and JSX attributes are allowed.
|
|
49
|
+
*/
|
|
50
|
+
"typescript/no-misused-promises": ["error", {
|
|
51
|
+
checksVoidReturn: false;
|
|
52
|
+
}];
|
|
53
|
+
/**
|
|
54
|
+
* Disallow members of unions and intersections that do nothing or override type information.
|
|
55
|
+
*/
|
|
56
|
+
"typescript/no-redundant-type-constituents": "error";
|
|
57
|
+
/**
|
|
58
|
+
* Disallow unnecessary namespace qualifiers.
|
|
59
|
+
*/
|
|
60
|
+
"typescript/no-unnecessary-qualifier": "error";
|
|
61
|
+
/**
|
|
62
|
+
* Enforce using the nullish coalescing operator instead of logical assignments or chaining.
|
|
63
|
+
*/
|
|
64
|
+
"typescript/prefer-nullish-coalescing": ["error", {
|
|
65
|
+
ignorePrimitives: {
|
|
66
|
+
number: true;
|
|
67
|
+
string: true;
|
|
68
|
+
};
|
|
69
|
+
}];
|
|
70
|
+
/**
|
|
71
|
+
* Require using `RegExp.exec()` over `String.match()` for consistency.
|
|
72
|
+
*/
|
|
73
|
+
"typescript/prefer-regexp-exec": "error";
|
|
74
|
+
/**
|
|
75
|
+
* Enforce template literal expressions to be of string type.
|
|
76
|
+
*/
|
|
77
|
+
"typescript/restrict-template-expressions": ["error", {
|
|
78
|
+
allow: {
|
|
79
|
+
from: "lib";
|
|
80
|
+
name: string[];
|
|
81
|
+
}[];
|
|
82
|
+
allowBoolean: true;
|
|
83
|
+
allowNumber: true;
|
|
84
|
+
}];
|
|
85
|
+
/**
|
|
86
|
+
* Require exhaustive checks when using union types in switch statements.
|
|
87
|
+
*
|
|
88
|
+
* This ensures cases are considered when items are later added to a union.
|
|
89
|
+
*/
|
|
90
|
+
"typescript/switch-exhaustiveness-check": "error";
|
|
91
|
+
"jsdoc/require-param": "off";
|
|
92
|
+
"jsdoc/require-param-type": "off";
|
|
93
|
+
"jsdoc/require-property": "off";
|
|
94
|
+
"jsdoc/require-returns": "off";
|
|
95
|
+
"jsdoc/require-returns-type": "off";
|
|
96
|
+
"require-await": "off";
|
|
97
|
+
"typescript/require-await": "off";
|
|
98
|
+
"typescript/consistent-return": "off";
|
|
99
|
+
"typescript/no-dynamic-delete": "off";
|
|
100
|
+
"typescript/no-unsafe-type-assertion": "off";
|
|
101
|
+
"typescript/prefer-readonly-parameter-types": "off";
|
|
102
|
+
"typescript/promise-function-async": "off";
|
|
103
|
+
"typescript/strict-boolean-expressions": "off";
|
|
104
|
+
"typescript/strict-void-return": "off";
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { typescriptBaseRules };
|