@kasoa/vite-plus-config 0.0.4 → 0.0.6
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/{base-DQPAhIs8.mjs → base-BebrFWhM.mjs} +29 -26
- package/dist/base-BebrFWhM.mjs.map +1 -0
- package/dist/constants-D0-yewhF.mjs +14 -0
- package/dist/constants-D0-yewhF.mjs.map +1 -0
- package/dist/src/base/index.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/library/index.mjs +1 -1
- package/dist/src/monorepo/index.mjs +1 -1
- package/dist/src/react/index.mjs +1 -1
- package/dist/src/server/index.mjs +1 -1
- package/dist/src/test/cloudflare-workers/index.mjs +1 -1
- package/package.json +4 -7
- package/dist/base-DQPAhIs8.mjs.map +0 -1
- package/dist/constants-CGGN7b-7.mjs +0 -9
- package/dist/constants-CGGN7b-7.mjs.map +0 -1
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { n as DEFAULT_STAGED_CHECK_GLOB, r as DEFAULT_TEST_INCLUDE, t as DEFAULT_STAGED_CHECK_COMMAND } from "./constants-
|
|
1
|
+
import { a as GENERATED_FILE_IGNORE_PATTERNS, n as DEFAULT_STAGED_CHECK_GLOB, r as DEFAULT_TEST_INCLUDE, t as DEFAULT_STAGED_CHECK_COMMAND } from "./constants-D0-yewhF.mjs";
|
|
2
2
|
import { defineConfig } from "vite-plus";
|
|
3
|
-
import { defineConfig as defineConfig$1 } from "oxfmt";
|
|
4
3
|
//#region src/shared/fmt.ts
|
|
5
|
-
const baseFmt =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
4
|
+
const baseFmt = {
|
|
5
|
+
ignorePatterns: [...GENERATED_FILE_IGNORE_PATTERNS],
|
|
6
|
+
sortImports: {
|
|
7
|
+
internalPattern: ["#", "@/"],
|
|
8
|
+
newlinesBetween: false,
|
|
9
|
+
groups: [
|
|
10
|
+
"type-import",
|
|
11
|
+
["value-builtin", "value-external"],
|
|
12
|
+
"type-internal",
|
|
13
|
+
"value-internal",
|
|
14
|
+
[
|
|
15
|
+
"type-parent",
|
|
16
|
+
"type-sibling",
|
|
17
|
+
"type-index"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"value-parent",
|
|
21
|
+
"value-sibling",
|
|
22
|
+
"value-index"
|
|
23
|
+
],
|
|
24
|
+
"unknown"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const reactFmt = {
|
|
27
29
|
...baseFmt,
|
|
28
30
|
sortTailwindcss: {
|
|
29
31
|
attributes: ["/.*ClassName/"],
|
|
30
32
|
functions: ["tv"]
|
|
31
33
|
}
|
|
32
|
-
}
|
|
34
|
+
};
|
|
33
35
|
//#endregion
|
|
34
36
|
//#region src/shared/lint.ts
|
|
35
37
|
const BASE_LINT_PLUGINS = [
|
|
@@ -41,6 +43,7 @@ const BASE_LINT_PLUGINS = [
|
|
|
41
43
|
];
|
|
42
44
|
const baseLint = {
|
|
43
45
|
plugins: [...BASE_LINT_PLUGINS],
|
|
46
|
+
ignorePatterns: [...GENERATED_FILE_IGNORE_PATTERNS],
|
|
44
47
|
env: {
|
|
45
48
|
serviceworker: true,
|
|
46
49
|
worker: true
|
|
@@ -247,4 +250,4 @@ const base = defineConfig({
|
|
|
247
250
|
//#endregion
|
|
248
251
|
export { reactFmt as i, reactLint as n, serverLint as r, base as t };
|
|
249
252
|
|
|
250
|
-
//# sourceMappingURL=base-
|
|
253
|
+
//# sourceMappingURL=base-BebrFWhM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-BebrFWhM.mjs","names":[],"sources":["../src/shared/fmt.ts","../src/shared/lint.ts","../src/base/index.ts"],"sourcesContent":["import type { UserConfig } from \"vite-plus\";\nimport { GENERATED_FILE_IGNORE_PATTERNS } from \"./constants.ts\";\n\ntype FmtConfig = NonNullable<UserConfig[\"fmt\"]>;\n\nexport const baseFmt = {\n ignorePatterns: [...GENERATED_FILE_IGNORE_PATTERNS],\n sortImports: {\n internalPattern: [\"#\", \"@/\"],\n newlinesBetween: false,\n groups: [\n \"type-import\",\n [\"value-builtin\", \"value-external\"],\n \"type-internal\",\n \"value-internal\",\n [\"type-parent\", \"type-sibling\", \"type-index\"],\n [\"value-parent\", \"value-sibling\", \"value-index\"],\n \"unknown\",\n ],\n },\n} satisfies FmtConfig;\n\nexport const reactFmt = {\n ...baseFmt,\n sortTailwindcss: {\n attributes: [\"/.*ClassName/\"],\n functions: [\"tv\"],\n },\n} satisfies FmtConfig;\n","import type { UserConfig } from \"vite-plus\";\nimport { GENERATED_FILE_IGNORE_PATTERNS } from \"./constants.ts\";\n\nexport const BASE_LINT_PLUGINS = [\"typescript\", \"unicorn\", \"oxc\", \"import\", \"promise\"] as const;\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst baseLintConfig: LintConfig = {\n plugins: [...BASE_LINT_PLUGINS],\n ignorePatterns: [...GENERATED_FILE_IGNORE_PATTERNS],\n env: {\n serviceworker: true,\n worker: true,\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n },\n rules: {\n \"capitalized-comments\": \"off\",\n \"func-style\": \"off\",\n \"id-length\": \"off\",\n \"init-declarations\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-continue\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-ternary\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"vars-on-top\": \"off\",\n\n complexity: [\"error\", { max: 20 }],\n curly: [\"error\", \"multi-line\", \"consistent\"],\n \"default-case-last\": \"error\",\n eqeqeq: \"error\",\n \"getter-return\": \"error\",\n \"grouped-accessor-pairs\": [\"error\", \"getBeforeSet\"],\n \"max-depth\": [\"error\", { max: 3 }],\n \"max-nested-callbacks\": [\"error\", { max: 3 }],\n \"max-params\": [\"error\", { max: 3 }],\n \"new-cap\": \"off\",\n \"no-alert\": \"error\",\n \"no-bitwise\": \"error\",\n \"no-console\": [\"error\", { allow: [\"info\", \"warn\", \"error\"] }],\n \"no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"no-param-reassign\": [\"error\", { props: true }],\n \"no-plusplus\": \"error\",\n \"no-undef\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n \"no-unreachable\": \"error\",\n \"no-useless-return\": \"error\",\n \"prefer-template\": \"error\",\n\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/no-anonymous-default-export\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-namespace\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/no-cycle\": \"error\",\n\n \"promise/prefer-await-to-callbacks\": \"off\",\n\n \"typescript/ban-ts-comment\": [\"error\", { minimumDescriptionLength: 10 }],\n \"typescript/consistent-type-definitions\": \"off\",\n \"typescript/consistent-return\": \"error\",\n \"typescript/consistent-type-exports\": \"error\",\n \"typescript/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\", fixStyle: \"separate-type-imports\" },\n ],\n \"typescript/dot-notation\": \"error\",\n \"typescript/no-confusing-void-expression\": \"error\",\n \"typescript/no-dynamic-delete\": \"error\",\n \"typescript/no-explicit-any\": \"error\",\n \"typescript/no-floating-promises\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/no-misused-spread\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/no-require-imports\": \"error\",\n \"typescript/no-unnecessary-condition\": \"error\",\n \"typescript/no-unnecessary-qualifier\": \"error\",\n \"typescript/no-unnecessary-type-arguments\": \"error\",\n \"typescript/no-unnecessary-type-assertion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/non-nullable-type-assertion-style\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-find\": \"error\",\n \"typescript/prefer-nullish-coalescing\": \"error\",\n \"typescript/prefer-optional-chain\": \"error\",\n \"typescript/prefer-readonly\": \"error\",\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/require-await\": \"off\",\n \"typescript/require-array-sort-compare\": \"error\",\n \"typescript/restrict-plus-operands\": \"error\",\n \"typescript/restrict-template-expressions\": \"error\",\n \"typescript/return-await\": \"error\",\n \"typescript/strict-boolean-expressions\": \"error\",\n \"typescript/strict-void-return\": \"error\",\n \"typescript/switch-exhaustiveness-check\": \"error\",\n \"typescript/unbound-method\": \"error\",\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n\n \"unicorn/no-null\": \"off\",\n \"unicorn/no-abusive-eslint-disable\": \"error\",\n \"unicorn/filename-case\": [\"error\", { case: \"kebabCase\" }],\n },\n overrides: [\n {\n files: [\"**/*.{cjs,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"typescript/no-require-imports\": \"off\",\n },\n },\n {\n files: [\"**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"func-names\": \"off\",\n },\n },\n {\n files: [\"**/*.d.ts\"],\n rules: {\n \"typescript/no-empty-interface\": \"off\",\n },\n },\n {\n files: [\n \"**/test/**\",\n \"**/tests/**\",\n \"**/__tests__/**\",\n \"**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\",\n ],\n plugins: [...BASE_LINT_PLUGINS, \"vitest\"],\n env: {\n vitest: true,\n },\n rules: {\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/max-nested-describe\": [\"error\", { max: 3 }],\n },\n },\n ],\n};\n\nexport const baseLint: LintConfig = baseLintConfig;\n\nconst reactLintConfig: LintConfig = {\n ...baseLint,\n plugins: [...(baseLint.plugins ?? []), \"react\", \"jsx-a11y\"],\n rules: {\n ...baseLint.rules,\n \"jsx-a11y/alt-text\": \"error\",\n\n \"react/jsx-props-no-spreading\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"react/exhaustive-deps\": \"error\",\n \"react/jsx-key\": \"error\",\n \"react/jsx-max-depth\": [\"error\", { max: 4 }],\n \"react/jsx-no-constructed-context-values\": \"error\",\n \"react/jsx-no-duplicate-props\": \"error\",\n \"react/jsx-no-undef\": \"error\",\n \"react/no-array-index-key\": \"error\",\n \"react/no-children-prop\": \"error\",\n \"react/no-clone-element\": \"error\",\n \"react/no-danger\": \"error\",\n \"react/no-danger-with-children\": \"error\",\n \"react/no-direct-mutation-state\": \"error\",\n \"react/no-find-dom-node\": \"error\",\n \"react/no-react-children\": \"error\",\n \"react/no-string-refs\": \"error\",\n \"react/style-prop-object\": \"off\",\n \"react/no-unsafe\": \"error\",\n \"react/no-unknown-property\": \"error\",\n \"react/void-dom-elements-no-children\": \"error\",\n },\n};\n\nexport const reactLint: LintConfig = reactLintConfig;\n\nconst serverLintConfig: LintConfig = {\n ...baseLint,\n plugins: [...(baseLint.plugins ?? []), \"node\"],\n globals: {\n ...baseLint.globals,\n WebSocketPair: \"readonly\",\n },\n rules: {\n ...baseLint.rules,\n \"node/no-exports-assign\": \"error\",\n },\n};\n\nexport const serverLint: LintConfig = serverLintConfig;\n","import type { UserConfig } from \"vite-plus\";\nimport { defineConfig } from \"vite-plus\";\nimport {\n DEFAULT_STAGED_CHECK_COMMAND,\n DEFAULT_STAGED_CHECK_GLOB,\n DEFAULT_TEST_INCLUDE,\n} from \"../shared/constants.ts\";\nimport { baseFmt } from \"../shared/fmt.ts\";\nimport { baseLint } from \"../shared/lint.ts\";\n\nexport const base: UserConfig = defineConfig({\n fmt: baseFmt,\n lint: baseLint,\n test: {\n include: [...DEFAULT_TEST_INCLUDE],\n },\n staged: {\n [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND,\n },\n});\n"],"mappings":";;;AAKA,MAAa,UAAU;CACrB,gBAAgB,CAAC,GAAG,+BAA+B;CACnD,aAAa;EACX,iBAAiB,CAAC,KAAK,KAAK;EAC5B,iBAAiB;EACjB,QAAQ;GACN;GACA,CAAC,iBAAiB,iBAAiB;GACnC;GACA;GACA;IAAC;IAAe;IAAgB;IAAa;GAC7C;IAAC;IAAgB;IAAiB;IAAc;GAChD;GACD;EACF;CACF;AAED,MAAa,WAAW;CACtB,GAAG;CACH,iBAAiB;EACf,YAAY,CAAC,gBAAgB;EAC7B,WAAW,CAAC,KAAK;EAClB;CACF;;;ACzBD,MAAa,oBAAoB;CAAC;CAAc;CAAW;CAAO;CAAU;CAAU;AAuKtF,MAAa,WAnKsB;CACjC,SAAS,CAAC,GAAG,kBAAkB;CAC/B,gBAAgB,CAAC,GAAG,+BAA+B;CACnD,KAAK;EACH,eAAe;EACf,QAAQ;EACT;CACD,SAAS;EACP,+BAA+B;EAC/B,WAAW;EACX,WAAW;EACZ;CACD,YAAY;EACV,aAAa;EACb,YAAY;EACZ,UAAU;EACV,MAAM;EACN,OAAO;EACR;CACD,OAAO;EACL,wBAAwB;EACxB,cAAc;EACd,aAAa;EACb,qBAAqB;EACrB,wBAAwB;EACxB,0BAA0B;EAC1B,kBAAkB;EAClB,eAAe;EACf,oBAAoB;EACpB,cAAc;EACd,iBAAiB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;EAC3B,wBAAwB;EACxB,2BAA2B;EAC3B,mBAAmB;EACnB,6BAA6B;EAC7B,uCAAuC;EACxC;CACF;AAiBD,MAAa,aAbwB;CACnC,GAAG;CACH,SAAS,CAAC,GAAI,SAAS,WAAW,EAAE,EAAG,OAAO;CAC9C,SAAS;EACP,GAAG,SAAS;EACZ,eAAe;EAChB;CACD,OAAO;EACL,GAAG,SAAS;EACZ,0BAA0B;EAC3B;CACF;;;AC9MD,MAAa,OAAmB,aAAa;CAC3C,KAAK;CACL,MAAM;CACN,MAAM,EACJ,SAAS,CAAC,GAAG,qBAAqB,EACnC;CACD,QAAQ,GACL,4BAA4B,8BAC9B;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/shared/constants.ts
|
|
2
|
+
const DEFAULT_TEST_INCLUDE = ["**/*.{test,spec}.{ts,tsx,mts,cts}"];
|
|
3
|
+
const GENERATED_FILE_IGNORE_PATTERNS = [
|
|
4
|
+
"**/worker-configuration.d.ts",
|
|
5
|
+
"**/drizzle/migrations.js",
|
|
6
|
+
"**/drizzle/meta/*.json"
|
|
7
|
+
];
|
|
8
|
+
const DEFAULT_STAGED_CHECK_GLOB = "*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}";
|
|
9
|
+
const DEFAULT_STAGED_CHECK_COMMAND = "vp check --fix";
|
|
10
|
+
const DEFAULT_WRANGLER_CONFIG_PATH = "./wrangler.jsonc";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { GENERATED_FILE_IGNORE_PATTERNS as a, DEFAULT_WRANGLER_CONFIG_PATH as i, DEFAULT_STAGED_CHECK_GLOB as n, DEFAULT_TEST_INCLUDE as r, DEFAULT_STAGED_CHECK_COMMAND as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=constants-D0-yewhF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-D0-yewhF.mjs","names":[],"sources":["../src/shared/constants.ts"],"sourcesContent":["export const DEFAULT_TEST_INCLUDE = [\"**/*.{test,spec}.{ts,tsx,mts,cts}\"] as const;\nexport const GENERATED_FILE_IGNORE_PATTERNS = [\n \"**/worker-configuration.d.ts\",\n \"**/drizzle/migrations.js\",\n \"**/drizzle/meta/*.json\",\n] as const;\n\nexport const DEFAULT_STAGED_CHECK_GLOB = \"*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\";\nexport const DEFAULT_STAGED_CHECK_COMMAND = \"vp check --fix\";\nexport const DEFAULT_WRANGLER_CONFIG_PATH = \"./wrangler.jsonc\";\n"],"mappings":";AAAA,MAAa,uBAAuB,CAAC,oCAAoC;AACzE,MAAa,iCAAiC;CAC5C;CACA;CACA;CACD;AAED,MAAa,4BAA4B;AACzC,MAAa,+BAA+B;AAC5C,MAAa,+BAA+B"}
|
package/dist/src/base/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as base } from "../../base-
|
|
1
|
+
import { t as base } from "../../base-BebrFWhM.mjs";
|
|
2
2
|
export { base };
|
package/dist/src/index.mjs
CHANGED
package/dist/src/react/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as reactFmt, n as reactLint, t as base } from "../../base-
|
|
1
|
+
import { i as reactFmt, n as reactLint, t as base } from "../../base-BebrFWhM.mjs";
|
|
2
2
|
import { defineConfig } from "vite-plus";
|
|
3
3
|
//#region src/react/index.ts
|
|
4
4
|
const react = defineConfig({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DEFAULT_WRANGLER_CONFIG_PATH, r as DEFAULT_TEST_INCLUDE } from "../../../constants-
|
|
1
|
+
import { i as DEFAULT_WRANGLER_CONFIG_PATH, r as DEFAULT_TEST_INCLUDE } from "../../../constants-D0-yewhF.mjs";
|
|
2
2
|
import { defineConfig } from "vite-plus";
|
|
3
3
|
import { cloudflareTest } from "@cloudflare/vitest-pool-workers";
|
|
4
4
|
//#region src/test/cloudflare-workers/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kasoa/vite-plus-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Kasoa's Vite+ configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -62,14 +62,11 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@cloudflare/vitest-pool-workers": "^0.13.
|
|
65
|
+
"@cloudflare/vitest-pool-workers": "^0.13.5",
|
|
66
66
|
"@types/node": "^25.5.0",
|
|
67
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
68
|
-
"oxfmt": "^0.42.0",
|
|
69
|
-
"oxlint": "^1.57.0",
|
|
70
|
-
"oxlint-tsgolint": "^0.17.3",
|
|
67
|
+
"@typescript/native-preview": "^7.0.0-dev.20260327.2",
|
|
71
68
|
"vite-plus": "^0.1.14",
|
|
72
|
-
"wrangler": "^4.
|
|
69
|
+
"wrangler": "^4.78.0"
|
|
73
70
|
},
|
|
74
71
|
"peerDependencies": {
|
|
75
72
|
"@cloudflare/vitest-pool-workers": ">=0.13.0 <1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-DQPAhIs8.mjs","names":["defineConfig"],"sources":["../src/shared/fmt.ts","../src/shared/lint.ts","../src/base/index.ts"],"sourcesContent":["import { defineConfig } from \"oxfmt\";\n\nexport const baseFmt = defineConfig({\n sortImports: {\n internalPattern: [\"#\", \"@/\"],\n newlinesBetween: false,\n groups: [\n \"type-import\",\n [\"value-builtin\", \"value-external\"],\n \"type-internal\",\n \"value-internal\",\n [\"type-parent\", \"type-sibling\", \"type-index\"],\n [\"value-parent\", \"value-sibling\", \"value-index\"],\n \"unknown\",\n ],\n },\n});\n\nexport const reactFmt = defineConfig({\n ...baseFmt,\n sortTailwindcss: {\n attributes: [\"/.*ClassName/\"],\n functions: [\"tv\"],\n },\n});\n","import type { OxlintConfig } from \"oxlint\";\n\nexport const BASE_LINT_PLUGINS = [\"typescript\", \"unicorn\", \"oxc\", \"import\", \"promise\"] as const;\n\nconst baseLintConfig: OxlintConfig = {\n plugins: [...BASE_LINT_PLUGINS],\n env: {\n serviceworker: true,\n worker: true,\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n },\n rules: {\n \"capitalized-comments\": \"off\",\n \"func-style\": \"off\",\n \"id-length\": \"off\",\n \"init-declarations\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-continue\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-ternary\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"vars-on-top\": \"off\",\n\n complexity: [\"error\", { max: 20 }],\n curly: [\"error\", \"multi-line\", \"consistent\"],\n \"default-case-last\": \"error\",\n eqeqeq: \"error\",\n \"getter-return\": \"error\",\n \"grouped-accessor-pairs\": [\"error\", \"getBeforeSet\"],\n \"max-depth\": [\"error\", { max: 3 }],\n \"max-nested-callbacks\": [\"error\", { max: 3 }],\n \"max-params\": [\"error\", { max: 3 }],\n \"new-cap\": \"off\",\n \"no-alert\": \"error\",\n \"no-bitwise\": \"error\",\n \"no-console\": [\"error\", { allow: [\"info\", \"warn\", \"error\"] }],\n \"no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"no-param-reassign\": [\"error\", { props: true }],\n \"no-plusplus\": \"error\",\n \"no-undef\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n \"no-unreachable\": \"error\",\n \"no-useless-return\": \"error\",\n \"prefer-template\": \"error\",\n\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/no-anonymous-default-export\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-namespace\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/no-unassigned-import\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/no-cycle\": \"error\",\n\n \"promise/prefer-await-to-callbacks\": \"off\",\n\n \"typescript/ban-ts-comment\": [\"error\", { minimumDescriptionLength: 10 }],\n \"typescript/consistent-type-definitions\": \"off\",\n \"typescript/consistent-return\": \"error\",\n \"typescript/consistent-type-exports\": \"error\",\n \"typescript/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\", fixStyle: \"separate-type-imports\" },\n ],\n \"typescript/dot-notation\": \"error\",\n \"typescript/no-confusing-void-expression\": \"error\",\n \"typescript/no-dynamic-delete\": \"error\",\n \"typescript/no-explicit-any\": \"error\",\n \"typescript/no-floating-promises\": \"error\",\n \"typescript/no-misused-promises\": \"error\",\n \"typescript/no-misused-spread\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/no-require-imports\": \"error\",\n \"typescript/no-unnecessary-condition\": \"error\",\n \"typescript/no-unnecessary-qualifier\": \"error\",\n \"typescript/no-unnecessary-type-arguments\": \"error\",\n \"typescript/no-unnecessary-type-assertion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/non-nullable-type-assertion-style\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-find\": \"error\",\n \"typescript/prefer-nullish-coalescing\": \"error\",\n \"typescript/prefer-optional-chain\": \"error\",\n \"typescript/prefer-readonly\": \"error\",\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/require-await\": \"off\",\n \"typescript/require-array-sort-compare\": \"error\",\n \"typescript/restrict-plus-operands\": \"error\",\n \"typescript/restrict-template-expressions\": \"error\",\n \"typescript/return-await\": \"error\",\n \"typescript/strict-boolean-expressions\": \"error\",\n \"typescript/strict-void-return\": \"error\",\n \"typescript/switch-exhaustiveness-check\": \"error\",\n \"typescript/unbound-method\": \"error\",\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n\n \"unicorn/no-null\": \"off\",\n \"unicorn/no-abusive-eslint-disable\": \"error\",\n \"unicorn/filename-case\": [\"error\", { case: \"kebabCase\" }],\n },\n overrides: [\n {\n files: [\"**/*.{cjs,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"typescript/no-require-imports\": \"off\",\n },\n },\n {\n files: [\"**/*.config.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\"],\n env: {\n node: true,\n },\n rules: {\n \"func-names\": \"off\",\n },\n },\n {\n files: [\"**/*.d.ts\"],\n rules: {\n \"typescript/no-empty-interface\": \"off\",\n },\n },\n {\n files: [\n \"**/test/**\",\n \"**/tests/**\",\n \"**/__tests__/**\",\n \"**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\",\n ],\n plugins: [...BASE_LINT_PLUGINS, \"vitest\"],\n env: {\n vitest: true,\n },\n rules: {\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/max-nested-describe\": [\"error\", { max: 3 }],\n },\n },\n ],\n};\n\nexport const baseLint: OxlintConfig = baseLintConfig;\n\nconst reactLintConfig: OxlintConfig = {\n ...baseLint,\n plugins: [...(baseLint.plugins ?? []), \"react\", \"jsx-a11y\"],\n rules: {\n ...baseLint.rules,\n \"jsx-a11y/alt-text\": \"error\",\n\n \"react/jsx-props-no-spreading\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"react/exhaustive-deps\": \"error\",\n \"react/jsx-key\": \"error\",\n \"react/jsx-max-depth\": [\"error\", { max: 4 }],\n \"react/jsx-no-constructed-context-values\": \"error\",\n \"react/jsx-no-duplicate-props\": \"error\",\n \"react/jsx-no-undef\": \"error\",\n \"react/no-array-index-key\": \"error\",\n \"react/no-children-prop\": \"error\",\n \"react/no-clone-element\": \"error\",\n \"react/no-danger\": \"error\",\n \"react/no-danger-with-children\": \"error\",\n \"react/no-direct-mutation-state\": \"error\",\n \"react/no-find-dom-node\": \"error\",\n \"react/no-react-children\": \"error\",\n \"react/no-string-refs\": \"error\",\n \"react/style-prop-object\": \"off\",\n \"react/no-unsafe\": \"error\",\n \"react/no-unknown-property\": \"error\",\n \"react/void-dom-elements-no-children\": \"error\",\n },\n};\n\nexport const reactLint: OxlintConfig = reactLintConfig;\n\nconst serverLintConfig: OxlintConfig = {\n ...baseLint,\n plugins: [...(baseLint.plugins ?? []), \"node\"],\n globals: {\n ...baseLint.globals,\n WebSocketPair: \"readonly\",\n },\n rules: {\n ...baseLint.rules,\n \"node/no-exports-assign\": \"error\",\n },\n};\n\nexport const serverLint: OxlintConfig = serverLintConfig;\n","import type { UserConfig } from \"vite-plus\";\nimport { defineConfig } from \"vite-plus\";\nimport {\n DEFAULT_STAGED_CHECK_COMMAND,\n DEFAULT_STAGED_CHECK_GLOB,\n DEFAULT_TEST_INCLUDE,\n} from \"../shared/constants.ts\";\nimport { baseFmt } from \"../shared/fmt.ts\";\nimport { baseLint } from \"../shared/lint.ts\";\n\nexport const base: UserConfig = defineConfig({\n fmt: baseFmt,\n lint: baseLint,\n test: {\n include: [...DEFAULT_TEST_INCLUDE],\n },\n staged: {\n [DEFAULT_STAGED_CHECK_GLOB]: DEFAULT_STAGED_CHECK_COMMAND,\n },\n});\n"],"mappings":";;;;AAEA,MAAa,UAAUA,eAAa,EAClC,aAAa;CACX,iBAAiB,CAAC,KAAK,KAAK;CAC5B,iBAAiB;CACjB,QAAQ;EACN;EACA,CAAC,iBAAiB,iBAAiB;EACnC;EACA;EACA;GAAC;GAAe;GAAgB;GAAa;EAC7C;GAAC;GAAgB;GAAiB;GAAc;EAChD;EACD;CACF,EACF,CAAC;AAEF,MAAa,WAAWA,eAAa;CACnC,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ACH,QAAQ,MACT;GACD,OAAO;IACL,sCAAsC;IACtC,8BAA8B,CAAC,SAAS,EAAE,KAAK,GAAG,CAAC;IACpD;GACF;EACF;CACF;AAmCD,MAAa,YA/ByB;CACpC,GAAG;CACH,SAAS;EAAC,GAAI,SAAS,WAAW,EAAE;EAAG;EAAS;EAAW;CAC3D,OAAO;EACL,GAAG,SAAS;EACZ,qBAAqB;EAErB,gCAAgC;EAChC,4BAA4B;EAC5B,yBAAyB;EACzB,iBAAiB;EACjB,uBAAuB,CAAC,SAAS,EAAE,KAAK,GAAG,CAAC;EAC5C,2CAA2C;EAC3C,gCAAgC;EAChC,sBAAsB;EACtB,4BAA4B;EAC5B,0BAA0B;EAC1B,0BAA0B;EAC1B,mBAAmB;EACnB,iCAAiC;EACjC,kCAAkC;EAClC,0BAA0B;EAC1B,2BAA2B;EAC3B,wBAAwB;EACxB,2BAA2B;EAC3B,mBAAmB;EACnB,6BAA6B;EAC7B,uCAAuC;EACxC;CACF;AAiBD,MAAa,aAb0B;CACrC,GAAG;CACH,SAAS,CAAC,GAAI,SAAS,WAAW,EAAE,EAAG,OAAO;CAC9C,SAAS;EACP,GAAG,SAAS;EACZ,eAAe;EAChB;CACD,OAAO;EACL,GAAG,SAAS;EACZ,0BAA0B;EAC3B;CACF;;;AC1MD,MAAa,OAAmB,aAAa;CAC3C,KAAK;CACL,MAAM;CACN,MAAM,EACJ,SAAS,CAAC,GAAG,qBAAqB,EACnC;CACD,QAAQ,GACL,4BAA4B,8BAC9B;CACF,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/shared/constants.ts
|
|
2
|
-
const DEFAULT_TEST_INCLUDE = ["**/*.{test,spec}.{ts,tsx,mts,cts}"];
|
|
3
|
-
const DEFAULT_STAGED_CHECK_GLOB = "*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}";
|
|
4
|
-
const DEFAULT_STAGED_CHECK_COMMAND = "vp check --fix";
|
|
5
|
-
const DEFAULT_WRANGLER_CONFIG_PATH = "./wrangler.jsonc";
|
|
6
|
-
//#endregion
|
|
7
|
-
export { DEFAULT_WRANGLER_CONFIG_PATH as i, DEFAULT_STAGED_CHECK_GLOB as n, DEFAULT_TEST_INCLUDE as r, DEFAULT_STAGED_CHECK_COMMAND as t };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=constants-CGGN7b-7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-CGGN7b-7.mjs","names":[],"sources":["../src/shared/constants.ts"],"sourcesContent":["export const DEFAULT_TEST_INCLUDE = [\"**/*.{test,spec}.{ts,tsx,mts,cts}\"] as const;\n\nexport const DEFAULT_STAGED_CHECK_GLOB = \"*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}\";\nexport const DEFAULT_STAGED_CHECK_COMMAND = \"vp check --fix\";\nexport const DEFAULT_WRANGLER_CONFIG_PATH = \"./wrangler.jsonc\";\n"],"mappings":";AAAA,MAAa,uBAAuB,CAAC,oCAAoC;AAEzE,MAAa,4BAA4B;AACzC,MAAa,+BAA+B;AAC5C,MAAa,+BAA+B"}
|