@toruslabs/oxlint-config-vue 0.0.0-stage → 1.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/dist/index.d.mts +41 -0
- package/dist/index.mjs +81 -0
- package/package.json +43 -4
- package/README.md +0 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OxlintConfig } from "vite-plus/lint";
|
|
2
|
+
/** Vize template rules that fixture tests prove through `vp lint`. Add a fixture before you add a rule. */
|
|
3
|
+
export declare const vueTemplateRules: {
|
|
4
|
+
readonly "vize/vue/no-duplicate-attributes": "error";
|
|
5
|
+
readonly "vize/vue/no-mutating-props": "error";
|
|
6
|
+
readonly "vize/vue/no-use-v-if-with-v-for": "warn";
|
|
7
|
+
readonly "vize/vue/require-v-for-key": "error";
|
|
8
|
+
readonly "vize/vue/valid-v-for": "error";
|
|
9
|
+
readonly "vize/vue/valid-v-if": "error";
|
|
10
|
+
readonly "vize/vue/valid-v-model": "error";
|
|
11
|
+
readonly "vize/vue/valid-v-on": "error";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Vue preset for `.vue` files that have a script block.
|
|
15
|
+
*
|
|
16
|
+
* `vp lint` and `vp check` can skip a `.vue` file with no script block, so template-only files need a separate task.
|
|
17
|
+
*/
|
|
18
|
+
export declare function vueLintPreset(): OxlintConfig;
|
|
19
|
+
export interface TailwindLintOptions {
|
|
20
|
+
/** CSS file containing `@import "tailwindcss"`, relative to the consumer root. */
|
|
21
|
+
entryPoint: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Independent fragment for Vue consumers of Tailwind v4.
|
|
25
|
+
*
|
|
26
|
+
* Merge each field into the Vue preset. A plain `{ ...vueLintPreset(), ...tailwindLintPreset() }`
|
|
27
|
+
* replaces `jsPlugins`, `rules`, and `settings`, so the Vize rules and `oxlint-plugin-vize` disappear.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const vue = vueLintPreset();
|
|
32
|
+
* const tailwind = tailwindLintPreset({ entryPoint: "src/styles.css" });
|
|
33
|
+
* const lint = {
|
|
34
|
+
* ...vue,
|
|
35
|
+
* jsPlugins: [...(vue.jsPlugins ?? []), ...(tailwind.jsPlugins ?? [])],
|
|
36
|
+
* rules: { ...vue.rules, ...tailwind.rules },
|
|
37
|
+
* settings: { ...vue.settings, ...tailwind.settings },
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function tailwindLintPreset({ entryPoint }: TailwindLintOptions): OxlintConfig;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { typescriptLintPreset } from "@toruslabs/oxlint-config-typescript";
|
|
2
|
+
import { createVizeLintConfig } from "oxlint-plugin-vize";
|
|
3
|
+
// index.ts
|
|
4
|
+
/** Vize template rules that fixture tests prove through `vp lint`. Add a fixture before you add a rule. */
|
|
5
|
+
const vueTemplateRules = {
|
|
6
|
+
"vize/vue/no-duplicate-attributes": "error",
|
|
7
|
+
"vize/vue/no-mutating-props": "error",
|
|
8
|
+
"vize/vue/no-use-v-if-with-v-for": "warn",
|
|
9
|
+
"vize/vue/require-v-for-key": "error",
|
|
10
|
+
"vize/vue/valid-v-for": "error",
|
|
11
|
+
"vize/vue/valid-v-if": "error",
|
|
12
|
+
"vize/vue/valid-v-model": "error",
|
|
13
|
+
"vize/vue/valid-v-on": "error"
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Vue preset for `.vue` files that have a script block.
|
|
17
|
+
*
|
|
18
|
+
* `vp lint` and `vp check` can skip a `.vue` file with no script block, so template-only files need a separate task.
|
|
19
|
+
*/
|
|
20
|
+
function vueLintPreset() {
|
|
21
|
+
const base = typescriptLintPreset();
|
|
22
|
+
const vize = createVizeLintConfig({
|
|
23
|
+
preset: "incremental",
|
|
24
|
+
plugins: [...base.plugins ?? [], "vue"],
|
|
25
|
+
rules: vueTemplateRules
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
...base,
|
|
29
|
+
plugins: vize.plugins,
|
|
30
|
+
jsPlugins: [...base.jsPlugins ?? [], ...vize.jsPlugins ?? []],
|
|
31
|
+
rules: {
|
|
32
|
+
...base.rules,
|
|
33
|
+
...vize.rules,
|
|
34
|
+
"no-unused-vars": ["error", {
|
|
35
|
+
args: "all",
|
|
36
|
+
argsIgnorePattern: "^_",
|
|
37
|
+
caughtErrors: "all",
|
|
38
|
+
caughtErrorsIgnorePattern: "^_",
|
|
39
|
+
destructuredArrayIgnorePattern: "^_",
|
|
40
|
+
varsIgnorePattern: "^_",
|
|
41
|
+
ignoreRestSiblings: true
|
|
42
|
+
}]
|
|
43
|
+
},
|
|
44
|
+
settings: {
|
|
45
|
+
...base.settings,
|
|
46
|
+
...vize.settings
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Independent fragment for Vue consumers of Tailwind v4.
|
|
52
|
+
*
|
|
53
|
+
* Merge each field into the Vue preset. A plain `{ ...vueLintPreset(), ...tailwindLintPreset() }`
|
|
54
|
+
* replaces `jsPlugins`, `rules`, and `settings`, so the Vize rules and `oxlint-plugin-vize` disappear.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const vue = vueLintPreset();
|
|
59
|
+
* const tailwind = tailwindLintPreset({ entryPoint: "src/styles.css" });
|
|
60
|
+
* const lint = {
|
|
61
|
+
* ...vue,
|
|
62
|
+
* jsPlugins: [...(vue.jsPlugins ?? []), ...(tailwind.jsPlugins ?? [])],
|
|
63
|
+
* rules: { ...vue.rules, ...tailwind.rules },
|
|
64
|
+
* settings: { ...vue.settings, ...tailwind.settings },
|
|
65
|
+
* };
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
function tailwindLintPreset({ entryPoint }) {
|
|
69
|
+
if (!entryPoint.trim()) throw new Error("Tailwind lint requires a CSS entry point");
|
|
70
|
+
return {
|
|
71
|
+
jsPlugins: ["oxlint-tailwindcss"],
|
|
72
|
+
settings: { tailwindcss: { entryPoint } },
|
|
73
|
+
rules: {
|
|
74
|
+
"tailwindcss/no-conflicting-classes": "error",
|
|
75
|
+
"tailwindcss/no-duplicate-classes": "warn",
|
|
76
|
+
"tailwindcss/no-unknown-classes": "error",
|
|
77
|
+
"tailwindcss/no-deprecated-classes": "error"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export { tailwindLintPreset, vueLintPreset, vueTemplateRules };
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toruslabs/oxlint-config-vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Oxlint Vue and Vize preset for Torus libraries",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "vp pack",
|
|
11
|
+
"prepack": "vp pack"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.mts",
|
|
16
|
+
"import": "./dist/index.mjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@toruslabs/oxlint-config-typescript": "^1.1.1"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"vite-plus": "^1.0.0",
|
|
24
|
+
"oxlint-plugin-vize": "^0.812.0",
|
|
25
|
+
"oxlint-tailwindcss": "^1.17.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"oxlint-tailwindcss": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=24.15.0",
|
|
37
|
+
"npm": ">=12"
|
|
38
|
+
},
|
|
39
|
+
"author": "Torus Labs",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/torusresearch/torus-cli.git"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/README.md
DELETED