js-style-kit 0.1.4 → 0.1.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/README.md +18 -0
- package/dist/{chunk-SIH4WAXK.js → chunk-2DEE5IMM.js} +2 -2
- package/dist/chunk-3A7OYQSX.js +45 -0
- package/dist/chunk-3A7OYQSX.js.map +1 -0
- package/dist/{chunk-3JDYGS77.js → chunk-4JICVSDT.js} +2 -2
- package/dist/{chunk-HLX2OWWB.js → chunk-67I7QCZW.js} +2 -2
- package/dist/{chunk-VF7D6J7C.js → chunk-67MZ7HGN.js} +2 -2
- package/dist/{chunk-VWKQSLJR.js → chunk-D3SKAD35.js} +37 -10
- package/dist/chunk-D3SKAD35.js.map +1 -0
- package/dist/{chunk-IZXVPZVW.js → chunk-GMXUFYEC.js} +2 -2
- package/dist/{chunk-OPQZGCVL.js → chunk-H2WBGBO4.js} +2 -2
- package/dist/{chunk-GBJI557O.js → chunk-IDOXOS33.js} +2 -2
- package/dist/{chunk-XXWXCIGZ.js → chunk-LODDGOPW.js} +2 -1
- package/dist/{chunk-XXWXCIGZ.js.map → chunk-LODDGOPW.js.map} +1 -1
- package/dist/{chunk-Y4XKZK6J.js → chunk-LQQAQ4PJ.js} +73 -38
- package/dist/chunk-LQQAQ4PJ.js.map +1 -0
- package/dist/{chunk-LGB33CUY.js → chunk-MICOVBJ4.js} +2 -2
- package/dist/chunk-PHFQMAHS.js +51 -0
- package/dist/chunk-PHFQMAHS.js.map +1 -0
- package/dist/chunk-V34MGXE7.js +68 -0
- package/dist/chunk-V34MGXE7.js.map +1 -0
- package/dist/eslint/base/config.js +2 -2
- package/dist/eslint/constants.d.ts +1 -0
- package/dist/eslint/constants.js +1 -1
- package/dist/eslint/ignores.js +2 -2
- package/dist/eslint/index.d.ts +9 -1
- package/dist/eslint/index.js +14 -11
- package/dist/eslint/index.test.js +159 -24
- package/dist/eslint/index.test.js.map +1 -1
- package/dist/eslint/jsdoc/config.js +2 -2
- package/dist/eslint/perfectionist/config.js +2 -2
- package/dist/eslint/prefer-arrow-function/config.js +2 -2
- package/dist/eslint/react/config.js +2 -2
- package/dist/eslint/react-compiler/config.js +2 -2
- package/dist/eslint/testing/config.d.ts +25 -0
- package/dist/eslint/testing/config.js +11 -0
- package/dist/eslint/testing/config.js.map +1 -0
- package/dist/eslint/testing/config.test.d.ts +2 -0
- package/dist/eslint/testing/config.test.js +124 -0
- package/dist/eslint/testing/config.test.js.map +1 -0
- package/dist/eslint/testing/jestRules.d.ts +14 -0
- package/dist/eslint/testing/jestRules.js +8 -0
- package/dist/eslint/testing/jestRules.js.map +1 -0
- package/dist/eslint/testing/vitestRules.d.ts +14 -0
- package/dist/eslint/testing/vitestRules.js +8 -0
- package/dist/eslint/testing/vitestRules.js.map +1 -0
- package/dist/eslint/typescript/config.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -11
- package/dist/prettier/index.test.js +23 -20
- package/dist/prettier/index.test.js.map +1 -1
- package/package.json +6 -3
- package/dist/chunk-VWKQSLJR.js.map +0 -1
- package/dist/chunk-Y4XKZK6J.js.map +0 -1
- /package/dist/{chunk-SIH4WAXK.js.map → chunk-2DEE5IMM.js.map} +0 -0
- /package/dist/{chunk-3JDYGS77.js.map → chunk-4JICVSDT.js.map} +0 -0
- /package/dist/{chunk-HLX2OWWB.js.map → chunk-67I7QCZW.js.map} +0 -0
- /package/dist/{chunk-VF7D6J7C.js.map → chunk-67MZ7HGN.js.map} +0 -0
- /package/dist/{chunk-IZXVPZVW.js.map → chunk-GMXUFYEC.js.map} +0 -0
- /package/dist/{chunk-OPQZGCVL.js.map → chunk-H2WBGBO4.js.map} +0 -0
- /package/dist/{chunk-GBJI557O.js.map → chunk-IDOXOS33.js.map} +0 -0
- /package/dist/{chunk-LGB33CUY.js.map → chunk-MICOVBJ4.js.map} +0 -0
package/README.md
CHANGED
|
@@ -149,6 +149,24 @@ jsdoc: {
|
|
|
149
149
|
}
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
+
#### Testing Configuration
|
|
153
|
+
|
|
154
|
+
Testing support is enabled by default with Vitest configuration. You can customize it or disable it completely:
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
// Disable testing configuration
|
|
158
|
+
testing: false;
|
|
159
|
+
|
|
160
|
+
// Enable with custom options
|
|
161
|
+
testing: {
|
|
162
|
+
filenamePattern: "spec", // "test" (.test, default) or "spec" (.spec)
|
|
163
|
+
files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"], // Override file patterns
|
|
164
|
+
formattingRules: true, // Whether to include formatting rules like padding around blocks
|
|
165
|
+
framework: "vitest", // "vitest" (default), "jest", "node", or "bun"
|
|
166
|
+
itOrTest: "test", // "it" (default) or "test"
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
152
170
|
#### Perfectionist (Code Organization)
|
|
153
171
|
|
|
154
172
|
Sorting/organization rules from the Perfectionist plugin are enabled by default:
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-26SVGV32.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LODDGOPW.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/react/config.ts
|
|
9
9
|
import react from "eslint-plugin-react";
|
|
@@ -38,4 +38,4 @@ var reactEslintConfig = (functionStyle, typescript) => {
|
|
|
38
38
|
export {
|
|
39
39
|
reactEslintConfig
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-2DEE5IMM.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/eslint/testing/jestRules.ts
|
|
2
|
+
var jestRules = (itOrTest = "test") => ({
|
|
3
|
+
"jest/consistent-test-it": [
|
|
4
|
+
"warn",
|
|
5
|
+
{ fn: itOrTest, withinDescribe: itOrTest }
|
|
6
|
+
],
|
|
7
|
+
"jest/expect-expect": "warn",
|
|
8
|
+
"jest/no-commented-out-tests": "warn",
|
|
9
|
+
"jest/no-conditional-expect": "warn",
|
|
10
|
+
"jest/no-conditional-in-test": "warn",
|
|
11
|
+
"jest/no-disabled-tests": "warn",
|
|
12
|
+
"jest/no-duplicate-hooks": "warn",
|
|
13
|
+
"jest/no-focused-tests": "warn",
|
|
14
|
+
"jest/no-identical-title": "warn",
|
|
15
|
+
"jest/no-interpolation-in-snapshots": "warn",
|
|
16
|
+
"jest/no-large-snapshots": ["warn", { inlineMaxSize: 50, maxSize: 100 }],
|
|
17
|
+
"jest/no-mocks-import": "warn",
|
|
18
|
+
// Discourage manually importing from __mocks__
|
|
19
|
+
"jest/no-standalone-expect": "warn",
|
|
20
|
+
"jest/no-test-prefixes": "warn",
|
|
21
|
+
// Prefer .only and .skip over f and x
|
|
22
|
+
"jest/no-test-return-statement": "warn",
|
|
23
|
+
"jest/prefer-comparison-matcher": "warn",
|
|
24
|
+
"jest/prefer-equality-matcher": "warn",
|
|
25
|
+
"jest/prefer-expect-resolves": "warn",
|
|
26
|
+
"jest/prefer-hooks-in-order": "warn",
|
|
27
|
+
"jest/prefer-hooks-on-top": "warn",
|
|
28
|
+
"jest/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }],
|
|
29
|
+
"jest/prefer-snapshot-hint": "warn",
|
|
30
|
+
"jest/prefer-spy-on": "warn",
|
|
31
|
+
"jest/prefer-strict-equal": "warn",
|
|
32
|
+
"jest/prefer-to-be": "warn",
|
|
33
|
+
"jest/prefer-to-contain": "warn",
|
|
34
|
+
"jest/prefer-to-have-length": "warn",
|
|
35
|
+
"jest/require-top-level-describe": "warn",
|
|
36
|
+
"jest/valid-describe-callback": "warn",
|
|
37
|
+
"jest/valid-expect": "warn",
|
|
38
|
+
"jest/valid-expect-in-promise": "warn",
|
|
39
|
+
"jest/valid-title": "warn"
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
jestRules
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-3A7OYQSX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/testing/jestRules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype JestRules = Record<`jest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for jest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for jest.\n */\nexport const jestRules = (itOrTest: \"it\" | \"test\" = \"test\"): JestRules => ({\n \"jest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"jest/expect-expect\": \"warn\",\n \"jest/no-commented-out-tests\": \"warn\",\n \"jest/no-conditional-expect\": \"warn\",\n \"jest/no-conditional-in-test\": \"warn\",\n \"jest/no-disabled-tests\": \"warn\",\n \"jest/no-duplicate-hooks\": \"warn\",\n \"jest/no-focused-tests\": \"warn\",\n \"jest/no-identical-title\": \"warn\",\n \"jest/no-interpolation-in-snapshots\": \"warn\",\n \"jest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }],\n \"jest/no-mocks-import\": \"warn\", // Discourage manually importing from __mocks__\n \"jest/no-standalone-expect\": \"warn\",\n \"jest/no-test-prefixes\": \"warn\", // Prefer .only and .skip over f and x\n \"jest/no-test-return-statement\": \"warn\",\n \"jest/prefer-comparison-matcher\": \"warn\",\n \"jest/prefer-equality-matcher\": \"warn\",\n \"jest/prefer-expect-resolves\": \"warn\",\n \"jest/prefer-hooks-in-order\": \"warn\",\n \"jest/prefer-hooks-on-top\": \"warn\",\n \"jest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }],\n \"jest/prefer-snapshot-hint\": \"warn\",\n \"jest/prefer-spy-on\": \"warn\",\n \"jest/prefer-strict-equal\": \"warn\",\n \"jest/prefer-to-be\": \"warn\",\n \"jest/prefer-to-contain\": \"warn\",\n \"jest/prefer-to-have-length\": \"warn\",\n \"jest/require-top-level-describe\": \"warn\",\n \"jest/valid-describe-callback\": \"warn\",\n \"jest/valid-expect\": \"warn\",\n \"jest/valid-expect-in-promise\": \"warn\",\n \"jest/valid-title\": \"warn\",\n});\n"],"mappings":";AAUO,IAAM,YAAY,CAAC,WAA0B,YAAuB;AAAA,EACzE,2BAA2B;AAAA,IACzB;AAAA,IACA,EAAE,IAAI,UAAU,gBAAgB,SAAS;AAAA,EAC3C;AAAA,EACA,sBAAsB;AAAA,EACtB,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,2BAA2B;AAAA,EAC3B,sCAAsC;AAAA,EACtC,2BAA2B,CAAC,QAAQ,EAAE,eAAe,IAAI,SAAS,IAAI,CAAC;AAAA,EACvE,wBAAwB;AAAA;AAAA,EACxB,6BAA6B;AAAA,EAC7B,yBAAyB;AAAA;AAAA,EACzB,iCAAiC;AAAA,EACjC,kCAAkC;AAAA,EAClC,gCAAgC;AAAA,EAChC,+BAA+B;AAAA,EAC/B,8BAA8B;AAAA,EAC9B,4BAA4B;AAAA,EAC5B,+BAA+B,CAAC,QAAQ,EAAE,wBAAwB,KAAK,CAAC;AAAA,EACxE,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,8BAA8B;AAAA,EAC9B,mCAAmC;AAAA,EACnC,gCAAgC;AAAA,EAChC,qBAAqB;AAAA,EACrB,gCAAgC;AAAA,EAChC,oBAAoB;AACtB;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LODDGOPW.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/ignores.ts
|
|
6
6
|
var ignoresConfig = ({
|
|
@@ -20,4 +20,4 @@ var ignoresConfig = ({
|
|
|
20
20
|
export {
|
|
21
21
|
ignoresConfig
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-4JICVSDT.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-3SHRYTUT.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LODDGOPW.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/perfectionist/config.ts
|
|
9
9
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
@@ -18,4 +18,4 @@ var perfectionistConfig = {
|
|
|
18
18
|
export {
|
|
19
19
|
perfectionistConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-67I7QCZW.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZOCL6XIB.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LODDGOPW.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/base/config.ts
|
|
9
9
|
var baseEslintConfig = (functionStyle) => ({
|
|
@@ -18,4 +18,4 @@ var baseEslintConfig = (functionStyle) => ({
|
|
|
18
18
|
export {
|
|
19
19
|
baseEslintConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-67MZ7HGN.js.map
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tseslintConfig
|
|
3
|
+
} from "./chunk-GMXUFYEC.js";
|
|
1
4
|
import {
|
|
2
5
|
preferArrowFunctionConfig
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H2WBGBO4.js";
|
|
4
7
|
import {
|
|
5
8
|
reactEslintConfig
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2DEE5IMM.js";
|
|
7
10
|
import {
|
|
8
11
|
reactCompilerEslintConfig
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IDOXOS33.js";
|
|
10
13
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
testingConfig
|
|
15
|
+
} from "./chunk-V34MGXE7.js";
|
|
13
16
|
import {
|
|
14
17
|
baseEslintConfig
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-67MZ7HGN.js";
|
|
16
19
|
import {
|
|
17
20
|
jsdocConfig
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MICOVBJ4.js";
|
|
19
22
|
import {
|
|
20
23
|
perfectionistConfig
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-67I7QCZW.js";
|
|
22
25
|
import {
|
|
23
26
|
ignoresConfig
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4JICVSDT.js";
|
|
25
28
|
|
|
26
29
|
// src/eslint/index.ts
|
|
27
30
|
import { isObject, isString } from "is-type-of";
|
|
@@ -31,6 +34,7 @@ var eslintConfig = ({
|
|
|
31
34
|
jsdoc = { requireJsdoc: false },
|
|
32
35
|
react = false,
|
|
33
36
|
sorting = true,
|
|
37
|
+
testing,
|
|
34
38
|
typescript = true
|
|
35
39
|
} = {}, ...additionalConfigs) => {
|
|
36
40
|
const configs = [
|
|
@@ -57,6 +61,29 @@ var eslintConfig = ({
|
|
|
57
61
|
configs.push(reactCompilerEslintConfig);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
64
|
+
if (testing !== false) {
|
|
65
|
+
const defaultTestingConfig = {
|
|
66
|
+
filenamePattern: "test",
|
|
67
|
+
files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
|
|
68
|
+
formattingRules: true,
|
|
69
|
+
framework: "vitest",
|
|
70
|
+
itOrTest: "it"
|
|
71
|
+
};
|
|
72
|
+
const mergedTestingConfig = {
|
|
73
|
+
...defaultTestingConfig,
|
|
74
|
+
...isObject(testing) ? testing : {}
|
|
75
|
+
};
|
|
76
|
+
const { filenamePattern, files, formattingRules, framework, itOrTest } = mergedTestingConfig;
|
|
77
|
+
configs.push(
|
|
78
|
+
testingConfig({
|
|
79
|
+
filenamePattern,
|
|
80
|
+
files,
|
|
81
|
+
formattingRules,
|
|
82
|
+
framework,
|
|
83
|
+
itOrTest
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
}
|
|
60
87
|
if (sorting) {
|
|
61
88
|
configs.push(perfectionistConfig);
|
|
62
89
|
}
|
|
@@ -72,4 +99,4 @@ var eslintConfig = ({
|
|
|
72
99
|
export {
|
|
73
100
|
eslintConfig
|
|
74
101
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-D3SKAD35.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport { isObject, isString } from \"is-type-of\";\n\nimport type { FunctionStyle } from \"./types.js\";\n\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { reactCompilerEslintConfig } from \"./react-compiler/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n react?:\n | boolean\n | {\n next?: boolean | undefined;\n reactCompiler?: boolean | undefined;\n };\n sorting?: boolean;\n testing?: false | TestingConfig;\n typescript?: boolean | string;\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.\n * Can be configured with an object to control next.js support and reactCompiler.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.testing - An object with the following properties:\n * - `filenamePattern`: One of \"spec\" or \"test\" to determine which filename pattern to use.\n * - `files`: Array of file patterns to include in the configuration.\n * - `framework`: One of \"vitest\" or \"jest\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `itOrTest`: One of \"it\" or \"test\" to determine which test function to use.\n * @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.\n * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.\n * @returns An array of ESLint configuration objects.\n */\nexport const eslintConfig = (\n {\n functionStyle = \"arrow\",\n ignores = [],\n jsdoc = { requireJsdoc: false },\n react = false,\n sorting = true,\n testing,\n typescript = true,\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n const configs: Linter.Config[] = [\n ignoresConfig({\n next: isObject(react) && react.next,\n userIgnores: ignores,\n }),\n baseEslintConfig(functionStyle),\n ];\n\n if (jsdoc !== false) {\n configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n ) as Linter.Config[]),\n );\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));\n\n // Apply reactCompiler by default if react is true or if react.reactCompiler isn't explicitly false\n const shouldUseReactCompiler =\n react === true || (isObject(react) && react.reactCompiler !== false);\n\n if (shouldUseReactCompiler) {\n configs.push(reactCompilerEslintConfig);\n }\n }\n\n if (testing !== false) {\n const defaultTestingConfig: TestingConfig = {\n filenamePattern: \"test\",\n files: [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"it\",\n };\n\n // Merge the user's testing config with defaults\n const mergedTestingConfig: TestingConfig = {\n ...defaultTestingConfig,\n ...(isObject(testing) ? testing : {}),\n };\n\n // Destructure from the merged config\n const { filenamePattern, files, formattingRules, framework, itOrTest } =\n mergedTestingConfig;\n\n configs.push(\n testingConfig({\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }),\n );\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(preferArrowFunctionConfig());\n }\n\n // Add any additional config objects provided by the user\n if (additionalConfigs.length > 0) {\n configs.push(...additionalConfigs);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,UAAU,gBAAgB;AAqD5B,IAAM,eAAe,CAC1B;AAAA,EACE,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,QAAQ,EAAE,cAAc,MAAM;AAAA,EAC9B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,aAAa;AACf,IAAyB,CAAC,MACvB,sBACiB;AACpB,QAAM,UAA2B;AAAA,IAC/B,cAAc;AAAA,MACZ,MAAM,SAAS,KAAK,KAAK,MAAM;AAAA,MAC/B,aAAa;AAAA,IACf,CAAC;AAAA,IACD,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,UAAU,OAAO;AACnB,YAAQ,KAAK,YAAY,MAAM,gBAAgB,KAAK,CAAC;AAAA,EACvD;AAEA,MAAI,YAAY;AACd,YAAQ;AAAA,MACN,GAAI;AAAA,QACF,SAAS,UAAU,IAAI,aAAa;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,kBAAkB,eAAe,QAAQ,UAAU,CAAC,CAAC;AAGlE,UAAM,yBACJ,UAAU,QAAS,SAAS,KAAK,KAAK,MAAM,kBAAkB;AAEhE,QAAI,wBAAwB;AAC1B,cAAQ,KAAK,yBAAyB;AAAA,IACxC;AAAA,EACF;AAEA,MAAI,YAAY,OAAO;AACrB,UAAM,uBAAsC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,OAAO,CAAC,kCAAkC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,UAAU;AAAA,IACZ;AAGA,UAAM,sBAAqC;AAAA,MACzC,GAAG;AAAA,MACH,GAAI,SAAS,OAAO,IAAI,UAAU,CAAC;AAAA,IACrC;AAGA,UAAM,EAAE,iBAAiB,OAAO,iBAAiB,WAAW,SAAS,IACnE;AAEF,YAAQ;AAAA,MACN,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,mBAAmB;AAAA,EAClC;AAEA,MAAI,kBAAkB,SAAS;AAC7B,YAAQ,KAAK,0BAA0B,CAAC;AAAA,EAC1C;AAGA,MAAI,kBAAkB,SAAS,GAAG;AAChC,YAAQ,KAAK,GAAG,iBAAiB;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-LITSWCYQ.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LODDGOPW.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/typescript/config.ts
|
|
9
9
|
import tseslint from "typescript-eslint";
|
|
@@ -35,4 +35,4 @@ var tseslintConfig = (tsconfigPath) => {
|
|
|
35
35
|
export {
|
|
36
36
|
tseslintConfig
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-GMXUFYEC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LODDGOPW.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/prefer-arrow-function/config.ts
|
|
6
6
|
import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
|
|
@@ -23,4 +23,4 @@ var preferArrowFunctionConfig = () => ({
|
|
|
23
23
|
export {
|
|
24
24
|
preferArrowFunctionConfig
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-H2WBGBO4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LODDGOPW.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/react-compiler/config.ts
|
|
6
6
|
import reactCompiler from "eslint-plugin-react-compiler";
|
|
@@ -17,4 +17,4 @@ var reactCompilerEslintConfig = {
|
|
|
17
17
|
export {
|
|
18
18
|
reactCompilerEslintConfig
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-IDOXOS33.js.map
|
|
@@ -9,10 +9,11 @@ var configNames = {
|
|
|
9
9
|
preferArrowFunction: "prefer-arrow-function-config",
|
|
10
10
|
react: "react-config",
|
|
11
11
|
reactCompiler: "react-compiler-config",
|
|
12
|
+
testing: "testing-config",
|
|
12
13
|
typescript: "tseslint-config"
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export {
|
|
16
17
|
configNames
|
|
17
18
|
};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-LODDGOPW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n typescript: \"tseslint-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AACd;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n testing: \"testing-config\",\n typescript: \"tseslint-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AAAA,EACT,YAAY;AACd;","names":[]}
|
|
@@ -216,7 +216,7 @@ import { isatty as s } from "tty";
|
|
|
216
216
|
var r = process.env.FORCE_TTY !== void 0 || s(1);
|
|
217
217
|
var u = p(r);
|
|
218
218
|
|
|
219
|
-
// ../../node_modules/.pnpm/@vitest+pretty-format@3.0.
|
|
219
|
+
// ../../node_modules/.pnpm/@vitest+pretty-format@3.0.8/node_modules/@vitest/pretty-format/dist/index.js
|
|
220
220
|
function _mergeNamespaces(n, m3) {
|
|
221
221
|
m3.forEach(function(e) {
|
|
222
222
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k2) {
|
|
@@ -2241,7 +2241,7 @@ function inspect(value, opts = {}) {
|
|
|
2241
2241
|
return options.stylize(String(value), type3);
|
|
2242
2242
|
}
|
|
2243
2243
|
|
|
2244
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
2244
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
|
|
2245
2245
|
var {
|
|
2246
2246
|
AsymmetricMatcher,
|
|
2247
2247
|
DOMCollection,
|
|
@@ -2396,7 +2396,7 @@ function getDefaultExportFromCjs2(x2) {
|
|
|
2396
2396
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
2397
2397
|
}
|
|
2398
2398
|
|
|
2399
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
2399
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/helpers.js
|
|
2400
2400
|
function createSimpleStackTrace(options) {
|
|
2401
2401
|
const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
|
|
2402
2402
|
const limit = Error.stackTraceLimit;
|
|
@@ -2535,7 +2535,7 @@ function isNegativeNaN(val) {
|
|
|
2535
2535
|
return isNegative;
|
|
2536
2536
|
}
|
|
2537
2537
|
|
|
2538
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
2538
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/index.js
|
|
2539
2539
|
var jsTokens_1;
|
|
2540
2540
|
var hasRequiredJsTokens;
|
|
2541
2541
|
function requireJsTokens() {
|
|
@@ -3006,7 +3006,7 @@ function getSafeTimers() {
|
|
|
3006
3006
|
};
|
|
3007
3007
|
}
|
|
3008
3008
|
|
|
3009
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
3009
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/source-map.js
|
|
3010
3010
|
var comma = ",".charCodeAt(0);
|
|
3011
3011
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3012
3012
|
var intToChar = new Uint8Array(64);
|
|
@@ -3138,7 +3138,9 @@ function extractLocation(urlLike) {
|
|
|
3138
3138
|
}
|
|
3139
3139
|
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
3140
3140
|
const urlObj = new URL(url);
|
|
3141
|
-
|
|
3141
|
+
urlObj.searchParams.delete("import");
|
|
3142
|
+
urlObj.searchParams.delete("browserv");
|
|
3143
|
+
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
3142
3144
|
}
|
|
3143
3145
|
if (url.startsWith("/@fs/")) {
|
|
3144
3146
|
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
@@ -3220,7 +3222,7 @@ function parseSingleV8Stack(raw) {
|
|
|
3220
3222
|
};
|
|
3221
3223
|
}
|
|
3222
3224
|
|
|
3223
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
3225
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/diff.js
|
|
3224
3226
|
var DIFF_DELETE = -1;
|
|
3225
3227
|
var DIFF_INSERT = 1;
|
|
3226
3228
|
var DIFF_EQUAL = 0;
|
|
@@ -4954,7 +4956,7 @@ function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
|
|
|
4954
4956
|
);
|
|
4955
4957
|
}
|
|
4956
4958
|
|
|
4957
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.0.
|
|
4959
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.0.8/node_modules/@vitest/utils/dist/error.js
|
|
4958
4960
|
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
4959
4961
|
var IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
4960
4962
|
function isImmutable(v) {
|
|
@@ -5181,7 +5183,7 @@ var isAbsolute2 = function(p3) {
|
|
|
5181
5183
|
return _IS_ABSOLUTE_RE2.test(p3);
|
|
5182
5184
|
};
|
|
5183
5185
|
|
|
5184
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.0.
|
|
5186
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.0.8/node_modules/@vitest/runner/dist/chunk-tasks.js
|
|
5185
5187
|
function createChainable(keys2, fn2) {
|
|
5186
5188
|
function create(context) {
|
|
5187
5189
|
const chain2 = function(...args) {
|
|
@@ -5226,7 +5228,7 @@ function getTestName(task, separator = " > ") {
|
|
|
5226
5228
|
return getNames(task).slice(1).join(separator);
|
|
5227
5229
|
}
|
|
5228
5230
|
|
|
5229
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.0.
|
|
5231
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.0.8/node_modules/@vitest/runner/dist/index.js
|
|
5230
5232
|
var PendingError = class extends Error {
|
|
5231
5233
|
constructor(message, task, note) {
|
|
5232
5234
|
super(message);
|
|
@@ -5608,10 +5610,11 @@ function createSuiteCollector(name, factory = () => {
|
|
|
5608
5610
|
let suite2;
|
|
5609
5611
|
initSuite(true);
|
|
5610
5612
|
const task = function(name2 = "", options = {}) {
|
|
5613
|
+
var _a;
|
|
5611
5614
|
const task2 = {
|
|
5612
5615
|
id: "",
|
|
5613
5616
|
name: name2,
|
|
5614
|
-
suite: void 0,
|
|
5617
|
+
suite: (_a = collectorContext.currentSuite) == null ? void 0 : _a.suite,
|
|
5615
5618
|
each: options.each,
|
|
5616
5619
|
fails: options.fails,
|
|
5617
5620
|
context: void 0,
|
|
@@ -5673,6 +5676,7 @@ function createSuiteCollector(name, factory = () => {
|
|
|
5673
5676
|
type: "collector",
|
|
5674
5677
|
name,
|
|
5675
5678
|
mode,
|
|
5679
|
+
suite: suite2,
|
|
5676
5680
|
options: suiteOptions,
|
|
5677
5681
|
test: test22,
|
|
5678
5682
|
tasks,
|
|
@@ -5685,6 +5689,7 @@ function createSuiteCollector(name, factory = () => {
|
|
|
5685
5689
|
getHooks(suite2)[name2].push(...fn2);
|
|
5686
5690
|
}
|
|
5687
5691
|
function initSuite(includeLocation) {
|
|
5692
|
+
var _a;
|
|
5688
5693
|
if (typeof suiteOptions === "number") {
|
|
5689
5694
|
suiteOptions = { timeout: suiteOptions };
|
|
5690
5695
|
}
|
|
@@ -5692,6 +5697,7 @@ function createSuiteCollector(name, factory = () => {
|
|
|
5692
5697
|
id: "",
|
|
5693
5698
|
type: "suite",
|
|
5694
5699
|
name,
|
|
5700
|
+
suite: (_a = collectorContext.currentSuite) == null ? void 0 : _a.suite,
|
|
5695
5701
|
mode,
|
|
5696
5702
|
each,
|
|
5697
5703
|
file: void 0,
|
|
@@ -5730,7 +5736,6 @@ function createSuiteCollector(name, factory = () => {
|
|
|
5730
5736
|
suite2.file = file;
|
|
5731
5737
|
suite2.tasks = allChildren;
|
|
5732
5738
|
allChildren.forEach((task2) => {
|
|
5733
|
-
task2.suite = suite2;
|
|
5734
5739
|
task2.file = file;
|
|
5735
5740
|
});
|
|
5736
5741
|
return suite2;
|
|
@@ -5988,6 +5993,7 @@ function findTestFileStackTrace(error, each) {
|
|
|
5988
5993
|
function getDefaultHookTimeout() {
|
|
5989
5994
|
return getRunner().config.hookTimeout;
|
|
5990
5995
|
}
|
|
5996
|
+
var CLEANUP_TIMEOUT_KEY = Symbol.for("VITEST_CLEANUP_TIMEOUT");
|
|
5991
5997
|
var onTestFailed = createTestHook(
|
|
5992
5998
|
"onTestFailed",
|
|
5993
5999
|
(test5, handler, timeout) => {
|
|
@@ -6124,7 +6130,7 @@ function C2(e, t, n) {
|
|
|
6124
6130
|
), x.add(i), i;
|
|
6125
6131
|
}
|
|
6126
6132
|
|
|
6127
|
-
// ../../node_modules/.pnpm/@vitest+spy@3.0.
|
|
6133
|
+
// ../../node_modules/.pnpm/@vitest+spy@3.0.8/node_modules/@vitest/spy/dist/index.js
|
|
6128
6134
|
var mocks = /* @__PURE__ */ new Set();
|
|
6129
6135
|
function isMockFunction(fn2) {
|
|
6130
6136
|
return typeof fn2 === "function" && "_isMockFunction" in fn2 && fn2._isMockFunction;
|
|
@@ -10254,7 +10260,7 @@ function use(fn2) {
|
|
|
10254
10260
|
}
|
|
10255
10261
|
__name(use, "use");
|
|
10256
10262
|
|
|
10257
|
-
// ../../node_modules/.pnpm/@vitest+expect@3.0.
|
|
10263
|
+
// ../../node_modules/.pnpm/@vitest+expect@3.0.8/node_modules/@vitest/expect/dist/index.js
|
|
10258
10264
|
var MATCHERS_OBJECT = Symbol.for("matchers-object");
|
|
10259
10265
|
var JEST_MATCHERS_OBJECT = Symbol.for("$$jest-matchers-object");
|
|
10260
10266
|
var GLOBAL_EXPECT = Symbol.for("expect-global");
|
|
@@ -12402,7 +12408,7 @@ var JestExtend = (chai2, utils) => {
|
|
|
12402
12408
|
);
|
|
12403
12409
|
};
|
|
12404
12410
|
|
|
12405
|
-
// ../../node_modules/.pnpm/vitest@3.0.
|
|
12411
|
+
// ../../node_modules/.pnpm/vitest@3.0.8_@types+debug@4.1.12_@types+node@22.13.9_jiti@1.21.7_terser@5.37.0_yaml@2.7.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js
|
|
12406
12412
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
12407
12413
|
function getWorkerState() {
|
|
12408
12414
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -12462,13 +12468,13 @@ async function waitForImportsToResolve() {
|
|
|
12462
12468
|
await waitForImportsToResolve();
|
|
12463
12469
|
}
|
|
12464
12470
|
|
|
12465
|
-
// ../../node_modules/.pnpm/vitest@3.0.
|
|
12471
|
+
// ../../node_modules/.pnpm/vitest@3.0.8_@types+debug@4.1.12_@types+node@22.13.9_jiti@1.21.7_terser@5.37.0_yaml@2.7.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
12466
12472
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
12467
12473
|
function getDefaultExportFromCjs3(x2) {
|
|
12468
12474
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
12469
12475
|
}
|
|
12470
12476
|
|
|
12471
|
-
// ../../node_modules/.pnpm/@vitest+snapshot@3.0.
|
|
12477
|
+
// ../../node_modules/.pnpm/@vitest+snapshot@3.0.8/node_modules/@vitest/snapshot/dist/index.js
|
|
12472
12478
|
var comma2 = ",".charCodeAt(0);
|
|
12473
12479
|
var chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12474
12480
|
var intToChar2 = new Uint8Array(64);
|
|
@@ -13004,7 +13010,9 @@ function extractLocation2(urlLike) {
|
|
|
13004
13010
|
}
|
|
13005
13011
|
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
13006
13012
|
const urlObj = new URL(url);
|
|
13007
|
-
|
|
13013
|
+
urlObj.searchParams.delete("import");
|
|
13014
|
+
urlObj.searchParams.delete("browserv");
|
|
13015
|
+
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
13008
13016
|
}
|
|
13009
13017
|
if (url.startsWith("/@fs/")) {
|
|
13010
13018
|
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
@@ -13080,28 +13088,40 @@ function parseSingleV8Stack2(raw) {
|
|
|
13080
13088
|
}
|
|
13081
13089
|
function parseStacktrace(stack, options = {}) {
|
|
13082
13090
|
const { ignoreStackEntries = stackIgnorePatterns } = options;
|
|
13083
|
-
|
|
13084
|
-
if (ignoreStackEntries.length) {
|
|
13085
|
-
stacks = stacks.filter(
|
|
13086
|
-
(stack2) => !ignoreStackEntries.some((p3) => stack2.file.match(p3))
|
|
13087
|
-
);
|
|
13088
|
-
}
|
|
13091
|
+
const stacks = !CHROME_IE_STACK_REGEXP2.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
|
|
13089
13092
|
return stacks.map((stack2) => {
|
|
13090
13093
|
var _a;
|
|
13091
|
-
if (options.
|
|
13092
|
-
stack2.file = options.
|
|
13094
|
+
if (options.getUrlId) {
|
|
13095
|
+
stack2.file = options.getUrlId(stack2.file);
|
|
13093
13096
|
}
|
|
13094
13097
|
const map2 = (_a = options.getSourceMap) == null ? void 0 : _a.call(options, stack2.file);
|
|
13095
13098
|
if (!map2 || typeof map2 !== "object" || !map2.version) {
|
|
13096
|
-
return stack2;
|
|
13099
|
+
return shouldFilter(ignoreStackEntries, stack2.file) ? null : stack2;
|
|
13097
13100
|
}
|
|
13098
13101
|
const traceMap = new TraceMap(map2);
|
|
13099
|
-
const { line, column } = originalPositionFor(traceMap, stack2);
|
|
13102
|
+
const { line, column, source, name } = originalPositionFor(traceMap, stack2);
|
|
13103
|
+
let file = stack2.file;
|
|
13104
|
+
if (source) {
|
|
13105
|
+
const fileUrl = stack2.file.startsWith("file://") ? stack2.file : `file://${stack2.file}`;
|
|
13106
|
+
const sourceRootUrl = map2.sourceRoot ? new URL(map2.sourceRoot, fileUrl) : fileUrl;
|
|
13107
|
+
file = new URL(source, sourceRootUrl).pathname;
|
|
13108
|
+
}
|
|
13109
|
+
if (shouldFilter(ignoreStackEntries, file)) {
|
|
13110
|
+
return null;
|
|
13111
|
+
}
|
|
13100
13112
|
if (line != null && column != null) {
|
|
13101
|
-
return {
|
|
13113
|
+
return {
|
|
13114
|
+
line,
|
|
13115
|
+
column,
|
|
13116
|
+
file,
|
|
13117
|
+
method: name || stack2.method
|
|
13118
|
+
};
|
|
13102
13119
|
}
|
|
13103
13120
|
return stack2;
|
|
13104
|
-
});
|
|
13121
|
+
}).filter((s2) => s2 != null);
|
|
13122
|
+
}
|
|
13123
|
+
function shouldFilter(ignoreStackEntries, file) {
|
|
13124
|
+
return ignoreStackEntries.some((p3) => file.match(p3));
|
|
13105
13125
|
}
|
|
13106
13126
|
function parseFFOrSafariStackTrace(stack) {
|
|
13107
13127
|
return stack.split("\n").map((line) => parseSingleFFOrSafariStack2(line)).filter(notNullish2);
|
|
@@ -14121,6 +14141,9 @@ var CounterMap = class extends DefaultMap {
|
|
|
14121
14141
|
return total;
|
|
14122
14142
|
}
|
|
14123
14143
|
};
|
|
14144
|
+
function isSameStackPosition(x2, y2) {
|
|
14145
|
+
return x2.file === y2.file && x2.column === y2.column && x2.line === y2.line;
|
|
14146
|
+
}
|
|
14124
14147
|
var SnapshotState = class _SnapshotState {
|
|
14125
14148
|
constructor(testFilePath, snapshotPath, snapshotContent, options) {
|
|
14126
14149
|
this.testFilePath = testFilePath;
|
|
@@ -14355,11 +14378,23 @@ ${JSON.stringify(
|
|
|
14355
14378
|
}
|
|
14356
14379
|
stack = ((_b = (_a = this.environment).processStackTrace) == null ? void 0 : _b.call(_a, _stack)) || _stack;
|
|
14357
14380
|
stack.column--;
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14381
|
+
const snapshotsWithSameStack = this._inlineSnapshotStacks.filter((s2) => isSameStackPosition(s2, stack));
|
|
14382
|
+
if (snapshotsWithSameStack.length > 0) {
|
|
14383
|
+
this._inlineSnapshots = this._inlineSnapshots.filter((s2) => !isSameStackPosition(s2, stack));
|
|
14384
|
+
const differentSnapshot = snapshotsWithSameStack.find((s2) => s2.snapshot !== receivedSerialized);
|
|
14385
|
+
if (differentSnapshot) {
|
|
14386
|
+
throw Object.assign(
|
|
14387
|
+
new Error(
|
|
14388
|
+
"toMatchInlineSnapshot with different snapshots cannot be called at the same location"
|
|
14389
|
+
),
|
|
14390
|
+
{
|
|
14391
|
+
actual: receivedSerialized,
|
|
14392
|
+
expected: differentSnapshot.snapshot
|
|
14393
|
+
}
|
|
14394
|
+
);
|
|
14395
|
+
}
|
|
14361
14396
|
}
|
|
14362
|
-
this._inlineSnapshotStacks.push({ ...stack, testId });
|
|
14397
|
+
this._inlineSnapshotStacks.push({ ...stack, testId, snapshot: receivedSerialized });
|
|
14363
14398
|
}
|
|
14364
14399
|
if (hasSnapshot && this._updateSnapshot === "all" || (!hasSnapshot || !snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
|
|
14365
14400
|
if (this._updateSnapshot === "all") {
|
|
@@ -14580,7 +14615,7 @@ var SnapshotClient = class {
|
|
|
14580
14615
|
}
|
|
14581
14616
|
};
|
|
14582
14617
|
|
|
14583
|
-
// ../../node_modules/.pnpm/vitest@3.0.
|
|
14618
|
+
// ../../node_modules/.pnpm/vitest@3.0.8_@types+debug@4.1.12_@types+node@22.13.9_jiti@1.21.7_terser@5.37.0_yaml@2.7.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js
|
|
14584
14619
|
var RealDate = Date;
|
|
14585
14620
|
var now2 = null;
|
|
14586
14621
|
var MockDate = class _MockDate extends RealDate {
|
|
@@ -14633,7 +14668,7 @@ function resetDate() {
|
|
|
14633
14668
|
globalThis.Date = RealDate;
|
|
14634
14669
|
}
|
|
14635
14670
|
|
|
14636
|
-
// ../../node_modules/.pnpm/vitest@3.0.
|
|
14671
|
+
// ../../node_modules/.pnpm/vitest@3.0.8_@types+debug@4.1.12_@types+node@22.13.9_jiti@1.21.7_terser@5.37.0_yaml@2.7.0/node_modules/vitest/dist/chunks/vi.B5EKKJdE.js
|
|
14637
14672
|
var unsupported = [
|
|
14638
14673
|
// .poll is meant to retry matchers until they succeed, and
|
|
14639
14674
|
// snapshots will always succeed as long as the poll method doesn't throw an error
|
|
@@ -17599,7 +17634,7 @@ function getImporter(name) {
|
|
|
17599
17634
|
return stack?.file || "";
|
|
17600
17635
|
}
|
|
17601
17636
|
|
|
17602
|
-
// ../../node_modules/.pnpm/vitest@3.0.
|
|
17637
|
+
// ../../node_modules/.pnpm/vitest@3.0.8_@types+debug@4.1.12_@types+node@22.13.9_jiti@1.21.7_terser@5.37.0_yaml@2.7.0/node_modules/vitest/dist/index.js
|
|
17603
17638
|
var import_expect_type = __toESM(require_dist(), 1);
|
|
17604
17639
|
|
|
17605
17640
|
export {
|
|
@@ -17898,4 +17933,4 @@ chai/chai.js:
|
|
|
17898
17933
|
* @license MIT License
|
|
17899
17934
|
*)
|
|
17900
17935
|
*/
|
|
17901
|
-
//# sourceMappingURL=chunk-
|
|
17936
|
+
//# sourceMappingURL=chunk-LQQAQ4PJ.js.map
|