@haltcase/style 9.0.0-canary.3 → 9.0.0-canary.5
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 -0
- package/dist/oxlint/configs/base.d.ts +1 -1
- package/dist/oxlint/index.d.ts +11 -2
- package/dist/oxlint/index.js +3 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -62,6 +62,13 @@ Native Oxlint rules are enabled explicitly. Upgrading Oxlint does not automatica
|
|
|
62
62
|
added rules; those are adopted through updates to `@haltcase/style`. Existing rules can still change
|
|
63
63
|
behavior when Oxlint is upgraded.
|
|
64
64
|
|
|
65
|
+
Use `rules` to customize rules for all files and `overrides` to customize rules for matching files.
|
|
66
|
+
Top-level rules are applied in order from `extends` to presets (such as `node` or `react`) to
|
|
67
|
+
`rules`. Matching `overrides` take precedence over top-level rules, and user overrides take
|
|
68
|
+
precedence over preset overrides. Use `plugins` to add native plugins alongside the default and
|
|
69
|
+
preset plugins, and `jsPlugins` to load JavaScript plugins. `createOxlintConfig` supports explicit
|
|
70
|
+
rules instead of the `categories` option so new rules are enabled through preset updates.
|
|
71
|
+
|
|
65
72
|
### Oxfmt
|
|
66
73
|
|
|
67
74
|
```js
|
|
@@ -22,7 +22,7 @@ export declare const baseConfig: {
|
|
|
22
22
|
"import/no-default-export"?: undefined;
|
|
23
23
|
};
|
|
24
24
|
})[];
|
|
25
|
-
plugins: ("eslint" | "unicorn" | "oxc" | "import" | "jsdoc"
|
|
25
|
+
plugins: ("promise" | "eslint" | "unicorn" | "oxc" | "import" | "jsdoc")[];
|
|
26
26
|
jsPlugins: import("oxlint").ExternalPluginEntry[];
|
|
27
27
|
rules: {
|
|
28
28
|
"haltcase/padding-between-statements": "error";
|
package/dist/oxlint/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { OxlintConfig, OxlintOverride } from "oxlint";
|
|
4
4
|
export declare const tanstackPackages: readonly ["@tanstack/react-router", "@tanstack/react-start", "@tanstack/eslint-plugin-router"];
|
|
5
|
-
type OxlintPassthroughOptions = Omit<OxlintConfig, "overrides">;
|
|
5
|
+
type OxlintPassthroughOptions = Omit<OxlintConfig, "categories" | "overrides" | "plugins" | "rules">;
|
|
6
6
|
export interface CreateOxlintConfigOptions extends OxlintPassthroughOptions {
|
|
7
7
|
typescript?: boolean;
|
|
8
8
|
react?: boolean;
|
|
@@ -22,9 +22,18 @@ export interface CreateOxlintConfigOptions extends OxlintPassthroughOptions {
|
|
|
22
22
|
next?: boolean;
|
|
23
23
|
node?: boolean;
|
|
24
24
|
testing?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enable additional native plugins alongside the default and preset plugins.
|
|
27
|
+
*/
|
|
28
|
+
plugins?: OxlintConfig["plugins"];
|
|
29
|
+
/**
|
|
30
|
+
* Configure rules for all files. These take precedence over rules set at the top level of
|
|
31
|
+
* extended configs and presets. Matching overrides take precedence over these rules.
|
|
32
|
+
*/
|
|
33
|
+
rules?: OxlintConfig["rules"];
|
|
25
34
|
/**
|
|
26
35
|
* Add, remove, or otherwise reconfigure rules for specific files or groups of files.
|
|
27
|
-
* These overrides
|
|
36
|
+
* These overrides take precedence over matching preset overrides and top-level rules.
|
|
28
37
|
*/
|
|
29
38
|
overrides?: OxlintOverride[];
|
|
30
39
|
}
|
package/dist/oxlint/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const tanstackPackages = [
|
|
|
24
24
|
];
|
|
25
25
|
const typescriptPackages = ["@typescript/native-preview", "typescript"];
|
|
26
26
|
const createOxlintConfig = (options = {}) => {
|
|
27
|
-
const { env, extends: userExtends = [], globals, ignorePatterns: userIgnores = [], options: lintOptions, overrides = [], rules, settings, typescript: isTypescriptEnabled = typescriptPackages.some((pkg) => isPackageExists(pkg)), react: isReactEnabled = reactPackages.some((pkg) => isPackageExists(pkg)), tanstackRouter: isTanstackRouterEnabled = tanstackPackages.filter((pkg) => pkg !== "@tanstack/react-start").every((pkg) => isPackageExists(pkg)), tanstackStart: isTanstackStartEnabled = tanstackPackages.every((pkg) => isPackageExists(pkg)), next: isNextEnabled = isPackageExists("next"), node: isNodeEnabled = false, testing: isTestingEnabled = false } = options;
|
|
27
|
+
const { env, extends: userExtends = [], globals, ignorePatterns: userIgnores = [], jsPlugins, options: lintOptions, overrides = [], plugins: userPlugins, rules, settings, typescript: isTypescriptEnabled = typescriptPackages.some((pkg) => isPackageExists(pkg)), react: isReactEnabled = reactPackages.some((pkg) => isPackageExists(pkg)), tanstackRouter: isTanstackRouterEnabled = tanstackPackages.filter((pkg) => pkg !== "@tanstack/react-start").every((pkg) => isPackageExists(pkg)), tanstackStart: isTanstackStartEnabled = tanstackPackages.every((pkg) => isPackageExists(pkg)), next: isNextEnabled = isPackageExists("next"), node: isNodeEnabled = false, testing: isTestingEnabled = false } = options;
|
|
28
28
|
const configs = [...userExtends, ...baseConfig];
|
|
29
29
|
if (isTypescriptEnabled) configs.push(...typescriptConfig);
|
|
30
30
|
if (isReactEnabled) configs.push(...reactConfig);
|
|
@@ -33,11 +33,13 @@ const createOxlintConfig = (options = {}) => {
|
|
|
33
33
|
if (isNextEnabled) configs.push(...nextConfig);
|
|
34
34
|
if (isTanstackRouterEnabled) configs.push(...tanstackRouterConfig);
|
|
35
35
|
if (isTanstackStartEnabled) configs.push(...tanstackStartConfig);
|
|
36
|
+
if (userPlugins) configs.push({ plugins: userPlugins });
|
|
36
37
|
return {
|
|
37
38
|
env,
|
|
38
39
|
extends: configs,
|
|
39
40
|
globals,
|
|
40
41
|
ignorePatterns: [...userIgnores],
|
|
42
|
+
jsPlugins,
|
|
41
43
|
overrides,
|
|
42
44
|
options: {
|
|
43
45
|
typeAware: isTypescriptEnabled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haltcase/style",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.5",
|
|
4
4
|
"description": "haltcase's web ecosystem style guide & configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editorconfig",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@commitlint/cli": "21.2.3",
|
|
93
93
|
"@commitlint/config-conventional": "21.2.3",
|
|
94
94
|
"@commitlint/types": "21.2.3",
|
|
95
|
-
"@haltcase/style": "9.0.0-canary.
|
|
95
|
+
"@haltcase/style": "9.0.0-canary.5",
|
|
96
96
|
"@octokit/types": "16.0.0",
|
|
97
97
|
"@octokit/webhooks-types": "7.6.1",
|
|
98
98
|
"@semantic-release/git": "11.0.1",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@tanstack/eslint-plugin-router": "^1.161.6",
|
|
116
116
|
"stylelint": "^17.0.0",
|
|
117
117
|
"typescript": "^6.0.0 || ^7.0.0",
|
|
118
|
-
"vite-plus": "^0.
|
|
118
|
+
"vite-plus": "^1.0.0"
|
|
119
119
|
},
|
|
120
120
|
"peerDependenciesMeta": {
|
|
121
121
|
"@tanstack/eslint-plugin-router": {
|