js-style-kit 0.1.5 → 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-43MH6BR2.js → chunk-2DEE5IMM.js} +2 -2
- package/dist/chunk-3A7OYQSX.js +45 -0
- package/dist/chunk-3A7OYQSX.js.map +1 -0
- package/dist/{chunk-N3RZA2FB.js → chunk-4JICVSDT.js} +2 -2
- package/dist/{chunk-YNIBJXJY.js → chunk-67I7QCZW.js} +2 -2
- package/dist/{chunk-KVRY4Z5V.js → chunk-67MZ7HGN.js} +2 -2
- package/dist/{chunk-436YRRJR.js → chunk-D3SKAD35.js} +25 -24
- package/dist/chunk-D3SKAD35.js.map +1 -0
- package/dist/{chunk-VEO5AWMY.js → chunk-GMXUFYEC.js} +2 -2
- package/dist/{chunk-3NAB7PYG.js → chunk-H2WBGBO4.js} +2 -2
- package/dist/{chunk-RBMRMMJZ.js → chunk-IDOXOS33.js} +2 -2
- package/dist/{chunk-SFG5KNOI.js → chunk-LODDGOPW.js} +3 -3
- package/dist/{chunk-SFG5KNOI.js.map → chunk-LODDGOPW.js.map} +1 -1
- package/dist/{chunk-254VVGLB.js → chunk-MICOVBJ4.js} +2 -2
- package/dist/{chunk-ZQ3U2JXO.js → chunk-PHFQMAHS.js} +3 -16
- 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 -1
- package/dist/eslint/constants.js +1 -1
- package/dist/eslint/ignores.js +2 -2
- package/dist/eslint/index.d.ts +4 -8
- package/dist/eslint/index.js +14 -13
- package/dist/eslint/index.test.js +101 -28
- 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.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/vitestRules.d.ts +14 -0
- package/dist/eslint/{vitest/rules.js → testing/vitestRules.js} +2 -2
- package/dist/eslint/testing/vitestRules.js.map +1 -0
- package/dist/eslint/typescript/config.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -13
- package/dist/prettier/index.test.js +14 -13
- package/dist/prettier/index.test.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-436YRRJR.js.map +0 -1
- package/dist/chunk-KSSFLTRQ.js +0 -34
- package/dist/chunk-KSSFLTRQ.js.map +0 -1
- package/dist/chunk-ZQ3U2JXO.js.map +0 -1
- package/dist/eslint/vitest/config.d.ts +0 -20
- package/dist/eslint/vitest/config.js +0 -10
- package/dist/eslint/vitest/config.test.js +0 -72
- package/dist/eslint/vitest/config.test.js.map +0 -1
- package/dist/eslint/vitest/rules.d.ts +0 -19
- /package/dist/{chunk-43MH6BR2.js.map → chunk-2DEE5IMM.js.map} +0 -0
- /package/dist/{chunk-N3RZA2FB.js.map → chunk-4JICVSDT.js.map} +0 -0
- /package/dist/{chunk-YNIBJXJY.js.map → chunk-67I7QCZW.js.map} +0 -0
- /package/dist/{chunk-KVRY4Z5V.js.map → chunk-67MZ7HGN.js.map} +0 -0
- /package/dist/{chunk-VEO5AWMY.js.map → chunk-GMXUFYEC.js.map} +0 -0
- /package/dist/{chunk-3NAB7PYG.js.map → chunk-H2WBGBO4.js.map} +0 -0
- /package/dist/{chunk-RBMRMMJZ.js.map → chunk-IDOXOS33.js.map} +0 -0
- /package/dist/{chunk-254VVGLB.js.map → chunk-MICOVBJ4.js.map} +0 -0
- /package/dist/eslint/{vitest → testing}/config.js.map +0 -0
- /package/dist/eslint/{vitest → testing}/config.test.d.ts +0 -0
- /package/dist/eslint/{vitest/rules.js.map → testing/jestRules.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,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
tseslintConfig
|
|
3
|
+
} from "./chunk-GMXUFYEC.js";
|
|
4
4
|
import {
|
|
5
5
|
preferArrowFunctionConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H2WBGBO4.js";
|
|
7
7
|
import {
|
|
8
8
|
reactEslintConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2DEE5IMM.js";
|
|
10
10
|
import {
|
|
11
11
|
reactCompilerEslintConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IDOXOS33.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
testingConfig
|
|
15
|
+
} from "./chunk-V34MGXE7.js";
|
|
16
16
|
import {
|
|
17
17
|
baseEslintConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-67MZ7HGN.js";
|
|
19
19
|
import {
|
|
20
20
|
jsdocConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MICOVBJ4.js";
|
|
22
22
|
import {
|
|
23
23
|
perfectionistConfig
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-67I7QCZW.js";
|
|
25
25
|
import {
|
|
26
26
|
ignoresConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4JICVSDT.js";
|
|
28
28
|
|
|
29
29
|
// src/eslint/index.ts
|
|
30
30
|
import { isObject, isString } from "is-type-of";
|
|
@@ -65,23 +65,24 @@ var eslintConfig = ({
|
|
|
65
65
|
const defaultTestingConfig = {
|
|
66
66
|
filenamePattern: "test",
|
|
67
67
|
files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
formattingRules: true,
|
|
69
|
+
framework: "vitest",
|
|
70
|
+
itOrTest: "it"
|
|
70
71
|
};
|
|
71
72
|
const mergedTestingConfig = {
|
|
72
73
|
...defaultTestingConfig,
|
|
73
74
|
...isObject(testing) ? testing : {}
|
|
74
75
|
};
|
|
75
|
-
const { filenamePattern, files,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
)
|
|
84
|
-
|
|
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
|
+
);
|
|
85
86
|
}
|
|
86
87
|
if (sorting) {
|
|
87
88
|
configs.push(perfectionistConfig);
|
|
@@ -98,4 +99,4 @@ var eslintConfig = ({
|
|
|
98
99
|
export {
|
|
99
100
|
eslintConfig
|
|
100
101
|
};
|
|
101
|
-
//# 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,11 +9,11 @@ var configNames = {
|
|
|
9
9
|
preferArrowFunction: "prefer-arrow-function-config",
|
|
10
10
|
react: "react-config",
|
|
11
11
|
reactCompiler: "react-compiler-config",
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
testing: "testing-config",
|
|
13
|
+
typescript: "tseslint-config"
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export {
|
|
17
17
|
configNames
|
|
18
18
|
};
|
|
19
|
-
//# 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
|
|
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":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-XCPOAYGQ.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LODDGOPW.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/jsdoc/config.ts
|
|
9
9
|
import jsdoc from "eslint-plugin-jsdoc";
|
|
@@ -18,4 +18,4 @@ var jsdocConfig = (requireJsdoc = false, typescript = true) => ({
|
|
|
18
18
|
export {
|
|
19
19
|
jsdocConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-MICOVBJ4.js.map
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
// src/eslint/
|
|
2
|
-
var vitestRules = ({
|
|
3
|
-
filenamePattern = "test",
|
|
4
|
-
itOrTest = "test"
|
|
5
|
-
} = {
|
|
6
|
-
filenamePattern: "test",
|
|
7
|
-
itOrTest: "test"
|
|
8
|
-
}) => ({
|
|
9
|
-
"vitest/consistent-test-filename": [
|
|
10
|
-
"warn",
|
|
11
|
-
{
|
|
12
|
-
allTestPattern: ".*\\.(test|spec)\\.[tj]sx?$",
|
|
13
|
-
pattern: `.*\\.${filenamePattern}\\.[tj]sx?$`
|
|
14
|
-
}
|
|
15
|
-
],
|
|
1
|
+
// src/eslint/testing/vitestRules.ts
|
|
2
|
+
var vitestRules = (itOrTest = "test") => ({
|
|
16
3
|
"vitest/consistent-test-it": [
|
|
17
4
|
"warn",
|
|
18
5
|
{ fn: itOrTest, withinDescribe: itOrTest }
|
|
@@ -61,4 +48,4 @@ var vitestRules = ({
|
|
|
61
48
|
export {
|
|
62
49
|
vitestRules
|
|
63
50
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-PHFQMAHS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/testing/vitestRules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype VitestRules = Record<`vitest/${string}`, EslintRuleConfig>;\n\n/**\n * Creates an object containing the ESLint rules for vitest.\n *\n * @param itOrTest - \"it\" or \"test\"\n * @returns An object containing the ESLint rules for vitest.\n */\nexport const vitestRules = (itOrTest: \"it\" | \"test\" = \"test\"): VitestRules => ({\n \"vitest/consistent-test-it\": [\n \"warn\",\n { fn: itOrTest, withinDescribe: itOrTest },\n ],\n \"vitest/expect-expect\": \"warn\",\n \"vitest/no-commented-out-tests\": \"warn\",\n \"vitest/no-conditional-in-test\": \"warn\",\n \"vitest/no-disabled-tests\": \"warn\",\n \"vitest/no-duplicate-hooks\": \"warn\",\n \"vitest/no-focused-tests\": \"warn\",\n \"vitest/no-identical-title\": \"warn\",\n \"vitest/no-import-node-test\": \"warn\",\n \"vitest/no-interpolation-in-snapshots\": \"warn\", // Avoid dynamic snapshots\n \"vitest/no-large-snapshots\": [\"warn\", { inlineMaxSize: 50, maxSize: 100 }], // Keep snapshots manageable\n \"vitest/no-standalone-expect\": \"warn\",\n \"vitest/no-test-return-statement\": \"warn\", // Tests shouldn't return values\n \"vitest/prefer-comparison-matcher\": \"warn\", // Use comparison matchers\n \"vitest/prefer-equality-matcher\": \"warn\", // Use equality matchers\n \"vitest/prefer-hooks-in-order\": \"warn\", // Keep hooks in a predictable order\n \"vitest/prefer-hooks-on-top\": \"warn\", // Keep hooks organized\n \"vitest/prefer-lowercase-title\": [\"warn\", { ignoreTopLevelDescribe: true }], // Consistent casing\n \"vitest/prefer-strict-equal\": \"warn\", // Prefer .toStrictEqual() over .toEqual()\n \"vitest/prefer-to-be\": \"warn\", // Use .toBe() for primitives\n \"vitest/prefer-to-contain\": \"warn\", // Use .toContain() for array/string includes\n \"vitest/prefer-to-have-length\": \"warn\", // Use .toHaveLength() for checking length\n \"vitest/require-local-test-context-for-concurrent-snapshots\": \"warn\",\n \"vitest/require-top-level-describe\": \"warn\", // Group tests in describe blocks\n \"vitest/valid-describe-callback\": \"warn\",\n \"vitest/valid-expect\": \"warn\",\n \"vitest/valid-title\": \"warn\",\n});\n"],"mappings":";AAUO,IAAM,cAAc,CAAC,WAA0B,YAAyB;AAAA,EAC7E,6BAA6B;AAAA,IAC3B;AAAA,IACA,EAAE,IAAI,UAAU,gBAAgB,SAAS;AAAA,EAC3C;AAAA,EACA,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,wCAAwC;AAAA;AAAA,EACxC,6BAA6B,CAAC,QAAQ,EAAE,eAAe,IAAI,SAAS,IAAI,CAAC;AAAA;AAAA,EACzE,+BAA+B;AAAA,EAC/B,mCAAmC;AAAA;AAAA,EACnC,oCAAoC;AAAA;AAAA,EACpC,kCAAkC;AAAA;AAAA,EAClC,gCAAgC;AAAA;AAAA,EAChC,8BAA8B;AAAA;AAAA,EAC9B,iCAAiC,CAAC,QAAQ,EAAE,wBAAwB,KAAK,CAAC;AAAA;AAAA,EAC1E,8BAA8B;AAAA;AAAA,EAC9B,uBAAuB;AAAA;AAAA,EACvB,4BAA4B;AAAA;AAAA,EAC5B,gCAAgC;AAAA;AAAA,EAChC,8DAA8D;AAAA,EAC9D,qCAAqC;AAAA;AAAA,EACrC,kCAAkC;AAAA,EAClC,uBAAuB;AAAA,EACvB,sBAAsB;AACxB;","names":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
jestRules
|
|
3
|
+
} from "./chunk-3A7OYQSX.js";
|
|
4
|
+
import {
|
|
5
|
+
vitestRules
|
|
6
|
+
} from "./chunk-PHFQMAHS.js";
|
|
7
|
+
import {
|
|
8
|
+
configNames
|
|
9
|
+
} from "./chunk-LODDGOPW.js";
|
|
10
|
+
|
|
11
|
+
// src/eslint/testing/config.ts
|
|
12
|
+
import jest from "eslint-plugin-jest";
|
|
13
|
+
import vitest from "eslint-plugin-vitest";
|
|
14
|
+
var testingConfig = ({
|
|
15
|
+
filenamePattern,
|
|
16
|
+
files,
|
|
17
|
+
formattingRules,
|
|
18
|
+
framework,
|
|
19
|
+
itOrTest
|
|
20
|
+
} = {
|
|
21
|
+
filenamePattern: "test",
|
|
22
|
+
formattingRules: true,
|
|
23
|
+
framework: "vitest",
|
|
24
|
+
itOrTest: "test"
|
|
25
|
+
}) => ({
|
|
26
|
+
files: files ?? ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
|
|
27
|
+
languageOptions: {
|
|
28
|
+
globals: framework === "vitest" ? { ...vitest.environments.env.globals } : jest.environments.globals.globals
|
|
29
|
+
},
|
|
30
|
+
name: configNames.testing,
|
|
31
|
+
plugins: {
|
|
32
|
+
jest,
|
|
33
|
+
vitest
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
// jest doesn't have a file name rule, so we'll use this one for both
|
|
37
|
+
"vitest/consistent-test-filename": [
|
|
38
|
+
"warn",
|
|
39
|
+
{
|
|
40
|
+
allTestPattern: ".*\\.(test|spec)\\.[tj]sx?$",
|
|
41
|
+
pattern: `.*\\.${filenamePattern}\\.[tj]sx?$`
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
...framework === "vitest" ? vitestRules(itOrTest) : {},
|
|
45
|
+
...framework === "jest" ? jestRules(itOrTest) : {},
|
|
46
|
+
...formattingRules ? {
|
|
47
|
+
"jest/padding-around-after-all-blocks": "warn",
|
|
48
|
+
"jest/padding-around-after-each-blocks": "warn",
|
|
49
|
+
"jest/padding-around-before-all-blocks": "warn",
|
|
50
|
+
"jest/padding-around-before-each-blocks": "warn",
|
|
51
|
+
"jest/padding-around-describe-blocks": "warn",
|
|
52
|
+
"jest/padding-around-expect-groups": "warn",
|
|
53
|
+
"jest/padding-around-test-blocks": "warn"
|
|
54
|
+
} : {}
|
|
55
|
+
},
|
|
56
|
+
...framework !== "jest" && framework !== "vitest" ? {
|
|
57
|
+
settings: {
|
|
58
|
+
jest: {
|
|
59
|
+
globalPackage: framework === "node" ? "node:test" : "bun:test"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} : {}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
testingConfig
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=chunk-V34MGXE7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/testing/config.ts"],"sourcesContent":["import jest from \"eslint-plugin-jest\";\nimport vitest from \"eslint-plugin-vitest\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jestRules } from \"./jestRules.js\";\nimport { vitestRules } from \"./vitestRules.js\";\n\nexport interface TestingConfig {\n filenamePattern?: \"spec\" | \"test\";\n files?: string[];\n formattingRules?: boolean;\n framework?: \"bun\" | \"jest\" | \"node\" | \"vitest\";\n itOrTest?: \"it\" | \"test\";\n}\n\n/**\n * Creates an ESLint configuration object for testing.\n *\n * @param options - Configuration options\n * @param options.files - Files to include in the configuration\n * @param options.filenamePattern - \".test\" or \".spec\" filename pattern\n * @param options.itOrTest - \"it\" or \"test\"\n * @param options.framework - \"jest\" or \"vitest\"\n * @param options.formattingRules - Whether to include formatting rules like padding around blocks\n * @returns ESLint configuration object\n */\nexport const testingConfig = (\n {\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }: TestingConfig = {\n filenamePattern: \"test\",\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"test\",\n },\n): EslintConfigObject => ({\n files: files ?? [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n languageOptions: {\n globals:\n framework === \"vitest\" ?\n { ...vitest.environments.env.globals }\n : jest.environments.globals.globals,\n },\n name: configNames.testing,\n plugins: {\n jest,\n vitest,\n },\n rules: {\n // jest doesn't have a file name rule, so we'll use this one for both\n \"vitest/consistent-test-filename\": [\n \"warn\",\n {\n allTestPattern: \".*\\\\.(test|spec)\\\\.[tj]sx?$\",\n pattern: `.*\\\\.${filenamePattern}\\\\.[tj]sx?$`,\n },\n ],\n ...(framework === \"vitest\" ? vitestRules(itOrTest) : {}),\n ...(framework === \"jest\" ? jestRules(itOrTest) : {}),\n ...(formattingRules ?\n {\n \"jest/padding-around-after-all-blocks\": \"warn\",\n \"jest/padding-around-after-each-blocks\": \"warn\",\n \"jest/padding-around-before-all-blocks\": \"warn\",\n \"jest/padding-around-before-each-blocks\": \"warn\",\n \"jest/padding-around-describe-blocks\": \"warn\",\n \"jest/padding-around-expect-groups\": \"warn\",\n \"jest/padding-around-test-blocks\": \"warn\",\n }\n : {}),\n },\n ...(framework !== \"jest\" && framework !== \"vitest\" ?\n {\n settings: {\n jest: {\n globalPackage: framework === \"node\" ? \"node:test\" : \"bun:test\",\n },\n },\n }\n : {}),\n});\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,OAAO,YAAY;AA2BZ,IAAM,gBAAgB,CAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAmB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AACZ,OACwB;AAAA,EACxB,OAAO,SAAS,CAAC,kCAAkC;AAAA,EACnD,iBAAiB;AAAA,IACf,SACE,cAAc,WACZ,EAAE,GAAG,OAAO,aAAa,IAAI,QAAQ,IACrC,KAAK,aAAa,QAAQ;AAAA,EAChC;AAAA,EACA,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAAA,IAEL,mCAAmC;AAAA,MACjC;AAAA,MACA;AAAA,QACE,gBAAgB;AAAA,QAChB,SAAS,QAAQ,eAAe;AAAA,MAClC;AAAA,IACF;AAAA,IACA,GAAI,cAAc,WAAW,YAAY,QAAQ,IAAI,CAAC;AAAA,IACtD,GAAI,cAAc,SAAS,UAAU,QAAQ,IAAI,CAAC;AAAA,IAClD,GAAI,kBACF;AAAA,MACE,wCAAwC;AAAA,MACxC,yCAAyC;AAAA,MACzC,yCAAyC;AAAA,MACzC,0CAA0C;AAAA,MAC1C,uCAAuC;AAAA,MACvC,qCAAqC;AAAA,MACrC,mCAAmC;AAAA,IACrC,IACA,CAAC;AAAA,EACL;AAAA,EACA,GAAI,cAAc,UAAU,cAAc,WACxC;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,eAAe,cAAc,SAAS,cAAc;AAAA,MACtD;AAAA,IACF;AAAA,EACF,IACA,CAAC;AACL;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
baseEslintConfig
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-67MZ7HGN.js";
|
|
4
4
|
import "../../chunk-ZOCL6XIB.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-LODDGOPW.js";
|
|
6
6
|
import "../../chunk-7D4SUZUM.js";
|
|
7
7
|
export {
|
|
8
8
|
baseEslintConfig
|
|
@@ -13,8 +13,8 @@ declare const configNames: {
|
|
|
13
13
|
readonly preferArrowFunction: "prefer-arrow-function-config";
|
|
14
14
|
readonly react: "react-config";
|
|
15
15
|
readonly reactCompiler: "react-compiler-config";
|
|
16
|
+
readonly testing: "testing-config";
|
|
16
17
|
readonly typescript: "tseslint-config";
|
|
17
|
-
readonly vitest: "vitest-config";
|
|
18
18
|
};
|
|
19
19
|
type ConfigName = (typeof configNames)[keyof typeof configNames];
|
|
20
20
|
|
package/dist/eslint/constants.js
CHANGED
package/dist/eslint/ignores.js
CHANGED
package/dist/eslint/index.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
2
|
import { FunctionStyle } from './types.js';
|
|
3
|
+
import { TestingConfig } from './testing/config.js';
|
|
3
4
|
import './constants.js';
|
|
4
5
|
|
|
5
|
-
interface TestingConfig {
|
|
6
|
-
filenamePattern?: "spec" | "test";
|
|
7
|
-
files?: string[];
|
|
8
|
-
itOrTest?: "it" | "test";
|
|
9
|
-
lib?: "vitest";
|
|
10
|
-
}
|
|
11
6
|
interface EslintConfigOptions {
|
|
12
7
|
functionStyle?: "off" | FunctionStyle;
|
|
13
8
|
ignores?: string[];
|
|
@@ -35,12 +30,13 @@ interface EslintConfigOptions {
|
|
|
35
30
|
* @param options.testing - An object with the following properties:
|
|
36
31
|
* - `filenamePattern`: One of "spec" or "test" to determine which filename pattern to use.
|
|
37
32
|
* - `files`: Array of file patterns to include in the configuration.
|
|
33
|
+
* - `framework`: One of "vitest" or "jest" to determine which testing library to use.
|
|
34
|
+
* - `formattingRules`: Whether to include formatting rules like padding around blocks.
|
|
38
35
|
* - `itOrTest`: One of "it" or "test" to determine which test function to use.
|
|
39
|
-
* - `lib`: One of "vitest" to determine which testing library to use. Jest support forthcoming.
|
|
40
36
|
* @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.
|
|
41
37
|
* @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.
|
|
42
38
|
* @returns An array of ESLint configuration objects.
|
|
43
39
|
*/
|
|
44
40
|
declare const eslintConfig: ({ functionStyle, ignores, jsdoc, react, sorting, testing, typescript, }?: EslintConfigOptions, ...additionalConfigs: Linter.Config[]) => Linter.Config[];
|
|
45
41
|
|
|
46
|
-
export { type EslintConfigOptions,
|
|
42
|
+
export { type EslintConfigOptions, eslintConfig };
|
package/dist/eslint/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
eslintConfig
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-ZQ3U2JXO.js";
|
|
6
|
-
import "../chunk-3NAB7PYG.js";
|
|
7
|
-
import "../chunk-43MH6BR2.js";
|
|
8
|
-
import "../chunk-26SVGV32.js";
|
|
9
|
-
import "../chunk-RBMRMMJZ.js";
|
|
10
|
-
import "../chunk-VEO5AWMY.js";
|
|
3
|
+
} from "../chunk-D3SKAD35.js";
|
|
4
|
+
import "../chunk-GMXUFYEC.js";
|
|
11
5
|
import "../chunk-LITSWCYQ.js";
|
|
12
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-H2WBGBO4.js";
|
|
7
|
+
import "../chunk-2DEE5IMM.js";
|
|
8
|
+
import "../chunk-26SVGV32.js";
|
|
9
|
+
import "../chunk-IDOXOS33.js";
|
|
10
|
+
import "../chunk-V34MGXE7.js";
|
|
11
|
+
import "../chunk-3A7OYQSX.js";
|
|
12
|
+
import "../chunk-PHFQMAHS.js";
|
|
13
|
+
import "../chunk-67MZ7HGN.js";
|
|
13
14
|
import "../chunk-ZOCL6XIB.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-MICOVBJ4.js";
|
|
15
16
|
import "../chunk-XCPOAYGQ.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-67I7QCZW.js";
|
|
17
18
|
import "../chunk-3SHRYTUT.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-4JICVSDT.js";
|
|
20
|
+
import "../chunk-LODDGOPW.js";
|
|
20
21
|
import "../chunk-7D4SUZUM.js";
|
|
21
22
|
export {
|
|
22
23
|
eslintConfig
|