js-style-kit 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -41
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/eslint/ignores.ts +1 -0
- package/src/eslint/index.ts +50 -50
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface EslintConfigOptions {
|
|
|
87
87
|
* @param options - The optional configuration object.
|
|
88
88
|
* @param options.convex - Whether to include Convex rules.
|
|
89
89
|
* @param options.functionStyle - The function style to enforce. Defaults to "arrow".
|
|
90
|
-
* @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `
|
|
90
|
+
* @param options.ignores - Additional paths to ignore. Already excludes `node_modules`, `dist`, and `build`.
|
|
91
91
|
* @param options.importPlugin - Whether to include the import plugin. Defaults to true.
|
|
92
92
|
* @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.
|
|
93
93
|
* @param options.query - Whether to include TanStack Query rules.
|
package/dist/index.js
CHANGED
|
@@ -528,6 +528,7 @@ var ignoresConfig = ({
|
|
|
528
528
|
}) => ({
|
|
529
529
|
ignores: [
|
|
530
530
|
"**/dist/",
|
|
531
|
+
"**/build/",
|
|
531
532
|
...reactFramework === "next" ? [".next"] : [],
|
|
532
533
|
...reactFramework === "react-router" ? [".react-router"] : [],
|
|
533
534
|
...storybook ? ["!.storybook"] : [],
|
|
@@ -1662,11 +1663,10 @@ var eslintConfig = ({
|
|
|
1662
1663
|
categorizedRules[configNames.base]
|
|
1663
1664
|
)
|
|
1664
1665
|
];
|
|
1665
|
-
if (
|
|
1666
|
+
if (functionStyle === "arrow") {
|
|
1666
1667
|
configs.push(
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
categorizedRules[configNames.jsdoc]
|
|
1668
|
+
preferArrowFunctionConfig(
|
|
1669
|
+
categorizedRules[configNames.preferArrowFunction]
|
|
1670
1670
|
)
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
@@ -1683,36 +1683,26 @@ var eslintConfig = ({
|
|
|
1683
1683
|
importConfig(Boolean(typescript), categorizedRules[configNames.import])
|
|
1684
1684
|
);
|
|
1685
1685
|
}
|
|
1686
|
-
if (
|
|
1687
|
-
const
|
|
1688
|
-
const shouldUseReactRefresh = (
|
|
1689
|
-
// Explicit setting takes precedence
|
|
1690
|
-
reactOptions.reactRefresh === true || // Framework-based default (vite/none use reactRefresh by default)
|
|
1691
|
-
(reactOptions.framework === "vite" || reactOptions.framework === "none") && reactOptions.reactRefresh !== false
|
|
1692
|
-
);
|
|
1693
|
-
if (shouldUseReactRefresh) {
|
|
1694
|
-
configs.push(
|
|
1695
|
-
reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh])
|
|
1696
|
-
);
|
|
1697
|
-
}
|
|
1686
|
+
if (unicorn2) {
|
|
1687
|
+
const filenameCase = isObject(unicorn2) ? unicorn2.filenameCase : void 0;
|
|
1698
1688
|
configs.push(
|
|
1699
|
-
|
|
1700
|
-
customRules: categorizedRules[configNames.
|
|
1701
|
-
|
|
1702
|
-
reactCompiler: reactOptions.reactCompiler ?? true,
|
|
1703
|
-
typescript: Boolean(typescript)
|
|
1689
|
+
unicornConfig({
|
|
1690
|
+
customRules: categorizedRules[configNames.unicorn],
|
|
1691
|
+
filenameCase
|
|
1704
1692
|
})
|
|
1705
1693
|
);
|
|
1706
|
-
if (isObject(react2) && react2.framework === "next") {
|
|
1707
|
-
configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
|
|
1708
|
-
}
|
|
1709
1694
|
}
|
|
1710
|
-
if (
|
|
1711
|
-
configs.push(
|
|
1695
|
+
if (sorting) {
|
|
1696
|
+
configs.push(
|
|
1697
|
+
perfectionistConfig(categorizedRules[configNames.perfectionist])
|
|
1698
|
+
);
|
|
1712
1699
|
}
|
|
1713
|
-
if (
|
|
1700
|
+
if (jsdoc2 !== false) {
|
|
1714
1701
|
configs.push(
|
|
1715
|
-
|
|
1702
|
+
jsdocConfig(
|
|
1703
|
+
jsdoc2.requireJsdoc ?? false,
|
|
1704
|
+
categorizedRules[configNames.jsdoc]
|
|
1705
|
+
)
|
|
1716
1706
|
);
|
|
1717
1707
|
}
|
|
1718
1708
|
if (testing !== false) {
|
|
@@ -1748,25 +1738,36 @@ var eslintConfig = ({
|
|
|
1748
1738
|
)
|
|
1749
1739
|
);
|
|
1750
1740
|
}
|
|
1751
|
-
if (
|
|
1752
|
-
|
|
1753
|
-
|
|
1741
|
+
if (react2) {
|
|
1742
|
+
const reactOptions = isObject(react2) ? react2 : {};
|
|
1743
|
+
const shouldUseReactRefresh = (
|
|
1744
|
+
// Explicit setting takes precedence
|
|
1745
|
+
reactOptions.reactRefresh === true || // Framework-based default (vite/none use reactRefresh by default)
|
|
1746
|
+
(reactOptions.framework === "vite" || reactOptions.framework === "none") && reactOptions.reactRefresh !== false
|
|
1754
1747
|
);
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1748
|
+
if (shouldUseReactRefresh) {
|
|
1749
|
+
configs.push(
|
|
1750
|
+
reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh])
|
|
1751
|
+
);
|
|
1752
|
+
}
|
|
1758
1753
|
configs.push(
|
|
1759
|
-
|
|
1760
|
-
customRules: categorizedRules[configNames.
|
|
1761
|
-
|
|
1754
|
+
reactEslintConfig({
|
|
1755
|
+
customRules: categorizedRules[configNames.react],
|
|
1756
|
+
functionStyle,
|
|
1757
|
+
reactCompiler: reactOptions.reactCompiler ?? true,
|
|
1758
|
+
typescript: Boolean(typescript)
|
|
1762
1759
|
})
|
|
1763
1760
|
);
|
|
1761
|
+
if (isObject(react2) && react2.framework === "next") {
|
|
1762
|
+
configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
|
|
1763
|
+
}
|
|
1764
1764
|
}
|
|
1765
|
-
if (
|
|
1765
|
+
if (query) {
|
|
1766
|
+
configs.push(queryConfig(categorizedRules[configNames.query]));
|
|
1767
|
+
}
|
|
1768
|
+
if (convex) {
|
|
1766
1769
|
configs.push(
|
|
1767
|
-
|
|
1768
|
-
categorizedRules[configNames.preferArrowFunction]
|
|
1769
|
-
)
|
|
1770
|
+
convexConfig(categorizedRules[configNames.convex], Boolean(unicorn2))
|
|
1770
1771
|
);
|
|
1771
1772
|
}
|
|
1772
1773
|
if (storybook) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/is-type.ts","../src/eslint/constants.ts","../src/eslint/base/rules.ts","../src/eslint/base/config.ts","../src/eslint/convex/config.ts","../src/eslint/convex/rules.ts","../src/eslint/ignores.ts","../src/eslint/import/config.ts","../src/eslint/import/rules.ts","../src/eslint/jsdoc/config.ts","../src/eslint/jsdoc/rules.ts","../src/eslint/nextjs/config.ts","../src/eslint/nextjs/rules.ts","../src/eslint/perfectionist/config.ts","../src/eslint/perfectionist/rules.ts","../src/eslint/prefer-arrow-function/config.ts","../src/eslint/process-custom-rules.ts","../src/eslint/query/config.ts","../src/eslint/query/rules.ts","../src/eslint/react-refresh/config.ts","../src/eslint/react-refresh/rules.ts","../src/eslint/react/config.ts","../src/eslint/react/rules.ts","../src/eslint/storybook/config.ts","../src/eslint/testing/config.ts","../src/eslint/testing/get-import-restrictions.ts","../src/eslint/testing/jest-rules.ts","../src/eslint/testing/vitest-rules.ts","../src/eslint/turbo/config.ts","../src/eslint/typescript/config.ts","../src/eslint/typescript/rules.ts","../src/eslint/unicorn/config.ts","../src/eslint/unicorn/rules.ts","../src/eslint/index.ts","../src/prettier/index.ts"],"sourcesContent":["/**\n * Type predicate for string values\n *\n * @param value - The value to check\n * @returns True if the value is a string, false otherwise\n */\nexport const isString = (value: unknown): value is string => {\n return typeof value === \"string\";\n};\n\n/**\n * Type predicate for number values\n *\n * @param value - The value to check\n * @returns True if the value is a number and not NaN, false otherwise\n */\nexport const isNumber = (value: unknown): value is number => {\n return typeof value === \"number\" && !Number.isNaN(value);\n};\n\n/**\n * Type predicate for boolean values\n *\n * @param value - The value to check\n * @returns True if the value is a boolean, false otherwise\n */\nexport const isBoolean = (value: unknown): value is boolean => {\n return typeof value === \"boolean\";\n};\n\n/**\n * Type predicate for array values\n *\n * @param value - The value to check\n * @returns True if the value is an array, false otherwise\n */\nexport const isArray = <T = unknown>(value: unknown): value is T[] => {\n return Array.isArray(value);\n};\n\n/**\n * Type predicate for object values (excluding null and arrays)\n *\n * @param value - The value to check\n * @returns True if the value is an object (not null and not an array), false otherwise\n */\nexport const isObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * Type predicate for function values\n *\n * @param value - The value to check\n * @returns True if the value is a function, false otherwise\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport const isFunction = (value: unknown): value is Function => {\n return typeof value === \"function\";\n};\n","/**\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\",\n convex: \"convex\",\n disableTypeChecked: \"UserConfig[1] > typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n import: \"import\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n query: \"@tanstack/query\",\n react: \"react\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n\n/**\n * Maps plugin prefixes to their corresponding config names.\n * This is the single source of truth for categorizing rules by plugin.\n */\nexport const pluginPrefixMap = new Map<string, ConfigName>([\n [\"@convex-dev\", configNames.convex],\n [\"@tanstack/query\", configNames.query],\n [\"@typescript-eslint\", configNames.typescript],\n [\"import\", configNames.import],\n [\"import-x\", configNames.import],\n [\"jest\", configNames.testing],\n [\"jsdoc\", configNames.jsdoc],\n [\"nextjs\", configNames.nextjs],\n [\"perfectionist\", configNames.perfectionist],\n [\"react\", configNames.react],\n [\"react-hooks\", configNames.react],\n [\"react-refresh\", configNames.reactRefresh],\n [\"storybook\", configNames.storybook],\n [\"turbo\", configNames.turbo],\n [\"unicorn\", configNames.unicorn],\n [\"vitest\", configNames.testing],\n]);\n","import type { FunctionStyle } from \"../types.js\";\nimport type { BaseRules } from \"./types.js\";\n\n/**\n * Generates the base set of ESLint rules with configurable function style enforcement.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @returns An object containing ESLint rule configurations\n */\nexport const baseEslintRules = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): BaseRules => ({\n ...(!typescript ?\n {\n \"no-unused-expressions\": \"warn\",\n \"no-unused-vars\": \"warn\",\n }\n : {}),\n /**\n * Require return statements in array methods callbacks.\n *\n * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return\n */\n \"array-callback-return\": [\n \"warn\",\n { allowImplicit: true, checkForEach: true },\n ],\n /**\n * Treat `var` statements as if they were block scoped.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var\n */\n \"block-scoped-var\": \"warn\",\n /**\n * Require camel case names.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/camelcase\n */\n camelcase: [\n \"warn\",\n {\n allow: [\"^UNSAFE_\"],\n ignoreDestructuring: false,\n ignoreImports: true,\n properties: \"never\",\n },\n ],\n /**\n * Require curly braces for multiline blocks.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/curly\n */\n curly: [\"warn\", \"multi-line\"],\n /**\n * Require default clauses in switch statements to be last (if used).\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last\n */\n \"default-case-last\": \"warn\",\n /**\n * Require triple equals (`===` and `!==`).\n *å\n * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq\n */\n eqeqeq: \"warn\",\n \"for-direction\": \"warn\",\n /**\n * Require function expressions to have a name.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/func-names\n */\n \"func-names\": [\"warn\", \"as-needed\"],\n // if arrow function, we use the prefer-arrow-functions plugin\n ...(functionStyle === \"off\" ? { \"func-style\": \"off\" }\n : functionStyle === \"arrow\" ?\n { \"func-style\": \"off\" } // When arrow, func-style is off and prefer-arrow-functions is used instead\n : { \"func-style\": [\"warn\", functionStyle, { allowArrowFunctions: true }] }),\n /**\n * Require grouped accessor pairs in object literals and classes.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs\n */\n \"grouped-accessor-pairs\": \"warn\",\n /**\n * Require a capital letter for constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/new-cap\n */\n \"new-cap\": [\"warn\", { capIsNew: false }],\n /**\n * Disallow use of `alert()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert\n */\n \"no-alert\": \"warn\",\n \"no-async-promise-executor\": \"warn\",\n /**\n * Disallow use of bitwise operators.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise\n */\n \"no-bitwise\": \"warn\",\n /**\n * Disallow use of `caller`/`callee`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller\n */\n \"no-caller\": \"warn\",\n \"no-case-declarations\": \"warn\",\n \"no-compare-neg-zero\": \"warn\",\n \"no-cond-assign\": \"warn\",\n /**\n * Disallow the use of console.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-console\": [\"warn\", { allow: [\"info\", \"warn\", \"error\"] }],\n /**\n * Disallow expressions where the operation doesn't affect the value.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-constant-binary-expression\": \"warn\",\n \"no-constant-condition\": \"warn\",\n /**\n * Disallow returning value in constructor.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return\n */\n \"no-constructor-return\": \"warn\",\n \"no-control-regex\": \"warn\",\n \"no-debugger\": \"warn\",\n \"no-delete-var\": \"warn\",\n \"no-dupe-else-if\": \"warn\",\n \"no-duplicate-case\": \"warn\",\n /**\n * Disallow using an `else` if the `if` block contains a return.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return\n */\n \"no-else-return\": \"warn\",\n \"no-empty\": \"warn\",\n \"no-empty-character-class\": \"warn\",\n \"no-empty-pattern\": \"warn\",\n \"no-empty-static-block\": \"warn\",\n /**\n * Disallow `eval()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval\n */\n \"no-eval\": \"warn\",\n \"no-ex-assign\": \"warn\",\n /**\n * Disallow extending native objects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native\n */\n \"no-extend-native\": \"warn\",\n /**\n * Disallow unnecessary function binding.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind\n */\n \"no-extra-bind\": \"warn\",\n \"no-extra-boolean-cast\": \"warn\",\n /**\n * Disallow unnecessary labels.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label\n */\n \"no-extra-label\": \"warn\",\n \"no-fallthrough\": \"warn\",\n \"no-global-assign\": \"warn\",\n /**\n * Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.\n *\n * 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion\n */\n \"no-implicit-coercion\": \"warn\",\n \"no-invalid-regexp\": \"warn\",\n \"no-irregular-whitespace\": \"warn\",\n /**\n * Disallow usage of `__iterator__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator\n */\n \"no-iterator\": \"warn\",\n /**\n * Disallow labels that share a name with a variable.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var\n */\n \"no-label-var\": \"warn\",\n /**\n * Disallow use of labels for anything other than loops and switches.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels\n */\n \"no-labels\": [\"warn\"],\n /**\n * Disallow unnecessary nested blocks.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks\n */\n \"no-lone-blocks\": \"warn\",\n /**\n * Disallow if as the only statement in an else block.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if\n */\n \"no-lonely-if\": \"warn\",\n \"no-loss-of-precision\": \"warn\",\n \"no-misleading-character-class\": \"warn\",\n /**\n * Disallow use of chained assignment expressions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign\n */\n \"no-multi-assign\": [\"warn\"],\n /**\n * Disallow `new` for side effects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new\n */\n \"no-new\": \"warn\",\n /**\n * Disallow function constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func\n */\n \"no-new-func\": \"warn\",\n /**\n * Disallow primitive wrapper instances, such as `new String('foo')`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers\n */\n \"no-new-wrappers\": \"warn\",\n \"no-nonoctal-decimal-escape\": \"warn\",\n \"no-octal\": \"warn\",\n /**\n * Disallow use of octal escape sequences in string literals.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape\n */\n \"no-octal-escape\": \"warn\",\n /**\n * Disallow reassignment of function parameters.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign\n */\n \"no-param-reassign\": \"warn\",\n /**\n * Disallow returning values from Promise executor functions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return\n */\n \"no-promise-executor-return\": \"warn\",\n /**\n * Disallow usage of the deprecated `__proto__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto\n */\n \"no-proto\": \"warn\",\n \"no-prototype-builtins\": \"warn\",\n \"no-regex-spaces\": \"warn\",\n /**\n * Disallow assignment in `return` statement.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign\n */\n \"no-return-assign\": \"warn\",\n /**\n * Disallow use of `javascript:` urls.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url\n */\n \"no-script-url\": \"warn\",\n \"no-self-assign\": \"warn\",\n /**\n * Disallow comparisons where both sides are exactly the same.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare\n */\n \"no-self-compare\": \"warn\",\n /**\n * Disallow use of comma operator.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences\n */\n \"no-sequences\": \"warn\",\n \"no-shadow-restricted-names\": \"warn\",\n \"no-sparse-arrays\": \"warn\",\n /**\n * Disallow template literal placeholder syntax in regular strings, as\n * these are likely errors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string\n */\n \"no-template-curly-in-string\": \"warn\",\n /**\n * Disallow initializing variables to `undefined`.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init\n */\n \"no-undef-init\": \"warn\",\n \"no-unexpected-multiline\": \"warn\",\n /**\n * Disallow ternary operators when simpler alternatives exist.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary\n */\n \"no-unneeded-ternary\": \"warn\",\n /**\n * Disallow loops with a body that allows only one iteration.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop\n */\n \"no-unreachable-loop\": \"warn\",\n \"no-unsafe-finally\": \"warn\",\n \"no-unsafe-optional-chaining\": \"warn\",\n \"no-unused-labels\": \"warn\",\n \"no-unused-private-class-members\": \"warn\",\n \"no-useless-backreference\": \"warn\",\n /**\n * Disallow unnecessary `.call()` and `.apply()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call\n */\n \"no-useless-call\": \"warn\",\n \"no-useless-catch\": \"warn\",\n /**\n * Disallow useless computed property keys.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-computed-key\n */\n \"no-useless-computed-key\": \"warn\",\n /**\n * Disallow unnecessary concatenation of strings.\n *\n * � Not fixable - https://eslint.org/docs/rules/no-useless-concat\n */\n \"no-useless-concat\": \"warn\",\n \"no-useless-escape\": \"warn\",\n /**\n * Disallow renaming import, export, and destructured assignments to the\n * same name.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-rename\n */\n \"no-useless-rename\": \"warn\",\n /**\n * Disallow redundant return statements.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-return\n */\n \"no-useless-return\": \"warn\",\n /**\n * Require `let` or `const` instead of `var`.\n * ts transpiles let/const to var, so no need for vars any more\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-var\n */\n \"no-var\": \"warn\",\n \"no-with\": \"warn\",\n /**\n * Require object literal shorthand syntax.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/object-shorthand\n */\n \"object-shorthand\": \"warn\",\n /**\n * Require default to `const` instead of `let`.\n * ts provides better types with const\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-const\n */\n \"prefer-const\": \"warn\",\n /**\n * Require using named capture groups in regular expressions.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group\n */\n \"prefer-named-capture-group\": \"warn\",\n /**\n * Disallow parseInt() in favor of binary, octal, and hexadecimal literals.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-numeric-literals\n */\n \"prefer-numeric-literals\": \"warn\",\n /**\n * Require use of an object spread over Object.assign.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread\n */\n \"prefer-object-spread\": \"warn\",\n /**\n * Disallow use of the RegExp constructor in favor of regular expression\n * literals.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-regex-literals\n */\n \"prefer-regex-literals\": \"warn\",\n /**\n * Require using rest parameters instead of `arguments`.\n * ts provides better types with rest args over arguments\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-rest-params\n */\n \"prefer-rest-params\": \"warn\",\n /**\n * Require using spread syntax instead of `.apply()`.\n * ts transpiles spread to apply, so no need for manual apply\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-spread\n */\n \"prefer-spread\": \"warn\",\n /**\n * Require using template literals instead of string concatenation.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-template\n */\n \"prefer-template\": \"warn\",\n \"require-yield\": \"warn\",\n /**\n * Require a `Symbol` description.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/symbol-description\n */\n \"symbol-description\": \"warn\",\n \"use-isnan\": \"warn\",\n \"valid-typeof\": \"warn\",\n /**\n * Disallow \"Yoda conditions\", ensuring the comparison.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/yoda\n */\n yoda: \"warn\",\n});\n","import type {\n EslintConfigObject,\n EslintRuleConfig,\n FunctionStyle,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { baseEslintRules } from \"./rules.js\";\n\n/**\n * Creates a base ESLint configuration object with specified function style rules.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @param customRules - Optional object containing custom rules to override or add to the base configuration.\n * @returns ESLint configuration object\n */\nexport const baseEslintConfig = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n },\n linterOptions: { reportUnusedDisableDirectives: true },\n name: configNames.base,\n rules: {\n ...baseEslintRules(functionStyle, typescript),\n ...(customRules ?? {}),\n },\n});\n","import type { ESLint } from \"eslint\";\n\nimport { createRequire } from \"node:module\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { convexRules } from \"./rules.js\";\n\n// TODO: Replace with ESM import once @convex-dev/eslint-plugin stabilizes\n// The plugin doesn't have proper ESM exports yet\nconst require = createRequire(import.meta.url);\n\nconst convexPlugin = require(\"@convex-dev/eslint-plugin\");\n\n/**\n * Creates an ESLint configuration for Convex.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Convex configuration.\n * @param unicorn - Whether the config uses unicorn rules.\n * @returns ESLint configuration object for Convex\n */\nexport const convexConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n unicorn?: boolean,\n): EslintConfigObject => ({\n files: [\"**/convex/**/*.{ts,js}\"],\n name: configNames.convex,\n plugins: {\n \"@convex-dev\": convexPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...convexRules,\n ...(customRules ?? {}),\n // Convex files must be camelCase\n ...(unicorn ?\n {\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: \"camelCase\",\n },\n ],\n }\n : {}),\n },\n});\n","import type { ConvexRules } from \"./types.js\";\n\nexport const convexRules: ConvexRules = {\n \"@convex-dev/import-wrong-runtime\": \"warn\",\n \"@convex-dev/no-old-registered-function-syntax\": \"warn\",\n \"@convex-dev/require-args-validator\": \"warn\",\n};\n","import type { Linter } from \"eslint\";\n\nimport type { ReactFramework } from \"./types.js\";\n\nimport { configNames } from \"./constants.js\";\n\n/**\n * Creates an ESLint configuration for file and directory ignores.\n * By default, ignores node_modules, dist directories, and .git directories.\n *\n * @param options - Object with options to control the ignores configuration\n * @param options.reactFramework - The React framework being used\n * @param options.storybook - Whether to include .storybook directory in ignores\n * @param options.userIgnores - Additional glob patterns to ignore in ESLint checks\n * @returns ESLint configuration object with ignore patterns\n */\nexport const ignoresConfig = ({\n reactFramework,\n storybook,\n userIgnores,\n}: {\n reactFramework: ReactFramework;\n storybook: boolean;\n userIgnores: string[];\n}): Linter.Config => ({\n ignores: [\n \"**/dist/\",\n ...(reactFramework === \"next\" ? [\".next\"] : []),\n ...(reactFramework === \"react-router\" ? [\".react-router\"] : []),\n ...(storybook ? [\"!.storybook\"] : []),\n ...userIgnores,\n ],\n name: configNames.ignores,\n});\n","import type { ESLint } from \"eslint\";\n\nimport tsParser from \"@typescript-eslint/parser\";\nimport { createTypeScriptImportResolver } from \"eslint-import-resolver-typescript\";\nimport importXPlugin from \"eslint-plugin-import-x\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { importRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Import.\n *\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @param customRules - Optional object containing custom rules to override or add to the Import configuration.\n * @returns ESLint configuration object for Import\n */\nexport const importConfig = (\n typescript: boolean,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: \"latest\",\n parser: tsParser,\n sourceType: \"module\",\n },\n name: configNames.import,\n plugins: {\n \"import-x\": importXPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...importRules(typescript),\n ...(customRules ?? {}),\n },\n settings: {\n \"import-x/resolver\": {\n node: true,\n typescript,\n },\n \"import-x/resolver-next\": [\n createTypeScriptImportResolver({\n alwaysTryTypes: true,\n bun: true,\n }),\n ],\n },\n});\n","import type { EslintRuleConfig } from \"../types.js\";\n\ntype ImportRules = Record<`import-x/${string}`, EslintRuleConfig>;\n\n/**\n * Creates a configuration object for import ESLint rules.\n *\n * @param typescript - Whether to include TypeScript-specific rules.\n * @returns A configuration object for import ESLint rules.\n */\nexport const importRules = (typescript: boolean): ImportRules => ({\n // these rules are better handled by typescript\n ...(!typescript ?\n {\n \"import-x/default\": \"warn\",\n \"import-x/export\": \"warn\",\n \"import-x/named\": \"warn\",\n \"import-x/namespace\": \"warn\",\n \"import-x/no-unresolved\": \"warn\",\n }\n : {}),\n /**\n * Disallow non-import statements appearing before import statements.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/first.md\n */\n \"import-x/first\": \"warn\",\n /**\n * Require a newline after the last import-x/require.\n *\n * 🔧 Fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/newline-after-import.md\n */\n \"import-x/newline-after-import\": \"warn\",\n /**\n * Disallow import of modules using absolute paths.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-absolute-path.md\n */\n \"import-x/no-absolute-path\": \"warn\",\n /**\n * Disallow cyclical dependencies between modules.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-cycle.md\n */\n \"import-x/no-cycle\": \"warn\",\n \"import-x/no-duplicates\": \"warn\",\n /**\n * Disallow the use of extraneous packages.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-extraneous-dependencies.md\n */\n \"import-x/no-extraneous-dependencies\": [\"warn\", { includeTypes: true }],\n /**\n * Disallow mutable exports.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-mutable-exports.md\n */\n \"import-x/no-mutable-exports\": \"warn\",\n // red flags (thus, warnings)\n \"import-x/no-named-as-default\": \"warn\",\n \"import-x/no-named-as-default-member\": \"warn\",\n /**\n * Disallow importing packages through relative paths.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-relative-packages.md\n */\n \"import-x/no-relative-packages\": \"warn\",\n\n /**\n * Disallow a module from importing itself.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-self-import.md\n */\n \"import-x/no-self-import\": \"warn\",\n /**\n * Ensures that there are no useless path segments.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-useless-path-segments.md\n */\n \"import-x/no-useless-path-segments\": [\"warn\"],\n});\n","import jsdoc from \"eslint-plugin-jsdoc\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jsdocRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param customRules - Optional object containing custom rules to override or add to the JSDoc configuration.\n * @returns An ESLint configuration object for JSDoc comments.\n */\nexport const jsdocConfig = (\n requireJsdoc = false,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n files: [\"**/*.{js,jsx,ts,tsx,cjs,mjs}\"],\n ignores: [\"**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}\"],\n name: configNames.jsdoc,\n plugins: {\n jsdoc,\n },\n rules: {\n ...jsdocRules(requireJsdoc),\n ...(customRules ?? {}),\n },\n});\n","import type { JsdocRules } from \"./types.js\";\n\n/**\n * Generates ESLint rules configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An object containing ESLint rules configuration for JSDoc validation and formatting.\n */\nexport const jsdocRules = (\n requireJsdoc = false,\n typescript = true,\n): JsdocRules => ({\n \"jsdoc/check-access\": \"warn\",\n \"jsdoc/check-alignment\": \"warn\",\n \"jsdoc/check-param-names\": [\n \"warn\",\n {\n checkDestructured: true,\n enableFixer: true,\n },\n ],\n \"jsdoc/check-property-names\": \"warn\",\n \"jsdoc/check-tag-names\": [\n \"warn\",\n {\n typed: true,\n },\n ],\n \"jsdoc/check-types\": \"warn\",\n \"jsdoc/check-values\": \"warn\",\n \"jsdoc/empty-tags\": \"warn\",\n \"jsdoc/implements-on-classes\": \"warn\",\n \"jsdoc/multiline-blocks\": \"warn\",\n \"jsdoc/no-blank-block-descriptions\": \"off\",\n \"jsdoc/no-defaults\": \"warn\",\n \"jsdoc/no-multi-asterisks\": \"warn\",\n \"jsdoc/no-types\": typescript ? \"warn\" : \"off\",\n \"jsdoc/no-undefined-types\": typescript ? \"off\" : \"warn\",\n \"jsdoc/require-asterisk-prefix\": \"warn\",\n \"jsdoc/require-description\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-jsdoc\":\n requireJsdoc ?\n [\n \"warn\",\n {\n require: {\n ArrowFunctionExpression: true,\n ClassDeclaration: true,\n ClassExpression: true,\n FunctionDeclaration: true,\n FunctionExpression: true,\n MethodDefinition: true,\n },\n },\n ]\n : \"off\",\n \"jsdoc/require-param\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-param-description\": \"warn\",\n \"jsdoc/require-param-name\": \"warn\",\n \"jsdoc/require-property\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-property-description\": \"warn\",\n \"jsdoc/require-property-name\": \"warn\",\n \"jsdoc/require-returns\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-returns-check\": \"warn\",\n \"jsdoc/require-returns-description\": \"warn\",\n \"jsdoc/require-yields\": \"warn\",\n \"jsdoc/require-yields-check\": \"warn\",\n \"jsdoc/tag-lines\": [\n \"warn\",\n \"never\",\n {\n startLines: 1, // Allow 1 line between description and first tag\n tags: {\n param: { lines: \"never\" }, // Enforce no lines between param tags\n },\n },\n ],\n \"jsdoc/text-escaping\": \"off\",\n \"jsdoc/valid-types\": \"warn\",\n});\n","import nextjs from \"eslint-plugin-nextjs\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { nextjsRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Next.js.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Next.js configuration.\n * @returns ESLint configuration object for Next.js\n */\nexport const nextjsConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.nextjs,\n plugins: {\n nextjs,\n },\n rules: {\n ...nextjsRules,\n ...(customRules ?? {}),\n },\n});\n","import type { NextjsRules } from \"./types.js\";\n\nexport const nextjsRules: NextjsRules = {\n \"nextjs/google-font-display\": \"warn\",\n \"nextjs/google-font-preconnect\": \"warn\",\n \"nextjs/inline-script-id\": \"warn\",\n \"nextjs/next-script-for-ga\": \"warn\",\n \"nextjs/no-assign-module-variable\": \"warn\",\n \"nextjs/no-async-client-component\": \"warn\",\n \"nextjs/no-before-interactive-script-outside-document\": \"warn\",\n \"nextjs/no-css-tags\": \"warn\",\n \"nextjs/no-document-import-in-page\": \"warn\",\n \"nextjs/no-duplicate-head\": \"warn\",\n \"nextjs/no-head-element\": \"warn\",\n \"nextjs/no-head-import-in-document\": \"warn\",\n \"nextjs/no-html-link-for-pages\": \"warn\",\n \"nextjs/no-img-element\": \"warn\",\n \"nextjs/no-page-custom-font\": \"warn\",\n \"nextjs/no-script-component-in-head\": \"warn\",\n \"nextjs/no-styled-jsx-in-document\": \"warn\",\n \"nextjs/no-sync-scripts\": \"warn\",\n \"nextjs/no-title-in-document-head\": \"warn\",\n \"nextjs/no-typos\": \"warn\",\n \"nextjs/no-unwanted-polyfillio\": \"warn\",\n};\n","import perfectionist from \"eslint-plugin-perfectionist\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { perfectionistRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Perfectionist.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Perfectionist configuration.\n * @returns ESLint configuration object for Perfectionist\n */\nexport const perfectionistConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.perfectionist,\n plugins: {\n perfectionist,\n },\n rules: {\n ...perfectionistRules,\n ...(customRules ?? {}),\n },\n});\n","import type { EslintRuleConfig } from \"../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n","import type { ESLint } from \"eslint\";\n\nimport preferArrowFunctions from \"eslint-plugin-prefer-arrow-functions\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\nimport type { PreferArrowFunctionsRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Prefer Arrow Functions.\n *\n * @param customRules - Optional object containing custom rules to override or add to the configuration.\n * @returns ESLint configuration object for Prefer Arrow Functions\n */\nexport const preferArrowFunctionConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.preferArrowFunction,\n plugins: {\n \"prefer-arrow-functions\": preferArrowFunctions as ESLint.Plugin,\n },\n rules: {\n \"prefer-arrow-functions/prefer-arrow-functions\": [\n \"warn\",\n {\n returnStyle: \"unchanged\",\n singleReturnOnly: false,\n },\n ],\n ...(customRules ?? {}),\n } satisfies PreferArrowFunctionsRules,\n});\n","import type { ConfigName } from \"./constants.js\";\nimport type { EslintRuleConfig } from \"./types.js\";\n\nimport { configNames, pluginPrefixMap } from \"./constants.js\";\n\n/**\n * Categorizes custom rules provided by the user based on plugin prefixes.\n *\n * @param customRules - The custom rules provided by the user.\n * @returns An object where keys are config names (e.g., 'base', 'typescript')\n * and values are the corresponding rule subsets for that config.\n */\nexport const processCustomRules = (\n customRules: Record<string, EslintRuleConfig>,\n): Partial<Record<ConfigName, Record<string, EslintRuleConfig>>> => {\n // Initialize result object with all possible config categories\n const categorizedRules = Object.values(configNames).reduce<\n Record<ConfigName, Record<string, EslintRuleConfig>>\n >(\n (acc, configName) => {\n acc[configName] = {};\n return acc;\n },\n {} as Record<ConfigName, Record<string, EslintRuleConfig>>,\n );\n\n // Process each custom rule\n for (const [ruleKey, ruleValue] of Object.entries(customRules)) {\n // Quick check if rule has no prefix (no '/' or '@')\n // Rules without prefixes go directly to base config\n if (!ruleKey.includes(\"/\") && !ruleKey.startsWith(\"@\")) {\n categorizedRules[configNames.base][ruleKey] = ruleValue;\n continue;\n }\n\n // Extract the plugin prefix from the rule key\n let prefix: null | string = null;\n\n if (ruleKey.startsWith(\"@\")) {\n // Handle scoped packages like @typescript-eslint/rule-name\n const firstSlashIndex = ruleKey.indexOf(\"/\");\n if (firstSlashIndex !== -1) {\n prefix = ruleKey.substring(0, firstSlashIndex);\n }\n } else {\n // Handle regular plugins like eslint-plugin-react/rule-name\n const firstSlashIndex = ruleKey.indexOf(\"/\");\n if (firstSlashIndex !== -1) {\n prefix = ruleKey.substring(0, firstSlashIndex);\n }\n }\n\n // Find the corresponding config name for this prefix\n const configName =\n prefix ?\n (pluginPrefixMap.get(prefix) ?? configNames.base)\n : configNames.base;\n\n // Add the rule to the appropriate config\n categorizedRules[configName][ruleKey] = ruleValue;\n }\n\n // Filter out empty config objects to save memory\n return Object.entries(categorizedRules).reduce<\n Partial<Record<ConfigName, Record<string, EslintRuleConfig>>>\n >((acc, [configName, rules]) => {\n if (Object.keys(rules).length > 0) {\n acc[configName as ConfigName] = rules;\n }\n return acc;\n }, {});\n};\n","import type { ESLint } from \"eslint\";\n\nimport queryPlugin from \"@tanstack/eslint-plugin-query\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { queryRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for TanStack Query.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Query configuration.\n * @returns ESLint configuration object for TanStack Query\n */\nexport const queryConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.query,\n plugins: {\n \"@tanstack/query\": queryPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...queryRules,\n ...(customRules ?? {}),\n },\n});\n","import type { QueryRules } from \"./types.js\";\n\nexport const queryRules: QueryRules = {\n \"@tanstack/query/exhaustive-deps\": \"warn\",\n \"@tanstack/query/infinite-query-property-order\": \"warn\",\n \"@tanstack/query/mutation-property-order\": \"warn\",\n \"@tanstack/query/no-rest-destructuring\": \"warn\",\n \"@tanstack/query/no-unstable-deps\": \"warn\",\n \"@tanstack/query/no-void-query-fn\": \"warn\",\n \"@tanstack/query/stable-query-client\": \"warn\",\n};\n","import reactRefresh from \"eslint-plugin-react-refresh\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRefreshRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n * It enforces that components are structured in a way that integrations like\n * react-refresh expect.\n *\n * @param customRules - Optional object containing custom rules to override or add to the React Refresh configuration.\n * @returns An ESLint configuration object for React Refresh.\n */\nexport const reactRefreshEslintConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => {\n return {\n name: configNames.reactRefresh,\n plugins: {\n \"react-refresh\": reactRefresh,\n },\n rules: customRules ?? reactRefreshRules,\n };\n};\n","import type { EslintRuleConfig } from \"../types.js\";\n\nexport type ReactRefreshRules = Record<string, EslintRuleConfig> & {\n \"react-refresh/only-export-components\"?: EslintRuleConfig<{\n /**\n * Don't warn when a constant (string, number, boolean, templateLiteral)\n * is exported aside one or more components.\n */\n allowConstantExport?: boolean;\n /**\n * If you use a framework that handles HMR of some specific exports,\n * you can use this option to avoid warning for them.\n */\n allowExportNames?: string[];\n /**\n * If you're using JSX inside .js files, you can enable this option.\n * To reduce false positives, only files importing 'react' are checked.\n */\n checkJS?: boolean;\n /**\n * If you're exporting a component wrapped in a custom HOC,\n * you can use this option to avoid false positives.\n */\n customHOCs?: string[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n *\n * @returns Configuration object containing ESLint rules for React Refresh\n */\nexport const reactRefreshRules: ReactRefreshRules = {\n /**\n * Validate that your components can safely be updated with Fast Refresh.\n *\n * This rule enforces that components are structured in a way that integrations\n * like react-refresh expect.\n *\n * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh\n */\n \"react-refresh/only-export-components\": [\n \"warn\",\n { allowConstantExport: true },\n ],\n};\n","import react from \"eslint-plugin-react\";\nimport pluginReactHooks from \"eslint-plugin-react-hooks\";\nimport globals from \"globals\";\n\nimport type {\n EslintConfigObject,\n EslintRuleConfig,\n FunctionStyle,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React.\n *\n * @param options - Configuration options\n * @param options.functionStyle - Controls how functions (components) should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param options.reactCompiler - Whether to use the React compiler rules from `eslint-plugin-react-hooks`\n * @param options.typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly\n * @param options.customRules - Optional object containing custom rules to override or add to the React configuration\n * @returns An ESLint configuration object for React.\n */\nexport const reactEslintConfig = ({\n customRules,\n functionStyle,\n reactCompiler,\n typescript,\n}: {\n customRules?: Record<string, EslintRuleConfig>;\n functionStyle: \"off\" | FunctionStyle;\n reactCompiler: boolean;\n typescript: boolean;\n}): EslintConfigObject => {\n return {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n name: configNames.react,\n plugins: {\n react,\n \"react-hooks\": pluginReactHooks,\n },\n rules: {\n ...reactRules({ functionStyle, reactCompiler, typescript }),\n ...(customRules ?? {}),\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n };\n};\n","import type { FunctionStyle } from \"../types.js\";\nimport type { ReactFunctionDefinitions, ReactRules } from \"./types.js\";\n\n/**\n * Generates ESLint rules configuration for React and React Hooks.\n * Includes settings for function component style enforcement and TypeScript-specific rules.\n *\n * @param options - Configuration options\n * @param options.functionStyle - The preferred style for React function components: 'arrow' for arrow functions, 'declaration' for function declarations, 'expression' for function expressions, or 'off' to disable style enforcement\n * @param options.reactCompiler - Whether to use the React compiler rules from `eslint-plugin-react-hooks`\n * @param options.typescript - Whether TypeScript-specific React rules should be enabled\n * @returns Configuration object containing ESLint rules for React and React Hooks\n */\nexport const reactRules = ({\n functionStyle,\n reactCompiler,\n typescript,\n}: {\n functionStyle: \"off\" | FunctionStyle;\n reactCompiler: boolean;\n typescript: boolean;\n}): ReactRules => {\n const functionStyleMap: Record<FunctionStyle, ReactFunctionDefinitions> = {\n arrow: \"arrow-function\",\n declaration: \"function-declaration\",\n expression: \"function-expression\",\n };\n\n // TODO: split out new rules into a `react-compiler` option\n\n return {\n /**\n * Disabled in favor of TypeScript for type checking\n */\n ...(typescript ? {} : { \"react/prop-types\": \"warn\" }),\n /**\n * Core React Hooks rules\n */\n \"react-hooks/exhaustive-deps\": \"warn\",\n \"react-hooks/rules-of-hooks\": \"warn\",\n /**\n * React compiler rules\n */\n ...(reactCompiler ?\n {\n /**\n * Does not seem to be working, and overlaps with static-components\n */\n // \"react-hooks/component-hook-factories\": \"warn\",\n\n /**\n * seems unecessary unless you're rolling your own React setup, users can always enable\n */\n // \"react-hooks/config\": \"warn\",\n\n \"react-hooks/error-boundaries\": \"warn\",\n \"react-hooks/globals\": \"warn\",\n \"react-hooks/immutability\": \"warn\",\n \"react-hooks/incompatible-library\": \"warn\",\n \"react-hooks/preserve-manual-memoization\": \"warn\",\n \"react-hooks/purity\": \"warn\",\n \"react-hooks/refs\": \"warn\",\n \"react-hooks/set-state-in-effect\": \"warn\",\n \"react-hooks/set-state-in-render\": \"warn\",\n\n /**\n * overlaps with react/no-unstable-nested-components\n */\n // \"react-hooks/static-components\": \"warn\",\n\n \"react-hooks/unsupported-syntax\": \"warn\",\n \"react-hooks/use-memo\": \"warn\",\n }\n : {}),\n /**\n * Require an explicit type when using button elements.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md\n */\n \"react/button-has-type\": \"warn\",\n \"react/destructuring-assignment\": [\"warn\", \"always\"],\n \"react/display-name\": \"warn\",\n /**\n * Require consistent function type for function components.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md\n */\n \"react/function-component-definition\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n {\n namedComponents: functionStyleMap[functionStyle],\n unnamedComponents:\n functionStyle === \"arrow\" ? \"arrow-function\" : (\n \"function-expression\"\n ),\n },\n ]\n ),\n /**\n * Require consistent boolean attributes notation in JSX.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n */\n \"react/jsx-boolean-value\": \"warn\",\n /**\n * Disallow unnecessary curly braces in JSX props and children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n */\n \"react/jsx-curly-brace-presence\": \"warn\",\n /**\n * Require using shorthand form for React fragments, unless required.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md\n */\n \"react/jsx-fragments\": \"warn\",\n \"react/jsx-key\": \"warn\",\n \"react/jsx-no-comment-textnodes\": \"warn\",\n \"react/jsx-no-duplicate-props\": \"warn\",\n /**\n * Prevent problematic leaked values from being rendered.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md\n */\n \"react/jsx-no-leaked-render\": \"warn\",\n /**\n * Prevents usage of unsafe `target='_blank'`.\n *\n * This rule is a part of `react/recommended`, but we've modified it to\n * allow referrer.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md\n */\n \"react/jsx-no-target-blank\": [\n \"warn\",\n {\n allowReferrer: true,\n },\n ],\n \"react/jsx-no-undef\": \"warn\",\n /**\n * Disallow empty React fragments.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n */\n \"react/jsx-no-useless-fragment\": [\"warn\", { allowExpressions: true }],\n /**\n * Require the use of PascalCase for user-defined JSX components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n */\n \"react/jsx-pascal-case\": \"warn\",\n \"react/jsx-uses-react\": \"warn\",\n \"react/jsx-uses-vars\": \"warn\",\n /**\n * Disallow usage of Array index in keys.\n *\n * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n */\n \"react/no-array-index-key\": \"warn\",\n \"react/no-children-prop\": \"warn\",\n \"react/no-danger-with-children\": \"warn\",\n \"react/no-deprecated\": \"warn\",\n \"react/no-direct-mutation-state\": \"warn\",\n \"react/no-find-dom-node\": \"warn\",\n \"react/no-is-mounted\": \"warn\",\n \"react/no-render-return-value\": \"warn\",\n \"react/no-string-refs\": \"warn\",\n \"react/no-unescaped-entities\": \"warn\",\n \"react/no-unknown-property\": \"warn\",\n \"react/no-unsafe\": \"warn\",\n /**\n * Disallow creating unstable components inside components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md\n */\n \"react/no-unstable-nested-components\": \"warn\",\n \"react/require-render-return\": \"warn\",\n /**\n * Disallow closing tags for components without children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n */\n \"react/self-closing-comp\": \"warn\",\n };\n};\n","import type { ESLint } from \"eslint\";\n\nimport storybookPlugin from \"eslint-plugin-storybook\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * ESLint configuration for Storybook.\n * Contains rules for best practices when working with Storybook.\n *\n * @param customRules - Optional custom rules to merge into the Storybook config.\n * @returns Storybook ESLint config array.\n */\nexport const storybookConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject[] => [\n {\n files: [\n \"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)\",\n \"**/*.story.@(ts|tsx|js|jsx|mjs|cjs)\",\n ],\n name: configNames.storybook,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n // Default Storybook rules\n \"import-x/no-anonymous-default-export\": \"off\",\n \"react-hooks/rules-of-hooks\": \"off\",\n \"storybook/await-interactions\": \"warn\",\n \"storybook/context-in-play-function\": \"warn\",\n \"storybook/csf-component\": \"warn\",\n \"storybook/default-exports\": \"warn\",\n \"storybook/hierarchy-separator\": \"warn\",\n \"storybook/meta-inline-properties\": \"warn\",\n \"storybook/no-redundant-story-name\": \"warn\",\n \"storybook/prefer-pascal-case\": \"warn\",\n \"storybook/story-exports\": \"warn\",\n \"storybook/use-storybook-expect\": \"warn\",\n \"storybook/use-storybook-testing-library\": \"warn\",\n // Merge custom rules\n ...(customRules ?? {}),\n },\n },\n {\n files: [\".storybook/main.@(js|cjs|mjs|ts)\"],\n name: configNames.storybookConfig,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n },\n },\n];\n","import jest from \"eslint-plugin-jest\";\nimport vitest from \"eslint-plugin-vitest\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { getImportRestrictions } from \"./get-import-restrictions.js\";\nimport { jestRules } from \"./jest-rules.js\";\nimport { vitestRules } from \"./vitest-rules.js\";\n\nexport interface TestingConfig {\n filenamePattern?: \"spec\" | \"test\";\n files?: string[];\n formattingRules?: boolean;\n framework?: \"bun\" | \"jest\" | \"node\" | \"vitest\";\n /**\n * Whether to enforce imports from the correct testing framework.\n * Uses the built-in ESLint `no-restricted-imports` rule.\n *\n * @default true\n */\n importRestrictions?: boolean;\n itOrTest?: \"it\" | \"test\";\n typescript?: boolean;\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\" or \"bun\" or \"node\"\n * @param options.formattingRules - Whether to include formatting rules like padding around blocks\n * @param options.importRestrictions - Whether to enforce imports from the correct testing framework\n * @param options.typescript - Whether the user is using TypeScript\n * @param customRules - Optional object containing custom rules to override or add to the testing configuration.\n * @returns ESLint configuration object\n */\nexport const testingConfig = (\n {\n filenamePattern = \"test\",\n files,\n formattingRules = true,\n framework = \"vitest\",\n importRestrictions = true,\n itOrTest = \"test\",\n typescript = true,\n }: TestingConfig = {},\n customRules?: Record<string, EslintRuleConfig>,\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 ...(typescript ? { \"@typescript-eslint/unbound-method\": \"off\" } : {}),\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) : 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 ...(importRestrictions ? getImportRestrictions(framework) : {}),\n ...(customRules ?? {}),\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","import type { EslintRuleConfig } from \"../types.js\";\n\nconst commonTestImports = [\n \"describe\",\n \"it\",\n \"test\",\n \"expect\",\n \"beforeAll\",\n \"beforeEach\",\n \"afterAll\",\n \"afterEach\",\n \"vi\",\n \"mock\",\n \"spyOn\",\n];\n\nconst frameworkConfig = {\n bun: {\n allowed: \"'bun:test'\",\n restricted: [\"vitest\", \"jest\", \"@jest/globals\", \"node:test\"],\n },\n jest: {\n allowed: \"'jest' or '@jest/globals'\",\n restricted: [\"vitest\", \"bun:test\", \"node:test\"],\n },\n node: {\n allowed: \"'node:test'\",\n restricted: [\"vitest\", \"jest\", \"@jest/globals\", \"bun:test\"],\n },\n vitest: {\n allowed: \"'vitest'\",\n restricted: [\"jest\", \"@jest/globals\", \"bun:test\", \"node:test\"],\n },\n} as const;\n\n/**\n * Generates the error message for restricted imports.\n *\n * @param allowedFramework - The allowed framework(s) for imports\n * @returns The formatted error message\n */\nconst getRestrictionMessage = (allowedFramework: string): string =>\n `This project is setup to use ${allowedFramework} for testing. Importing from other testing frameworks is not allowed. Change this setting in eslint.config.js under testing.framework`;\n\n/**\n * Returns import restriction rules based on the testing framework.\n * Prevents importing from the wrong testing framework.\n *\n * @param framework - The testing framework being used\n * @returns ESLint rules object with import restrictions\n */\nexport const getImportRestrictions = (\n framework: \"bun\" | \"jest\" | \"node\" | \"vitest\",\n): Record<string, EslintRuleConfig> => {\n const config = frameworkConfig[framework];\n const message = getRestrictionMessage(config.allowed);\n\n return {\n \"no-restricted-imports\": [\n \"warn\",\n {\n paths: config.restricted.map((name) => ({\n importNames: commonTestImports,\n message,\n name,\n })),\n },\n ],\n };\n};\n","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","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","import turbo from \"eslint-plugin-turbo\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\nimport type { TurboRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Turbo.\n *\n * @param customRules - Optional custom rules to merge with the default Turbo rules.\n * @returns ESLint configuration object for Turbo.\n */\nexport const turboConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.turbo,\n plugins: {\n turbo,\n },\n rules:\n customRules ??\n ({\n \"turbo/no-undeclared-env-vars\": \"warn\",\n } satisfies TurboRules),\n});\n","import { defineConfig } from \"eslint/config\";\nimport tseslint, { type Config } from \"typescript-eslint\";\n\nimport type { EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { tseslintRules } from \"./rules.js\";\n\n/**\n * Creates a TypeScript ESLint configuration object.\n *\n * @param tsconfigPath - Path to the TypeScript configuration file\n * @param customRules - Optional object containing custom rules to override or add to the TypeScript configuration.\n * @returns TypeScript ESLint configuration object\n */\nexport const tseslintConfig = (\n tsconfigPath?: string,\n customRules?: Record<string, EslintRuleConfig>,\n): Config => {\n const userCwd = process.cwd();\n\n return defineConfig(\n {\n files: [\"**/*.{js,cjs,mjs,ts,jsx,tsx}\"],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ...(tsconfigPath ?\n { project: tsconfigPath, tsconfigRootDir: userCwd }\n : { projectService: true, tsconfigRootDir: import.meta.dirname }),\n },\n },\n name: configNames.typescript,\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n },\n rules: {\n ...tseslintRules,\n ...(customRules ?? {}),\n },\n },\n {\n // disable type-aware linting on JS files\n extends: [tseslint.configs.disableTypeChecked],\n files: [\"**/*.js\"],\n },\n );\n};\n","import type { TypescriptRules } from \"./types.js\";\n\nexport const tseslintRules: TypescriptRules = {\n \"@typescript-eslint/adjacent-overload-signatures\": \"warn\",\n \"@typescript-eslint/array-type\": \"warn\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": [\n \"warn\",\n { minimumDescriptionLength: 10 },\n ],\n \"@typescript-eslint/ban-tslint-comment\": \"warn\",\n \"@typescript-eslint/class-literal-property-style\": \"warn\",\n \"@typescript-eslint/consistent-generic-constructors\": \"warn\",\n \"@typescript-eslint/consistent-indexed-object-style\": \"warn\",\n \"@typescript-eslint/consistent-type-assertions\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": \"warn\",\n \"@typescript-eslint/consistent-type-exports\": [\n \"warn\",\n { fixMixedExportsWithInlineTypeSpecifier: true },\n ],\n \"@typescript-eslint/consistent-type-imports\": [\n \"warn\",\n {\n fixStyle: \"inline-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"@typescript-eslint/dot-notation\": \"warn\",\n \"@typescript-eslint/no-array-constructor\": \"warn\",\n \"@typescript-eslint/no-array-delete\": \"warn\",\n \"@typescript-eslint/no-base-to-string\": \"warn\",\n \"@typescript-eslint/no-confusing-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-confusing-void-expression\": \"warn\",\n \"@typescript-eslint/no-deprecated\": \"warn\",\n \"@typescript-eslint/no-duplicate-enum-values\": \"warn\",\n \"@typescript-eslint/no-duplicate-type-constituents\": \"warn\",\n \"@typescript-eslint/no-dynamic-delete\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"warn\",\n \"@typescript-eslint/no-empty-object-type\": \"warn\",\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/no-extra-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-extraneous-class\": \"warn\",\n \"@typescript-eslint/no-floating-promises\": \"warn\",\n \"@typescript-eslint/no-for-in-array\": \"warn\",\n \"@typescript-eslint/no-implied-eval\": \"warn\",\n \"@typescript-eslint/no-import-type-side-effects\": \"warn\",\n \"@typescript-eslint/no-inferrable-types\": \"warn\",\n \"@typescript-eslint/no-invalid-void-type\": \"warn\",\n \"@typescript-eslint/no-meaningless-void-operator\": \"warn\",\n \"@typescript-eslint/no-misused-new\": \"warn\",\n \"@typescript-eslint/no-misused-promises\": \"warn\",\n \"@typescript-eslint/no-mixed-enums\": \"warn\",\n \"@typescript-eslint/no-namespace\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"warn\",\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-redundant-type-constituents\": \"warn\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-this-alias\": \"warn\",\n \"@typescript-eslint/no-unnecessary-boolean-literal-compare\": \"warn\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n \"@typescript-eslint/no-unnecessary-template-expression\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-constraint\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"warn\",\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"warn\",\n \"@typescript-eslint/no-unsafe-enum-comparison\": \"warn\",\n \"@typescript-eslint/no-unsafe-function-type\": \"warn\",\n \"@typescript-eslint/no-unsafe-unary-minus\": \"warn\",\n \"@typescript-eslint/no-unused-expressions\": \"warn\",\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"after-used\",\n argsIgnorePattern: \"^_\",\n ignoreRestSiblings: false,\n vars: \"all\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-useless-constructor\": \"warn\",\n \"@typescript-eslint/no-wrapper-object-types\": \"warn\",\n // TODO: Investiate non-null vs type-cast rules\n \"@typescript-eslint/non-nullable-type-assertion-style\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"warn\",\n \"@typescript-eslint/prefer-as-const\": \"warn\",\n \"@typescript-eslint/prefer-find\": \"warn\",\n \"@typescript-eslint/prefer-for-of\": \"warn\",\n \"@typescript-eslint/prefer-function-type\": \"warn\",\n \"@typescript-eslint/prefer-includes\": \"warn\",\n \"@typescript-eslint/prefer-literal-enum-member\": \"warn\",\n \"@typescript-eslint/prefer-namespace-keyword\": \"warn\",\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"warn\",\n {\n ignorePrimitives: { string: true },\n },\n ],\n \"@typescript-eslint/prefer-optional-chain\": \"warn\",\n \"@typescript-eslint/prefer-promise-reject-errors\": \"warn\",\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"warn\",\n \"@typescript-eslint/prefer-regexp-exec\": \"warn\",\n \"@typescript-eslint/prefer-return-this-type\": \"warn\",\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"warn\",\n \"@typescript-eslint/related-getter-setter-pairs\": \"warn\",\n \"@typescript-eslint/require-await\": \"warn\",\n \"@typescript-eslint/restrict-plus-operands\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNullish: false,\n allowNumberAndString: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/restrict-template-expressions\": [\n \"warn\",\n {\n allow: [{ from: \"lib\", name: [\"Error\", \"URL\", \"URLSearchParams\"] }],\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n allowRegExp: true,\n },\n ],\n \"@typescript-eslint/return-await\": [\n \"warn\",\n \"error-handling-correctness-only\",\n ],\n \"@typescript-eslint/triple-slash-reference\": \"warn\",\n \"@typescript-eslint/unbound-method\": \"warn\",\n \"@typescript-eslint/unified-signatures\": \"warn\",\n \"@typescript-eslint/use-unknown-in-catch-callback-variable\": \"warn\",\n};\n","import unicorn from \"eslint-plugin-unicorn\";\n\nimport type {\n EslintConfigObject,\n EslintRuleConfig,\n FilenameCase,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { rules } from \"./rules.js\";\n\n/**\n * ESLint configuration for unicorn plugin.\n * This plugin provides a set of rules to enforce consistent code style and catch common errors.\n *\n * @param options - Configuration options for Unicorn.\n * @param options.customRules - Optional custom rules to merge with the default Unicorn rules.\n * @param options.filenameCase - Optional filename case to enforce. Defaults to \"kebabCase\".\n * @returns ESLint configuration object for Unicorn.\n */\nexport const unicornConfig = ({\n customRules,\n filenameCase = \"kebabCase\",\n}: {\n customRules?: Record<string, EslintRuleConfig>;\n filenameCase?: FilenameCase;\n}): EslintConfigObject => ({\n name: configNames.unicorn,\n plugins: {\n unicorn,\n },\n rules: {\n ...rules(filenameCase),\n ...(customRules ?? {}),\n },\n});\n","import type { EslintRuleConfig, FilenameCase } from \"../types.js\";\n\ntype UnicornRules = Record<`unicorn/${string}`, EslintRuleConfig>;\n\n/**\n * Generate Unicorn ESLint rules with configurable filename case.\n *\n * @param filenameCase - The filename case to enforce. Defaults to \"kebabCase\".\n * @returns Unicorn ESLint rules configuration.\n */\nexport const rules = (\n filenameCase: FilenameCase = \"kebabCase\",\n): UnicornRules => ({\n /**\n * Enforce better string content.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md\n */\n \"unicorn/better-regex\": \"warn\",\n /**\n * Enforce passing a message value when creating a built-in error.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md\n */\n \"unicorn/error-message\": \"warn\",\n /**\n * Require consistent filename case for all linted files.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\n */\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: filenameCase,\n },\n ],\n /**\n * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md\n */\n \"unicorn/new-for-builtins\": \"warn\",\n \"unicorn/no-console-spaces\": \"warn\",\n /**\n * Enforce using for-loop instead of while-loop.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md\n */\n \"unicorn/no-for-loop\": \"warn\",\n /**\n * Enforce the use of addEventListener and removeEventListener over on-functions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md\n */\n \"unicorn/prefer-add-event-listener\": \"warn\",\n /**\n * Require using the `node:` protocol when importing Node.js built-in modules.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md\n */\n \"unicorn/prefer-node-protocol\": \"warn\",\n /**\n * Prefer String#replaceAll() over String#replace() with a global regExp.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md\n */\n \"unicorn/prefer-string-replace-all\": \"warn\",\n /**\n * Enforce throwing TypeError in type checking conditions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md\n */\n \"unicorn/prefer-type-error\": \"warn\",\n /**\n * Enforce consistent brace style for case clauses.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md\n */\n \"unicorn/switch-case-braces\": [\"warn\", \"always\"],\n /**\n * Enforce consistent case for text encoding identifiers.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md\n */\n \"unicorn/text-encoding-identifier-case\": \"warn\",\n});\n","import type { Linter } from \"eslint\";\n\nimport type {\n EslintRuleConfig,\n FilenameCase,\n FunctionStyle,\n ReactFramework,\n} from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { configNames } from \"./constants.js\";\nimport { convexConfig } from \"./convex/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { importConfig } from \"./import/config.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { nextjsConfig } from \"./nextjs/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { processCustomRules } from \"./process-custom-rules.js\";\nimport { queryConfig } from \"./query/config.js\";\nimport { reactRefreshEslintConfig } from \"./react-refresh/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { storybookConfig } from \"./storybook/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n convex?: boolean;\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n importPlugin?: boolean;\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n query?: boolean;\n react?:\n | boolean\n | {\n framework?: ReactFramework;\n reactCompiler?: boolean;\n reactRefresh?: boolean;\n };\n rules?: Record<string, EslintRuleConfig>;\n sorting?: boolean;\n storybook?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?:\n | boolean\n | {\n filenameCase?: FilenameCase;\n };\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.convex - Whether to include Convex rules.\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.importPlugin - Whether to include the import plugin. Defaults to true.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.query - Whether to include TanStack Query rules.\n * @param options.react - Whether to include React, React hooks, and React compiler rules.\n * Can specify framework as \"next\", \"none\", \"react-router\", \"remix\", or \"vite\" to control related configs:\n * - \"next\": Includes Next.js config, excludes React Refresh.\n * - \"vite\" or \"none\": Includes React Refresh, excludes Next.js.\n * - \"remix\" or \"react-router\": Excludes both Next.js and React Refresh (these frameworks handle their own refresh logic).\n * - The reactRefresh property can override this framework-based behavior.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.storybook - Whether to include Storybook rules. Defaults to false.\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\" or \"bun\" or \"node\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `importRestrictions`: Whether to enforce imports from the correct testing framework.\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 options.turbo - Whether to include Turborepo rules. Defaults to false.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true. Can be an object with filenameCase property.\n * @param options.rules - This is for rules that you need to alter or turn off.\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 convex = false,\n functionStyle = \"arrow\",\n ignores = [],\n importPlugin = true,\n jsdoc = { requireJsdoc: false },\n query = false,\n react = false,\n rules,\n sorting = true,\n storybook = false,\n testing,\n turbo = false,\n typescript = true,\n unicorn = { filenameCase: \"kebabCase\" },\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n // Categorize user's custom rules first\n const categorizedRules = rules === undefined ? {} : processCustomRules(rules);\n\n const configs: Linter.Config[] = [\n ignoresConfig({\n reactFramework:\n isObject(react) && react.framework ? react.framework : \"none\",\n storybook,\n userIgnores: ignores,\n }),\n baseEslintConfig(\n functionStyle,\n Boolean(typescript),\n categorizedRules[configNames.base],\n ),\n ];\n\n if (jsdoc !== false) {\n configs.push(\n jsdocConfig(\n jsdoc.requireJsdoc ?? false,\n categorizedRules[configNames.jsdoc],\n ),\n );\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n categorizedRules[configNames.typescript],\n ) as Linter.Config[]),\n );\n }\n\n if (importPlugin) {\n configs.push(\n importConfig(Boolean(typescript), categorizedRules[configNames.import]),\n );\n }\n\n if (react) {\n const reactOptions = isObject(react) ? react : {};\n\n // Apply reactRefresh based on framework setting or explicit override\n const shouldUseReactRefresh =\n // Explicit setting takes precedence\n reactOptions.reactRefresh === true ||\n // Framework-based default (vite/none use reactRefresh by default)\n ((reactOptions.framework === \"vite\" ||\n reactOptions.framework === \"none\") &&\n reactOptions.reactRefresh !== false);\n\n if (shouldUseReactRefresh) {\n configs.push(\n reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh]),\n );\n }\n\n configs.push(\n reactEslintConfig({\n customRules: categorizedRules[configNames.react],\n functionStyle,\n reactCompiler: reactOptions.reactCompiler ?? true,\n typescript: Boolean(typescript),\n }),\n );\n\n if (isObject(react) && react.framework === \"next\") {\n configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));\n }\n }\n\n if (query) {\n configs.push(queryConfig(categorizedRules[configNames.query]));\n }\n\n if (convex) {\n configs.push(\n convexConfig(categorizedRules[configNames.convex], Boolean(unicorn)),\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 importRestrictions: true,\n itOrTest: \"it\",\n };\n\n // Use the provided testing config or the default if testing is true\n const mergedTestingConfig: TestingConfig =\n isObject(testing) ?\n { ...defaultTestingConfig, ...testing }\n : defaultTestingConfig;\n\n // Destructure from the merged config\n const {\n filenamePattern,\n files,\n formattingRules,\n framework,\n importRestrictions,\n itOrTest,\n } = mergedTestingConfig;\n\n configs.push(\n testingConfig(\n {\n filenamePattern,\n files,\n formattingRules,\n framework,\n importRestrictions,\n itOrTest,\n typescript: Boolean(typescript),\n },\n categorizedRules[configNames.testing],\n ),\n );\n }\n\n if (sorting) {\n configs.push(\n perfectionistConfig(categorizedRules[configNames.perfectionist]),\n );\n }\n\n if (unicorn) {\n const filenameCase = isObject(unicorn) ? unicorn.filenameCase : undefined;\n configs.push(\n unicornConfig({\n customRules: categorizedRules[configNames.unicorn],\n filenameCase,\n }),\n );\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(\n preferArrowFunctionConfig(\n categorizedRules[configNames.preferArrowFunction],\n ),\n );\n }\n\n if (storybook) {\n configs.push(...storybookConfig(categorizedRules[configNames.storybook]));\n }\n\n if (turbo) {\n configs.push(turboConfig(categorizedRules[configNames.turbo]));\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","import type { Config as PrettierConfig } from \"prettier\";\nimport type { SortJsonOptions as SortJsonPluginOptions } from \"prettier-plugin-sort-json\";\nimport type { PluginOptions as TailwindPluginOptions } from \"prettier-plugin-tailwindcss\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\n\nexport interface PrettierConfigOptions extends PrettierConfig {\n cssOrderPlugin?: boolean;\n curlyPlugin?: boolean;\n jsonSortPlugin?: boolean | SortJsonPluginOptions;\n packageJsonPlugin?: boolean;\n parser?: \"default\" | \"oxc\";\n tailwindPlugin?: boolean | string | TailwindPluginOptions;\n}\n\nexport interface PrettierConfigWithPlugins\n extends PrettierConfig,\n SortJsonPluginOptions,\n TailwindPluginOptions {}\n\n/**\n * Creates a Prettier configuration object with optional Tailwind support\n *\n * @param options - Configuration options for Prettier\n * @param options.cssOrderPlugin CSS order sorting support\n * @param options.curlyPlugin Enforce curly braces for all control statements\n * @param options.jsonSortPlugin JSON sorting support\n * @param options.parser choose between default and oxc parser\n * @param options.packageJsonPlugin Package.json sorting support\n * @param options.tailwindPlugin Tailwind CSS formatting support\n * @returns Prettier configuration object with:\n * - Default Prettier configuration\n * - Experimental ternaries enabled\n * - OXC parser plugin\n * - CSS order plugin\n * - Curly braces plugin\n * - JSON sorting plugin\n * - Package.json sorting plugin\n * - Optional Tailwind plugin and functions\n */\nexport const prettierConfig = (\n options: PrettierConfigOptions = {},\n): PrettierConfigWithPlugins => {\n const {\n cssOrderPlugin = true,\n curlyPlugin = true,\n jsonSortPlugin = true,\n packageJsonPlugin = true,\n parser = \"oxc\",\n tailwindPlugin = false,\n ...rest\n } = options;\n\n const plugins: string[] = [];\n const config: PrettierConfigWithPlugins = {\n experimentalTernaries: true,\n ...rest,\n };\n\n if (parser === \"oxc\") {\n plugins.push(\"@prettier/plugin-oxc\");\n }\n\n if (cssOrderPlugin) {\n plugins.push(\"prettier-plugin-css-order\");\n }\n\n if (curlyPlugin) {\n plugins.push(\"prettier-plugin-curly\");\n }\n\n if (jsonSortPlugin) {\n plugins.push(\"prettier-plugin-sort-json\");\n\n if (isObject(jsonSortPlugin)) {\n Object.assign(config, jsonSortPlugin);\n } else {\n config.jsonRecursiveSort = true;\n }\n }\n\n if (packageJsonPlugin) {\n plugins.push(\"prettier-plugin-packagejson\");\n }\n\n if (tailwindPlugin) {\n plugins.push(\"prettier-plugin-tailwindcss\");\n const defaultTailwindFunctions = [\"clsx\", \"cva\", \"cn\"];\n\n if (isString(tailwindPlugin)) {\n // then it's the path to the stylesheet\n config.tailwindStylesheet = tailwindPlugin;\n config.tailwindFunctions = defaultTailwindFunctions;\n } else if (isObject(tailwindPlugin)) {\n Object.assign(config, tailwindPlugin);\n\n // Ensure defaultTailwindFunctions is applied if tailwindFunctions wasn't specified\n if (!tailwindPlugin.tailwindFunctions) {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n } else {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n }\n\n // Set plugins after all configurations are done\n config.plugins = plugins;\n\n return config;\n};\n"],"mappings":";AAMO,IAAM,WAAW,CAAC,UAAoC;AAC3D,SAAO,OAAO,UAAU;AAC1B;AAsCO,IAAM,WAAW,CAAC,UAAqD;AAC5E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;AC3CO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ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AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAAA,EAC1C;AAEA,MAAI,aAAa;AACf,YAAQ,KAAK,uBAAuB;AAAA,EACtC;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,2BAA2B;AAExC,QAAI,SAAS,cAAc,GAAG;AAC5B,aAAO,OAAO,QAAQ,cAAc;AAAA,IACtC,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB;AACrB,YAAQ,KAAK,6BAA6B;AAAA,EAC5C;AAEA,MAAI,gBAAgB;AAClB,YAAQ,KAAK,6BAA6B;AAC1C,UAAM,2BAA2B,CAAC,QAAQ,OAAO,IAAI;AAErD,QAAI,SAAS,cAAc,GAAG;AAE5B,aAAO,qBAAqB;AAC5B,aAAO,oBAAoB;AAAA,IAC7B,WAAW,SAAS,cAAc,GAAG;AACnC,aAAO,OAAO,QAAQ,cAAc;AAGpC,UAAI,CAAC,eAAe,mBAAmB;AACrC,eAAO,oBAAoB;AAAA,MAC7B;AAAA,IACF,OAAO;AACL,aAAO,oBAAoB;AAAA,IAC7B;AAAA,EACF;AAGA,SAAO,UAAU;AAEjB,SAAO;AACT;","names":["require","unicorn","rules","jsdoc","react","rules","turbo","unicorn"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/is-type.ts","../src/eslint/constants.ts","../src/eslint/base/rules.ts","../src/eslint/base/config.ts","../src/eslint/convex/config.ts","../src/eslint/convex/rules.ts","../src/eslint/ignores.ts","../src/eslint/import/config.ts","../src/eslint/import/rules.ts","../src/eslint/jsdoc/config.ts","../src/eslint/jsdoc/rules.ts","../src/eslint/nextjs/config.ts","../src/eslint/nextjs/rules.ts","../src/eslint/perfectionist/config.ts","../src/eslint/perfectionist/rules.ts","../src/eslint/prefer-arrow-function/config.ts","../src/eslint/process-custom-rules.ts","../src/eslint/query/config.ts","../src/eslint/query/rules.ts","../src/eslint/react-refresh/config.ts","../src/eslint/react-refresh/rules.ts","../src/eslint/react/config.ts","../src/eslint/react/rules.ts","../src/eslint/storybook/config.ts","../src/eslint/testing/config.ts","../src/eslint/testing/get-import-restrictions.ts","../src/eslint/testing/jest-rules.ts","../src/eslint/testing/vitest-rules.ts","../src/eslint/turbo/config.ts","../src/eslint/typescript/config.ts","../src/eslint/typescript/rules.ts","../src/eslint/unicorn/config.ts","../src/eslint/unicorn/rules.ts","../src/eslint/index.ts","../src/prettier/index.ts"],"sourcesContent":["/**\n * Type predicate for string values\n *\n * @param value - The value to check\n * @returns True if the value is a string, false otherwise\n */\nexport const isString = (value: unknown): value is string => {\n return typeof value === \"string\";\n};\n\n/**\n * Type predicate for number values\n *\n * @param value - The value to check\n * @returns True if the value is a number and not NaN, false otherwise\n */\nexport const isNumber = (value: unknown): value is number => {\n return typeof value === \"number\" && !Number.isNaN(value);\n};\n\n/**\n * Type predicate for boolean values\n *\n * @param value - The value to check\n * @returns True if the value is a boolean, false otherwise\n */\nexport const isBoolean = (value: unknown): value is boolean => {\n return typeof value === \"boolean\";\n};\n\n/**\n * Type predicate for array values\n *\n * @param value - The value to check\n * @returns True if the value is an array, false otherwise\n */\nexport const isArray = <T = unknown>(value: unknown): value is T[] => {\n return Array.isArray(value);\n};\n\n/**\n * Type predicate for object values (excluding null and arrays)\n *\n * @param value - The value to check\n * @returns True if the value is an object (not null and not an array), false otherwise\n */\nexport const isObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * Type predicate for function values\n *\n * @param value - The value to check\n * @returns True if the value is a function, false otherwise\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport const isFunction = (value: unknown): value is Function => {\n return typeof value === \"function\";\n};\n","/**\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\",\n convex: \"convex\",\n disableTypeChecked: \"UserConfig[1] > typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n import: \"import\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n query: \"@tanstack/query\",\n react: \"react\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n\n/**\n * Maps plugin prefixes to their corresponding config names.\n * This is the single source of truth for categorizing rules by plugin.\n */\nexport const pluginPrefixMap = new Map<string, ConfigName>([\n [\"@convex-dev\", configNames.convex],\n [\"@tanstack/query\", configNames.query],\n [\"@typescript-eslint\", configNames.typescript],\n [\"import\", configNames.import],\n [\"import-x\", configNames.import],\n [\"jest\", configNames.testing],\n [\"jsdoc\", configNames.jsdoc],\n [\"nextjs\", configNames.nextjs],\n [\"perfectionist\", configNames.perfectionist],\n [\"react\", configNames.react],\n [\"react-hooks\", configNames.react],\n [\"react-refresh\", configNames.reactRefresh],\n [\"storybook\", configNames.storybook],\n [\"turbo\", configNames.turbo],\n [\"unicorn\", configNames.unicorn],\n [\"vitest\", configNames.testing],\n]);\n","import type { FunctionStyle } from \"../types.js\";\nimport type { BaseRules } from \"./types.js\";\n\n/**\n * Generates the base set of ESLint rules with configurable function style enforcement.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @returns An object containing ESLint rule configurations\n */\nexport const baseEslintRules = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): BaseRules => ({\n ...(!typescript ?\n {\n \"no-unused-expressions\": \"warn\",\n \"no-unused-vars\": \"warn\",\n }\n : {}),\n /**\n * Require return statements in array methods callbacks.\n *\n * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return\n */\n \"array-callback-return\": [\n \"warn\",\n { allowImplicit: true, checkForEach: true },\n ],\n /**\n * Treat `var` statements as if they were block scoped.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var\n */\n \"block-scoped-var\": \"warn\",\n /**\n * Require camel case names.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/camelcase\n */\n camelcase: [\n \"warn\",\n {\n allow: [\"^UNSAFE_\"],\n ignoreDestructuring: false,\n ignoreImports: true,\n properties: \"never\",\n },\n ],\n /**\n * Require curly braces for multiline blocks.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/curly\n */\n curly: [\"warn\", \"multi-line\"],\n /**\n * Require default clauses in switch statements to be last (if used).\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last\n */\n \"default-case-last\": \"warn\",\n /**\n * Require triple equals (`===` and `!==`).\n *å\n * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq\n */\n eqeqeq: \"warn\",\n \"for-direction\": \"warn\",\n /**\n * Require function expressions to have a name.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/func-names\n */\n \"func-names\": [\"warn\", \"as-needed\"],\n // if arrow function, we use the prefer-arrow-functions plugin\n ...(functionStyle === \"off\" ? { \"func-style\": \"off\" }\n : functionStyle === \"arrow\" ?\n { \"func-style\": \"off\" } // When arrow, func-style is off and prefer-arrow-functions is used instead\n : { \"func-style\": [\"warn\", functionStyle, { allowArrowFunctions: true }] }),\n /**\n * Require grouped accessor pairs in object literals and classes.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs\n */\n \"grouped-accessor-pairs\": \"warn\",\n /**\n * Require a capital letter for constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/new-cap\n */\n \"new-cap\": [\"warn\", { capIsNew: false }],\n /**\n * Disallow use of `alert()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert\n */\n \"no-alert\": \"warn\",\n \"no-async-promise-executor\": \"warn\",\n /**\n * Disallow use of bitwise operators.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise\n */\n \"no-bitwise\": \"warn\",\n /**\n * Disallow use of `caller`/`callee`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller\n */\n \"no-caller\": \"warn\",\n \"no-case-declarations\": \"warn\",\n \"no-compare-neg-zero\": \"warn\",\n \"no-cond-assign\": \"warn\",\n /**\n * Disallow the use of console.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-console\": [\"warn\", { allow: [\"info\", \"warn\", \"error\"] }],\n /**\n * Disallow expressions where the operation doesn't affect the value.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-constant-binary-expression\": \"warn\",\n \"no-constant-condition\": \"warn\",\n /**\n * Disallow returning value in constructor.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return\n */\n \"no-constructor-return\": \"warn\",\n \"no-control-regex\": \"warn\",\n \"no-debugger\": \"warn\",\n \"no-delete-var\": \"warn\",\n \"no-dupe-else-if\": \"warn\",\n \"no-duplicate-case\": \"warn\",\n /**\n * Disallow using an `else` if the `if` block contains a return.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return\n */\n \"no-else-return\": \"warn\",\n \"no-empty\": \"warn\",\n \"no-empty-character-class\": \"warn\",\n \"no-empty-pattern\": \"warn\",\n \"no-empty-static-block\": \"warn\",\n /**\n * Disallow `eval()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval\n */\n \"no-eval\": \"warn\",\n \"no-ex-assign\": \"warn\",\n /**\n * Disallow extending native objects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native\n */\n \"no-extend-native\": \"warn\",\n /**\n * Disallow unnecessary function binding.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind\n */\n \"no-extra-bind\": \"warn\",\n \"no-extra-boolean-cast\": \"warn\",\n /**\n * Disallow unnecessary labels.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label\n */\n \"no-extra-label\": \"warn\",\n \"no-fallthrough\": \"warn\",\n \"no-global-assign\": \"warn\",\n /**\n * Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.\n *\n * 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion\n */\n \"no-implicit-coercion\": \"warn\",\n \"no-invalid-regexp\": \"warn\",\n \"no-irregular-whitespace\": \"warn\",\n /**\n * Disallow usage of `__iterator__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator\n */\n \"no-iterator\": \"warn\",\n /**\n * Disallow labels that share a name with a variable.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var\n */\n \"no-label-var\": \"warn\",\n /**\n * Disallow use of labels for anything other than loops and switches.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels\n */\n \"no-labels\": [\"warn\"],\n /**\n * Disallow unnecessary nested blocks.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks\n */\n \"no-lone-blocks\": \"warn\",\n /**\n * Disallow if as the only statement in an else block.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if\n */\n \"no-lonely-if\": \"warn\",\n \"no-loss-of-precision\": \"warn\",\n \"no-misleading-character-class\": \"warn\",\n /**\n * Disallow use of chained assignment expressions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign\n */\n \"no-multi-assign\": [\"warn\"],\n /**\n * Disallow `new` for side effects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new\n */\n \"no-new\": \"warn\",\n /**\n * Disallow function constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func\n */\n \"no-new-func\": \"warn\",\n /**\n * Disallow primitive wrapper instances, such as `new String('foo')`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers\n */\n \"no-new-wrappers\": \"warn\",\n \"no-nonoctal-decimal-escape\": \"warn\",\n \"no-octal\": \"warn\",\n /**\n * Disallow use of octal escape sequences in string literals.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape\n */\n \"no-octal-escape\": \"warn\",\n /**\n * Disallow reassignment of function parameters.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign\n */\n \"no-param-reassign\": \"warn\",\n /**\n * Disallow returning values from Promise executor functions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return\n */\n \"no-promise-executor-return\": \"warn\",\n /**\n * Disallow usage of the deprecated `__proto__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto\n */\n \"no-proto\": \"warn\",\n \"no-prototype-builtins\": \"warn\",\n \"no-regex-spaces\": \"warn\",\n /**\n * Disallow assignment in `return` statement.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign\n */\n \"no-return-assign\": \"warn\",\n /**\n * Disallow use of `javascript:` urls.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url\n */\n \"no-script-url\": \"warn\",\n \"no-self-assign\": \"warn\",\n /**\n * Disallow comparisons where both sides are exactly the same.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare\n */\n \"no-self-compare\": \"warn\",\n /**\n * Disallow use of comma operator.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences\n */\n \"no-sequences\": \"warn\",\n \"no-shadow-restricted-names\": \"warn\",\n \"no-sparse-arrays\": \"warn\",\n /**\n * Disallow template literal placeholder syntax in regular strings, as\n * these are likely errors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string\n */\n \"no-template-curly-in-string\": \"warn\",\n /**\n * Disallow initializing variables to `undefined`.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init\n */\n \"no-undef-init\": \"warn\",\n \"no-unexpected-multiline\": \"warn\",\n /**\n * Disallow ternary operators when simpler alternatives exist.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary\n */\n \"no-unneeded-ternary\": \"warn\",\n /**\n * Disallow loops with a body that allows only one iteration.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop\n */\n \"no-unreachable-loop\": \"warn\",\n \"no-unsafe-finally\": \"warn\",\n \"no-unsafe-optional-chaining\": \"warn\",\n \"no-unused-labels\": \"warn\",\n \"no-unused-private-class-members\": \"warn\",\n \"no-useless-backreference\": \"warn\",\n /**\n * Disallow unnecessary `.call()` and `.apply()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call\n */\n \"no-useless-call\": \"warn\",\n \"no-useless-catch\": \"warn\",\n /**\n * Disallow useless computed property keys.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-computed-key\n */\n \"no-useless-computed-key\": \"warn\",\n /**\n * Disallow unnecessary concatenation of strings.\n *\n * � Not fixable - https://eslint.org/docs/rules/no-useless-concat\n */\n \"no-useless-concat\": \"warn\",\n \"no-useless-escape\": \"warn\",\n /**\n * Disallow renaming import, export, and destructured assignments to the\n * same name.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-rename\n */\n \"no-useless-rename\": \"warn\",\n /**\n * Disallow redundant return statements.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-return\n */\n \"no-useless-return\": \"warn\",\n /**\n * Require `let` or `const` instead of `var`.\n * ts transpiles let/const to var, so no need for vars any more\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-var\n */\n \"no-var\": \"warn\",\n \"no-with\": \"warn\",\n /**\n * Require object literal shorthand syntax.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/object-shorthand\n */\n \"object-shorthand\": \"warn\",\n /**\n * Require default to `const` instead of `let`.\n * ts provides better types with const\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-const\n */\n \"prefer-const\": \"warn\",\n /**\n * Require using named capture groups in regular expressions.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group\n */\n \"prefer-named-capture-group\": \"warn\",\n /**\n * Disallow parseInt() in favor of binary, octal, and hexadecimal literals.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-numeric-literals\n */\n \"prefer-numeric-literals\": \"warn\",\n /**\n * Require use of an object spread over Object.assign.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread\n */\n \"prefer-object-spread\": \"warn\",\n /**\n * Disallow use of the RegExp constructor in favor of regular expression\n * literals.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-regex-literals\n */\n \"prefer-regex-literals\": \"warn\",\n /**\n * Require using rest parameters instead of `arguments`.\n * ts provides better types with rest args over arguments\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-rest-params\n */\n \"prefer-rest-params\": \"warn\",\n /**\n * Require using spread syntax instead of `.apply()`.\n * ts transpiles spread to apply, so no need for manual apply\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-spread\n */\n \"prefer-spread\": \"warn\",\n /**\n * Require using template literals instead of string concatenation.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-template\n */\n \"prefer-template\": \"warn\",\n \"require-yield\": \"warn\",\n /**\n * Require a `Symbol` description.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/symbol-description\n */\n \"symbol-description\": \"warn\",\n \"use-isnan\": \"warn\",\n \"valid-typeof\": \"warn\",\n /**\n * Disallow \"Yoda conditions\", ensuring the comparison.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/yoda\n */\n yoda: \"warn\",\n});\n","import type {\n EslintConfigObject,\n EslintRuleConfig,\n FunctionStyle,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { baseEslintRules } from \"./rules.js\";\n\n/**\n * Creates a base ESLint configuration object with specified function style rules.\n *\n * @param functionStyle - Controls how functions should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @param customRules - Optional object containing custom rules to override or add to the base configuration.\n * @returns ESLint configuration object\n */\nexport const baseEslintConfig = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n },\n linterOptions: { reportUnusedDisableDirectives: true },\n name: configNames.base,\n rules: {\n ...baseEslintRules(functionStyle, typescript),\n ...(customRules ?? {}),\n },\n});\n","import type { ESLint } from \"eslint\";\n\nimport { createRequire } from \"node:module\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { convexRules } from \"./rules.js\";\n\n// TODO: Replace with ESM import once @convex-dev/eslint-plugin stabilizes\n// The plugin doesn't have proper ESM exports yet\nconst require = createRequire(import.meta.url);\n\nconst convexPlugin = require(\"@convex-dev/eslint-plugin\");\n\n/**\n * Creates an ESLint configuration for Convex.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Convex configuration.\n * @param unicorn - Whether the config uses unicorn rules.\n * @returns ESLint configuration object for Convex\n */\nexport const convexConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n unicorn?: boolean,\n): EslintConfigObject => ({\n files: [\"**/convex/**/*.{ts,js}\"],\n name: configNames.convex,\n plugins: {\n \"@convex-dev\": convexPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...convexRules,\n ...(customRules ?? {}),\n // Convex files must be camelCase\n ...(unicorn ?\n {\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: \"camelCase\",\n },\n ],\n }\n : {}),\n },\n});\n","import type { ConvexRules } from \"./types.js\";\n\nexport const convexRules: ConvexRules = {\n \"@convex-dev/import-wrong-runtime\": \"warn\",\n \"@convex-dev/no-old-registered-function-syntax\": \"warn\",\n \"@convex-dev/require-args-validator\": \"warn\",\n};\n","import type { Linter } from \"eslint\";\n\nimport type { ReactFramework } from \"./types.js\";\n\nimport { configNames } from \"./constants.js\";\n\n/**\n * Creates an ESLint configuration for file and directory ignores.\n * By default, ignores node_modules, dist directories, and .git directories.\n *\n * @param options - Object with options to control the ignores configuration\n * @param options.reactFramework - The React framework being used\n * @param options.storybook - Whether to include .storybook directory in ignores\n * @param options.userIgnores - Additional glob patterns to ignore in ESLint checks\n * @returns ESLint configuration object with ignore patterns\n */\nexport const ignoresConfig = ({\n reactFramework,\n storybook,\n userIgnores,\n}: {\n reactFramework: ReactFramework;\n storybook: boolean;\n userIgnores: string[];\n}): Linter.Config => ({\n ignores: [\n \"**/dist/\",\n \"**/build/\",\n ...(reactFramework === \"next\" ? [\".next\"] : []),\n ...(reactFramework === \"react-router\" ? [\".react-router\"] : []),\n ...(storybook ? [\"!.storybook\"] : []),\n ...userIgnores,\n ],\n name: configNames.ignores,\n});\n","import type { ESLint } from \"eslint\";\n\nimport tsParser from \"@typescript-eslint/parser\";\nimport { createTypeScriptImportResolver } from \"eslint-import-resolver-typescript\";\nimport importXPlugin from \"eslint-plugin-import-x\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { importRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Import.\n *\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly.\n * @param customRules - Optional object containing custom rules to override or add to the Import configuration.\n * @returns ESLint configuration object for Import\n */\nexport const importConfig = (\n typescript: boolean,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: \"latest\",\n parser: tsParser,\n sourceType: \"module\",\n },\n name: configNames.import,\n plugins: {\n \"import-x\": importXPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...importRules(typescript),\n ...(customRules ?? {}),\n },\n settings: {\n \"import-x/resolver\": {\n node: true,\n typescript,\n },\n \"import-x/resolver-next\": [\n createTypeScriptImportResolver({\n alwaysTryTypes: true,\n bun: true,\n }),\n ],\n },\n});\n","import type { EslintRuleConfig } from \"../types.js\";\n\ntype ImportRules = Record<`import-x/${string}`, EslintRuleConfig>;\n\n/**\n * Creates a configuration object for import ESLint rules.\n *\n * @param typescript - Whether to include TypeScript-specific rules.\n * @returns A configuration object for import ESLint rules.\n */\nexport const importRules = (typescript: boolean): ImportRules => ({\n // these rules are better handled by typescript\n ...(!typescript ?\n {\n \"import-x/default\": \"warn\",\n \"import-x/export\": \"warn\",\n \"import-x/named\": \"warn\",\n \"import-x/namespace\": \"warn\",\n \"import-x/no-unresolved\": \"warn\",\n }\n : {}),\n /**\n * Disallow non-import statements appearing before import statements.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/first.md\n */\n \"import-x/first\": \"warn\",\n /**\n * Require a newline after the last import-x/require.\n *\n * 🔧 Fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/newline-after-import.md\n */\n \"import-x/newline-after-import\": \"warn\",\n /**\n * Disallow import of modules using absolute paths.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-absolute-path.md\n */\n \"import-x/no-absolute-path\": \"warn\",\n /**\n * Disallow cyclical dependencies between modules.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-cycle.md\n */\n \"import-x/no-cycle\": \"warn\",\n \"import-x/no-duplicates\": \"warn\",\n /**\n * Disallow the use of extraneous packages.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-extraneous-dependencies.md\n */\n \"import-x/no-extraneous-dependencies\": [\"warn\", { includeTypes: true }],\n /**\n * Disallow mutable exports.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-mutable-exports.md\n */\n \"import-x/no-mutable-exports\": \"warn\",\n // red flags (thus, warnings)\n \"import-x/no-named-as-default\": \"warn\",\n \"import-x/no-named-as-default-member\": \"warn\",\n /**\n * Disallow importing packages through relative paths.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-relative-packages.md\n */\n \"import-x/no-relative-packages\": \"warn\",\n\n /**\n * Disallow a module from importing itself.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-self-import.md\n */\n \"import-x/no-self-import\": \"warn\",\n /**\n * Ensures that there are no useless path segments.\n *\n * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import-x/blob/main/docs/rules/no-useless-path-segments.md\n */\n \"import-x/no-useless-path-segments\": [\"warn\"],\n});\n","import jsdoc from \"eslint-plugin-jsdoc\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { jsdocRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param customRules - Optional object containing custom rules to override or add to the JSDoc configuration.\n * @returns An ESLint configuration object for JSDoc comments.\n */\nexport const jsdocConfig = (\n requireJsdoc = false,\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n files: [\"**/*.{js,jsx,ts,tsx,cjs,mjs}\"],\n ignores: [\"**/*.{test,spec}.{js,jsx,ts,tsx,cjs,mjs}\"],\n name: configNames.jsdoc,\n plugins: {\n jsdoc,\n },\n rules: {\n ...jsdocRules(requireJsdoc),\n ...(customRules ?? {}),\n },\n});\n","import type { JsdocRules } from \"./types.js\";\n\n/**\n * Generates ESLint rules configuration for JSDoc comments.\n *\n * @param requireJsdoc - Whether to enforce JSDoc comments on functions and classes. Defaults to false.\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An object containing ESLint rules configuration for JSDoc validation and formatting.\n */\nexport const jsdocRules = (\n requireJsdoc = false,\n typescript = true,\n): JsdocRules => ({\n \"jsdoc/check-access\": \"warn\",\n \"jsdoc/check-alignment\": \"warn\",\n \"jsdoc/check-param-names\": [\n \"warn\",\n {\n checkDestructured: true,\n enableFixer: true,\n },\n ],\n \"jsdoc/check-property-names\": \"warn\",\n \"jsdoc/check-tag-names\": [\n \"warn\",\n {\n typed: true,\n },\n ],\n \"jsdoc/check-types\": \"warn\",\n \"jsdoc/check-values\": \"warn\",\n \"jsdoc/empty-tags\": \"warn\",\n \"jsdoc/implements-on-classes\": \"warn\",\n \"jsdoc/multiline-blocks\": \"warn\",\n \"jsdoc/no-blank-block-descriptions\": \"off\",\n \"jsdoc/no-defaults\": \"warn\",\n \"jsdoc/no-multi-asterisks\": \"warn\",\n \"jsdoc/no-types\": typescript ? \"warn\" : \"off\",\n \"jsdoc/no-undefined-types\": typescript ? \"off\" : \"warn\",\n \"jsdoc/require-asterisk-prefix\": \"warn\",\n \"jsdoc/require-description\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-jsdoc\":\n requireJsdoc ?\n [\n \"warn\",\n {\n require: {\n ArrowFunctionExpression: true,\n ClassDeclaration: true,\n ClassExpression: true,\n FunctionDeclaration: true,\n FunctionExpression: true,\n MethodDefinition: true,\n },\n },\n ]\n : \"off\",\n \"jsdoc/require-param\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-param-description\": \"warn\",\n \"jsdoc/require-param-name\": \"warn\",\n \"jsdoc/require-property\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-property-description\": \"warn\",\n \"jsdoc/require-property-name\": \"warn\",\n \"jsdoc/require-returns\": requireJsdoc ? \"warn\" : \"off\",\n \"jsdoc/require-returns-check\": \"warn\",\n \"jsdoc/require-returns-description\": \"warn\",\n \"jsdoc/require-yields\": \"warn\",\n \"jsdoc/require-yields-check\": \"warn\",\n \"jsdoc/tag-lines\": [\n \"warn\",\n \"never\",\n {\n startLines: 1, // Allow 1 line between description and first tag\n tags: {\n param: { lines: \"never\" }, // Enforce no lines between param tags\n },\n },\n ],\n \"jsdoc/text-escaping\": \"off\",\n \"jsdoc/valid-types\": \"warn\",\n});\n","import nextjs from \"eslint-plugin-nextjs\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { nextjsRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Next.js.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Next.js configuration.\n * @returns ESLint configuration object for Next.js\n */\nexport const nextjsConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.nextjs,\n plugins: {\n nextjs,\n },\n rules: {\n ...nextjsRules,\n ...(customRules ?? {}),\n },\n});\n","import type { NextjsRules } from \"./types.js\";\n\nexport const nextjsRules: NextjsRules = {\n \"nextjs/google-font-display\": \"warn\",\n \"nextjs/google-font-preconnect\": \"warn\",\n \"nextjs/inline-script-id\": \"warn\",\n \"nextjs/next-script-for-ga\": \"warn\",\n \"nextjs/no-assign-module-variable\": \"warn\",\n \"nextjs/no-async-client-component\": \"warn\",\n \"nextjs/no-before-interactive-script-outside-document\": \"warn\",\n \"nextjs/no-css-tags\": \"warn\",\n \"nextjs/no-document-import-in-page\": \"warn\",\n \"nextjs/no-duplicate-head\": \"warn\",\n \"nextjs/no-head-element\": \"warn\",\n \"nextjs/no-head-import-in-document\": \"warn\",\n \"nextjs/no-html-link-for-pages\": \"warn\",\n \"nextjs/no-img-element\": \"warn\",\n \"nextjs/no-page-custom-font\": \"warn\",\n \"nextjs/no-script-component-in-head\": \"warn\",\n \"nextjs/no-styled-jsx-in-document\": \"warn\",\n \"nextjs/no-sync-scripts\": \"warn\",\n \"nextjs/no-title-in-document-head\": \"warn\",\n \"nextjs/no-typos\": \"warn\",\n \"nextjs/no-unwanted-polyfillio\": \"warn\",\n};\n","import perfectionist from \"eslint-plugin-perfectionist\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { perfectionistRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for Perfectionist.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Perfectionist configuration.\n * @returns ESLint configuration object for Perfectionist\n */\nexport const perfectionistConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.perfectionist,\n plugins: {\n perfectionist,\n },\n rules: {\n ...perfectionistRules,\n ...(customRules ?? {}),\n },\n});\n","import type { EslintRuleConfig } from \"../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n","import type { ESLint } from \"eslint\";\n\nimport preferArrowFunctions from \"eslint-plugin-prefer-arrow-functions\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\nimport type { PreferArrowFunctionsRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Prefer Arrow Functions.\n *\n * @param customRules - Optional object containing custom rules to override or add to the configuration.\n * @returns ESLint configuration object for Prefer Arrow Functions\n */\nexport const preferArrowFunctionConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.preferArrowFunction,\n plugins: {\n \"prefer-arrow-functions\": preferArrowFunctions as ESLint.Plugin,\n },\n rules: {\n \"prefer-arrow-functions/prefer-arrow-functions\": [\n \"warn\",\n {\n returnStyle: \"unchanged\",\n singleReturnOnly: false,\n },\n ],\n ...(customRules ?? {}),\n } satisfies PreferArrowFunctionsRules,\n});\n","import type { ConfigName } from \"./constants.js\";\nimport type { EslintRuleConfig } from \"./types.js\";\n\nimport { configNames, pluginPrefixMap } from \"./constants.js\";\n\n/**\n * Categorizes custom rules provided by the user based on plugin prefixes.\n *\n * @param customRules - The custom rules provided by the user.\n * @returns An object where keys are config names (e.g., 'base', 'typescript')\n * and values are the corresponding rule subsets for that config.\n */\nexport const processCustomRules = (\n customRules: Record<string, EslintRuleConfig>,\n): Partial<Record<ConfigName, Record<string, EslintRuleConfig>>> => {\n // Initialize result object with all possible config categories\n const categorizedRules = Object.values(configNames).reduce<\n Record<ConfigName, Record<string, EslintRuleConfig>>\n >(\n (acc, configName) => {\n acc[configName] = {};\n return acc;\n },\n {} as Record<ConfigName, Record<string, EslintRuleConfig>>,\n );\n\n // Process each custom rule\n for (const [ruleKey, ruleValue] of Object.entries(customRules)) {\n // Quick check if rule has no prefix (no '/' or '@')\n // Rules without prefixes go directly to base config\n if (!ruleKey.includes(\"/\") && !ruleKey.startsWith(\"@\")) {\n categorizedRules[configNames.base][ruleKey] = ruleValue;\n continue;\n }\n\n // Extract the plugin prefix from the rule key\n let prefix: null | string = null;\n\n if (ruleKey.startsWith(\"@\")) {\n // Handle scoped packages like @typescript-eslint/rule-name\n const firstSlashIndex = ruleKey.indexOf(\"/\");\n if (firstSlashIndex !== -1) {\n prefix = ruleKey.substring(0, firstSlashIndex);\n }\n } else {\n // Handle regular plugins like eslint-plugin-react/rule-name\n const firstSlashIndex = ruleKey.indexOf(\"/\");\n if (firstSlashIndex !== -1) {\n prefix = ruleKey.substring(0, firstSlashIndex);\n }\n }\n\n // Find the corresponding config name for this prefix\n const configName =\n prefix ?\n (pluginPrefixMap.get(prefix) ?? configNames.base)\n : configNames.base;\n\n // Add the rule to the appropriate config\n categorizedRules[configName][ruleKey] = ruleValue;\n }\n\n // Filter out empty config objects to save memory\n return Object.entries(categorizedRules).reduce<\n Partial<Record<ConfigName, Record<string, EslintRuleConfig>>>\n >((acc, [configName, rules]) => {\n if (Object.keys(rules).length > 0) {\n acc[configName as ConfigName] = rules;\n }\n return acc;\n }, {});\n};\n","import type { ESLint } from \"eslint\";\n\nimport queryPlugin from \"@tanstack/eslint-plugin-query\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { queryRules } from \"./rules.js\";\n\n/**\n * Creates an ESLint configuration for TanStack Query.\n *\n * @param customRules - Optional object containing custom rules to override or add to the Query configuration.\n * @returns ESLint configuration object for TanStack Query\n */\nexport const queryConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.query,\n plugins: {\n \"@tanstack/query\": queryPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n ...queryRules,\n ...(customRules ?? {}),\n },\n});\n","import type { QueryRules } from \"./types.js\";\n\nexport const queryRules: QueryRules = {\n \"@tanstack/query/exhaustive-deps\": \"warn\",\n \"@tanstack/query/infinite-query-property-order\": \"warn\",\n \"@tanstack/query/mutation-property-order\": \"warn\",\n \"@tanstack/query/no-rest-destructuring\": \"warn\",\n \"@tanstack/query/no-unstable-deps\": \"warn\",\n \"@tanstack/query/no-void-query-fn\": \"warn\",\n \"@tanstack/query/stable-query-client\": \"warn\",\n};\n","import reactRefresh from \"eslint-plugin-react-refresh\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRefreshRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n * It enforces that components are structured in a way that integrations like\n * react-refresh expect.\n *\n * @param customRules - Optional object containing custom rules to override or add to the React Refresh configuration.\n * @returns An ESLint configuration object for React Refresh.\n */\nexport const reactRefreshEslintConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => {\n return {\n name: configNames.reactRefresh,\n plugins: {\n \"react-refresh\": reactRefresh,\n },\n rules: customRules ?? reactRefreshRules,\n };\n};\n","import type { EslintRuleConfig } from \"../types.js\";\n\nexport type ReactRefreshRules = Record<string, EslintRuleConfig> & {\n \"react-refresh/only-export-components\"?: EslintRuleConfig<{\n /**\n * Don't warn when a constant (string, number, boolean, templateLiteral)\n * is exported aside one or more components.\n */\n allowConstantExport?: boolean;\n /**\n * If you use a framework that handles HMR of some specific exports,\n * you can use this option to avoid warning for them.\n */\n allowExportNames?: string[];\n /**\n * If you're using JSX inside .js files, you can enable this option.\n * To reduce false positives, only files importing 'react' are checked.\n */\n checkJS?: boolean;\n /**\n * If you're exporting a component wrapped in a custom HOC,\n * you can use this option to avoid false positives.\n */\n customHOCs?: string[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React Refresh.\n *\n * This plugin validates that components can safely be updated with Fast Refresh.\n *\n * @returns Configuration object containing ESLint rules for React Refresh\n */\nexport const reactRefreshRules: ReactRefreshRules = {\n /**\n * Validate that your components can safely be updated with Fast Refresh.\n *\n * This rule enforces that components are structured in a way that integrations\n * like react-refresh expect.\n *\n * 🚫 Not fixable - https://github.com/ArnaudBarre/eslint-plugin-react-refresh\n */\n \"react-refresh/only-export-components\": [\n \"warn\",\n { allowConstantExport: true },\n ],\n};\n","import react from \"eslint-plugin-react\";\nimport pluginReactHooks from \"eslint-plugin-react-hooks\";\nimport globals from \"globals\";\n\nimport type {\n EslintConfigObject,\n EslintRuleConfig,\n FunctionStyle,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React.\n *\n * @param options - Configuration options\n * @param options.functionStyle - Controls how functions (components) should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param options.reactCompiler - Whether to use the React compiler rules from `eslint-plugin-react-hooks`\n * @param options.typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly\n * @param options.customRules - Optional object containing custom rules to override or add to the React configuration\n * @returns An ESLint configuration object for React.\n */\nexport const reactEslintConfig = ({\n customRules,\n functionStyle,\n reactCompiler,\n typescript,\n}: {\n customRules?: Record<string, EslintRuleConfig>;\n functionStyle: \"off\" | FunctionStyle;\n reactCompiler: boolean;\n typescript: boolean;\n}): EslintConfigObject => {\n return {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n name: configNames.react,\n plugins: {\n react,\n \"react-hooks\": pluginReactHooks,\n },\n rules: {\n ...reactRules({ functionStyle, reactCompiler, typescript }),\n ...(customRules ?? {}),\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n };\n};\n","import type { FunctionStyle } from \"../types.js\";\nimport type { ReactFunctionDefinitions, ReactRules } from \"./types.js\";\n\n/**\n * Generates ESLint rules configuration for React and React Hooks.\n * Includes settings for function component style enforcement and TypeScript-specific rules.\n *\n * @param options - Configuration options\n * @param options.functionStyle - The preferred style for React function components: 'arrow' for arrow functions, 'declaration' for function declarations, 'expression' for function expressions, or 'off' to disable style enforcement\n * @param options.reactCompiler - Whether to use the React compiler rules from `eslint-plugin-react-hooks`\n * @param options.typescript - Whether TypeScript-specific React rules should be enabled\n * @returns Configuration object containing ESLint rules for React and React Hooks\n */\nexport const reactRules = ({\n functionStyle,\n reactCompiler,\n typescript,\n}: {\n functionStyle: \"off\" | FunctionStyle;\n reactCompiler: boolean;\n typescript: boolean;\n}): ReactRules => {\n const functionStyleMap: Record<FunctionStyle, ReactFunctionDefinitions> = {\n arrow: \"arrow-function\",\n declaration: \"function-declaration\",\n expression: \"function-expression\",\n };\n\n // TODO: split out new rules into a `react-compiler` option\n\n return {\n /**\n * Disabled in favor of TypeScript for type checking\n */\n ...(typescript ? {} : { \"react/prop-types\": \"warn\" }),\n /**\n * Core React Hooks rules\n */\n \"react-hooks/exhaustive-deps\": \"warn\",\n \"react-hooks/rules-of-hooks\": \"warn\",\n /**\n * React compiler rules\n */\n ...(reactCompiler ?\n {\n /**\n * Does not seem to be working, and overlaps with static-components\n */\n // \"react-hooks/component-hook-factories\": \"warn\",\n\n /**\n * seems unecessary unless you're rolling your own React setup, users can always enable\n */\n // \"react-hooks/config\": \"warn\",\n\n \"react-hooks/error-boundaries\": \"warn\",\n \"react-hooks/globals\": \"warn\",\n \"react-hooks/immutability\": \"warn\",\n \"react-hooks/incompatible-library\": \"warn\",\n \"react-hooks/preserve-manual-memoization\": \"warn\",\n \"react-hooks/purity\": \"warn\",\n \"react-hooks/refs\": \"warn\",\n \"react-hooks/set-state-in-effect\": \"warn\",\n \"react-hooks/set-state-in-render\": \"warn\",\n\n /**\n * overlaps with react/no-unstable-nested-components\n */\n // \"react-hooks/static-components\": \"warn\",\n\n \"react-hooks/unsupported-syntax\": \"warn\",\n \"react-hooks/use-memo\": \"warn\",\n }\n : {}),\n /**\n * Require an explicit type when using button elements.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md\n */\n \"react/button-has-type\": \"warn\",\n \"react/destructuring-assignment\": [\"warn\", \"always\"],\n \"react/display-name\": \"warn\",\n /**\n * Require consistent function type for function components.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md\n */\n \"react/function-component-definition\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n {\n namedComponents: functionStyleMap[functionStyle],\n unnamedComponents:\n functionStyle === \"arrow\" ? \"arrow-function\" : (\n \"function-expression\"\n ),\n },\n ]\n ),\n /**\n * Require consistent boolean attributes notation in JSX.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n */\n \"react/jsx-boolean-value\": \"warn\",\n /**\n * Disallow unnecessary curly braces in JSX props and children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n */\n \"react/jsx-curly-brace-presence\": \"warn\",\n /**\n * Require using shorthand form for React fragments, unless required.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md\n */\n \"react/jsx-fragments\": \"warn\",\n \"react/jsx-key\": \"warn\",\n \"react/jsx-no-comment-textnodes\": \"warn\",\n \"react/jsx-no-duplicate-props\": \"warn\",\n /**\n * Prevent problematic leaked values from being rendered.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md\n */\n \"react/jsx-no-leaked-render\": \"warn\",\n /**\n * Prevents usage of unsafe `target='_blank'`.\n *\n * This rule is a part of `react/recommended`, but we've modified it to\n * allow referrer.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md\n */\n \"react/jsx-no-target-blank\": [\n \"warn\",\n {\n allowReferrer: true,\n },\n ],\n \"react/jsx-no-undef\": \"warn\",\n /**\n * Disallow empty React fragments.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n */\n \"react/jsx-no-useless-fragment\": [\"warn\", { allowExpressions: true }],\n /**\n * Require the use of PascalCase for user-defined JSX components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n */\n \"react/jsx-pascal-case\": \"warn\",\n \"react/jsx-uses-react\": \"warn\",\n \"react/jsx-uses-vars\": \"warn\",\n /**\n * Disallow usage of Array index in keys.\n *\n * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n */\n \"react/no-array-index-key\": \"warn\",\n \"react/no-children-prop\": \"warn\",\n \"react/no-danger-with-children\": \"warn\",\n \"react/no-deprecated\": \"warn\",\n \"react/no-direct-mutation-state\": \"warn\",\n \"react/no-find-dom-node\": \"warn\",\n \"react/no-is-mounted\": \"warn\",\n \"react/no-render-return-value\": \"warn\",\n \"react/no-string-refs\": \"warn\",\n \"react/no-unescaped-entities\": \"warn\",\n \"react/no-unknown-property\": \"warn\",\n \"react/no-unsafe\": \"warn\",\n /**\n * Disallow creating unstable components inside components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md\n */\n \"react/no-unstable-nested-components\": \"warn\",\n \"react/require-render-return\": \"warn\",\n /**\n * Disallow closing tags for components without children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n */\n \"react/self-closing-comp\": \"warn\",\n };\n};\n","import type { ESLint } from \"eslint\";\n\nimport storybookPlugin from \"eslint-plugin-storybook\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * ESLint configuration for Storybook.\n * Contains rules for best practices when working with Storybook.\n *\n * @param customRules - Optional custom rules to merge into the Storybook config.\n * @returns Storybook ESLint config array.\n */\nexport const storybookConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject[] => [\n {\n files: [\n \"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)\",\n \"**/*.story.@(ts|tsx|js|jsx|mjs|cjs)\",\n ],\n name: configNames.storybook,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n // Default Storybook rules\n \"import-x/no-anonymous-default-export\": \"off\",\n \"react-hooks/rules-of-hooks\": \"off\",\n \"storybook/await-interactions\": \"warn\",\n \"storybook/context-in-play-function\": \"warn\",\n \"storybook/csf-component\": \"warn\",\n \"storybook/default-exports\": \"warn\",\n \"storybook/hierarchy-separator\": \"warn\",\n \"storybook/meta-inline-properties\": \"warn\",\n \"storybook/no-redundant-story-name\": \"warn\",\n \"storybook/prefer-pascal-case\": \"warn\",\n \"storybook/story-exports\": \"warn\",\n \"storybook/use-storybook-expect\": \"warn\",\n \"storybook/use-storybook-testing-library\": \"warn\",\n // Merge custom rules\n ...(customRules ?? {}),\n },\n },\n {\n files: [\".storybook/main.@(js|cjs|mjs|ts)\"],\n name: configNames.storybookConfig,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n },\n },\n];\n","import jest from \"eslint-plugin-jest\";\nimport vitest from \"eslint-plugin-vitest\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { getImportRestrictions } from \"./get-import-restrictions.js\";\nimport { jestRules } from \"./jest-rules.js\";\nimport { vitestRules } from \"./vitest-rules.js\";\n\nexport interface TestingConfig {\n filenamePattern?: \"spec\" | \"test\";\n files?: string[];\n formattingRules?: boolean;\n framework?: \"bun\" | \"jest\" | \"node\" | \"vitest\";\n /**\n * Whether to enforce imports from the correct testing framework.\n * Uses the built-in ESLint `no-restricted-imports` rule.\n *\n * @default true\n */\n importRestrictions?: boolean;\n itOrTest?: \"it\" | \"test\";\n typescript?: boolean;\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\" or \"bun\" or \"node\"\n * @param options.formattingRules - Whether to include formatting rules like padding around blocks\n * @param options.importRestrictions - Whether to enforce imports from the correct testing framework\n * @param options.typescript - Whether the user is using TypeScript\n * @param customRules - Optional object containing custom rules to override or add to the testing configuration.\n * @returns ESLint configuration object\n */\nexport const testingConfig = (\n {\n filenamePattern = \"test\",\n files,\n formattingRules = true,\n framework = \"vitest\",\n importRestrictions = true,\n itOrTest = \"test\",\n typescript = true,\n }: TestingConfig = {},\n customRules?: Record<string, EslintRuleConfig>,\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 ...(typescript ? { \"@typescript-eslint/unbound-method\": \"off\" } : {}),\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) : 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 ...(importRestrictions ? getImportRestrictions(framework) : {}),\n ...(customRules ?? {}),\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","import type { EslintRuleConfig } from \"../types.js\";\n\nconst commonTestImports = [\n \"describe\",\n \"it\",\n \"test\",\n \"expect\",\n \"beforeAll\",\n \"beforeEach\",\n \"afterAll\",\n \"afterEach\",\n \"vi\",\n \"mock\",\n \"spyOn\",\n];\n\nconst frameworkConfig = {\n bun: {\n allowed: \"'bun:test'\",\n restricted: [\"vitest\", \"jest\", \"@jest/globals\", \"node:test\"],\n },\n jest: {\n allowed: \"'jest' or '@jest/globals'\",\n restricted: [\"vitest\", \"bun:test\", \"node:test\"],\n },\n node: {\n allowed: \"'node:test'\",\n restricted: [\"vitest\", \"jest\", \"@jest/globals\", \"bun:test\"],\n },\n vitest: {\n allowed: \"'vitest'\",\n restricted: [\"jest\", \"@jest/globals\", \"bun:test\", \"node:test\"],\n },\n} as const;\n\n/**\n * Generates the error message for restricted imports.\n *\n * @param allowedFramework - The allowed framework(s) for imports\n * @returns The formatted error message\n */\nconst getRestrictionMessage = (allowedFramework: string): string =>\n `This project is setup to use ${allowedFramework} for testing. Importing from other testing frameworks is not allowed. Change this setting in eslint.config.js under testing.framework`;\n\n/**\n * Returns import restriction rules based on the testing framework.\n * Prevents importing from the wrong testing framework.\n *\n * @param framework - The testing framework being used\n * @returns ESLint rules object with import restrictions\n */\nexport const getImportRestrictions = (\n framework: \"bun\" | \"jest\" | \"node\" | \"vitest\",\n): Record<string, EslintRuleConfig> => {\n const config = frameworkConfig[framework];\n const message = getRestrictionMessage(config.allowed);\n\n return {\n \"no-restricted-imports\": [\n \"warn\",\n {\n paths: config.restricted.map((name) => ({\n importNames: commonTestImports,\n message,\n name,\n })),\n },\n ],\n };\n};\n","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","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","import turbo from \"eslint-plugin-turbo\";\n\nimport type { EslintConfigObject, EslintRuleConfig } from \"../types.js\";\nimport type { TurboRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Turbo.\n *\n * @param customRules - Optional custom rules to merge with the default Turbo rules.\n * @returns ESLint configuration object for Turbo.\n */\nexport const turboConfig = (\n customRules?: Record<string, EslintRuleConfig>,\n): EslintConfigObject => ({\n name: configNames.turbo,\n plugins: {\n turbo,\n },\n rules:\n customRules ??\n ({\n \"turbo/no-undeclared-env-vars\": \"warn\",\n } satisfies TurboRules),\n});\n","import { defineConfig } from \"eslint/config\";\nimport tseslint, { type Config } from \"typescript-eslint\";\n\nimport type { EslintRuleConfig } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { tseslintRules } from \"./rules.js\";\n\n/**\n * Creates a TypeScript ESLint configuration object.\n *\n * @param tsconfigPath - Path to the TypeScript configuration file\n * @param customRules - Optional object containing custom rules to override or add to the TypeScript configuration.\n * @returns TypeScript ESLint configuration object\n */\nexport const tseslintConfig = (\n tsconfigPath?: string,\n customRules?: Record<string, EslintRuleConfig>,\n): Config => {\n const userCwd = process.cwd();\n\n return defineConfig(\n {\n files: [\"**/*.{js,cjs,mjs,ts,jsx,tsx}\"],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ...(tsconfigPath ?\n { project: tsconfigPath, tsconfigRootDir: userCwd }\n : { projectService: true, tsconfigRootDir: import.meta.dirname }),\n },\n },\n name: configNames.typescript,\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n },\n rules: {\n ...tseslintRules,\n ...(customRules ?? {}),\n },\n },\n {\n // disable type-aware linting on JS files\n extends: [tseslint.configs.disableTypeChecked],\n files: [\"**/*.js\"],\n },\n );\n};\n","import type { TypescriptRules } from \"./types.js\";\n\nexport const tseslintRules: TypescriptRules = {\n \"@typescript-eslint/adjacent-overload-signatures\": \"warn\",\n \"@typescript-eslint/array-type\": \"warn\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": [\n \"warn\",\n { minimumDescriptionLength: 10 },\n ],\n \"@typescript-eslint/ban-tslint-comment\": \"warn\",\n \"@typescript-eslint/class-literal-property-style\": \"warn\",\n \"@typescript-eslint/consistent-generic-constructors\": \"warn\",\n \"@typescript-eslint/consistent-indexed-object-style\": \"warn\",\n \"@typescript-eslint/consistent-type-assertions\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": \"warn\",\n \"@typescript-eslint/consistent-type-exports\": [\n \"warn\",\n { fixMixedExportsWithInlineTypeSpecifier: true },\n ],\n \"@typescript-eslint/consistent-type-imports\": [\n \"warn\",\n {\n fixStyle: \"inline-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"@typescript-eslint/dot-notation\": \"warn\",\n \"@typescript-eslint/no-array-constructor\": \"warn\",\n \"@typescript-eslint/no-array-delete\": \"warn\",\n \"@typescript-eslint/no-base-to-string\": \"warn\",\n \"@typescript-eslint/no-confusing-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-confusing-void-expression\": \"warn\",\n \"@typescript-eslint/no-deprecated\": \"warn\",\n \"@typescript-eslint/no-duplicate-enum-values\": \"warn\",\n \"@typescript-eslint/no-duplicate-type-constituents\": \"warn\",\n \"@typescript-eslint/no-dynamic-delete\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"warn\",\n \"@typescript-eslint/no-empty-object-type\": \"warn\",\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/no-extra-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-extraneous-class\": \"warn\",\n \"@typescript-eslint/no-floating-promises\": \"warn\",\n \"@typescript-eslint/no-for-in-array\": \"warn\",\n \"@typescript-eslint/no-implied-eval\": \"warn\",\n \"@typescript-eslint/no-import-type-side-effects\": \"warn\",\n \"@typescript-eslint/no-inferrable-types\": \"warn\",\n \"@typescript-eslint/no-invalid-void-type\": \"warn\",\n \"@typescript-eslint/no-meaningless-void-operator\": \"warn\",\n \"@typescript-eslint/no-misused-new\": \"warn\",\n \"@typescript-eslint/no-misused-promises\": \"warn\",\n \"@typescript-eslint/no-mixed-enums\": \"warn\",\n \"@typescript-eslint/no-namespace\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"warn\",\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-redundant-type-constituents\": \"warn\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-this-alias\": \"warn\",\n \"@typescript-eslint/no-unnecessary-boolean-literal-compare\": \"warn\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n \"@typescript-eslint/no-unnecessary-template-expression\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-constraint\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"warn\",\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"warn\",\n \"@typescript-eslint/no-unsafe-enum-comparison\": \"warn\",\n \"@typescript-eslint/no-unsafe-function-type\": \"warn\",\n \"@typescript-eslint/no-unsafe-unary-minus\": \"warn\",\n \"@typescript-eslint/no-unused-expressions\": \"warn\",\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"after-used\",\n argsIgnorePattern: \"^_\",\n ignoreRestSiblings: false,\n vars: \"all\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-useless-constructor\": \"warn\",\n \"@typescript-eslint/no-wrapper-object-types\": \"warn\",\n // TODO: Investiate non-null vs type-cast rules\n \"@typescript-eslint/non-nullable-type-assertion-style\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"warn\",\n \"@typescript-eslint/prefer-as-const\": \"warn\",\n \"@typescript-eslint/prefer-find\": \"warn\",\n \"@typescript-eslint/prefer-for-of\": \"warn\",\n \"@typescript-eslint/prefer-function-type\": \"warn\",\n \"@typescript-eslint/prefer-includes\": \"warn\",\n \"@typescript-eslint/prefer-literal-enum-member\": \"warn\",\n \"@typescript-eslint/prefer-namespace-keyword\": \"warn\",\n \"@typescript-eslint/prefer-nullish-coalescing\": [\n \"warn\",\n {\n ignorePrimitives: { string: true },\n },\n ],\n \"@typescript-eslint/prefer-optional-chain\": \"warn\",\n \"@typescript-eslint/prefer-promise-reject-errors\": \"warn\",\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"warn\",\n \"@typescript-eslint/prefer-regexp-exec\": \"warn\",\n \"@typescript-eslint/prefer-return-this-type\": \"warn\",\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"warn\",\n \"@typescript-eslint/related-getter-setter-pairs\": \"warn\",\n \"@typescript-eslint/require-await\": \"warn\",\n \"@typescript-eslint/restrict-plus-operands\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNullish: false,\n allowNumberAndString: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/restrict-template-expressions\": [\n \"warn\",\n {\n allow: [{ from: \"lib\", name: [\"Error\", \"URL\", \"URLSearchParams\"] }],\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n allowRegExp: true,\n },\n ],\n \"@typescript-eslint/return-await\": [\n \"warn\",\n \"error-handling-correctness-only\",\n ],\n \"@typescript-eslint/triple-slash-reference\": \"warn\",\n \"@typescript-eslint/unbound-method\": \"warn\",\n \"@typescript-eslint/unified-signatures\": \"warn\",\n \"@typescript-eslint/use-unknown-in-catch-callback-variable\": \"warn\",\n};\n","import unicorn from \"eslint-plugin-unicorn\";\n\nimport type {\n EslintConfigObject,\n EslintRuleConfig,\n FilenameCase,\n} from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { rules } from \"./rules.js\";\n\n/**\n * ESLint configuration for unicorn plugin.\n * This plugin provides a set of rules to enforce consistent code style and catch common errors.\n *\n * @param options - Configuration options for Unicorn.\n * @param options.customRules - Optional custom rules to merge with the default Unicorn rules.\n * @param options.filenameCase - Optional filename case to enforce. Defaults to \"kebabCase\".\n * @returns ESLint configuration object for Unicorn.\n */\nexport const unicornConfig = ({\n customRules,\n filenameCase = \"kebabCase\",\n}: {\n customRules?: Record<string, EslintRuleConfig>;\n filenameCase?: FilenameCase;\n}): EslintConfigObject => ({\n name: configNames.unicorn,\n plugins: {\n unicorn,\n },\n rules: {\n ...rules(filenameCase),\n ...(customRules ?? {}),\n },\n});\n","import type { EslintRuleConfig, FilenameCase } from \"../types.js\";\n\ntype UnicornRules = Record<`unicorn/${string}`, EslintRuleConfig>;\n\n/**\n * Generate Unicorn ESLint rules with configurable filename case.\n *\n * @param filenameCase - The filename case to enforce. Defaults to \"kebabCase\".\n * @returns Unicorn ESLint rules configuration.\n */\nexport const rules = (\n filenameCase: FilenameCase = \"kebabCase\",\n): UnicornRules => ({\n /**\n * Enforce better string content.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md\n */\n \"unicorn/better-regex\": \"warn\",\n /**\n * Enforce passing a message value when creating a built-in error.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md\n */\n \"unicorn/error-message\": \"warn\",\n /**\n * Require consistent filename case for all linted files.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\n */\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: filenameCase,\n },\n ],\n /**\n * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md\n */\n \"unicorn/new-for-builtins\": \"warn\",\n \"unicorn/no-console-spaces\": \"warn\",\n /**\n * Enforce using for-loop instead of while-loop.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md\n */\n \"unicorn/no-for-loop\": \"warn\",\n /**\n * Enforce the use of addEventListener and removeEventListener over on-functions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md\n */\n \"unicorn/prefer-add-event-listener\": \"warn\",\n /**\n * Require using the `node:` protocol when importing Node.js built-in modules.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md\n */\n \"unicorn/prefer-node-protocol\": \"warn\",\n /**\n * Prefer String#replaceAll() over String#replace() with a global regExp.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md\n */\n \"unicorn/prefer-string-replace-all\": \"warn\",\n /**\n * Enforce throwing TypeError in type checking conditions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md\n */\n \"unicorn/prefer-type-error\": \"warn\",\n /**\n * Enforce consistent brace style for case clauses.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md\n */\n \"unicorn/switch-case-braces\": [\"warn\", \"always\"],\n /**\n * Enforce consistent case for text encoding identifiers.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md\n */\n \"unicorn/text-encoding-identifier-case\": \"warn\",\n});\n","import type { Linter } from \"eslint\";\n\nimport type {\n EslintRuleConfig,\n FilenameCase,\n FunctionStyle,\n ReactFramework,\n} from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { configNames } from \"./constants.js\";\nimport { convexConfig } from \"./convex/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { importConfig } from \"./import/config.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { nextjsConfig } from \"./nextjs/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { processCustomRules } from \"./process-custom-rules.js\";\nimport { queryConfig } from \"./query/config.js\";\nimport { reactRefreshEslintConfig } from \"./react-refresh/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { storybookConfig } from \"./storybook/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n convex?: boolean;\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n importPlugin?: boolean;\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n query?: boolean;\n react?:\n | boolean\n | {\n framework?: ReactFramework;\n reactCompiler?: boolean;\n reactRefresh?: boolean;\n };\n rules?: Record<string, EslintRuleConfig>;\n sorting?: boolean;\n storybook?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?:\n | boolean\n | {\n filenameCase?: FilenameCase;\n };\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.convex - Whether to include Convex rules.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules`, `dist`, and `build`.\n * @param options.importPlugin - Whether to include the import plugin. Defaults to true.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.query - Whether to include TanStack Query rules.\n * @param options.react - Whether to include React, React hooks, and React compiler rules.\n * Can specify framework as \"next\", \"none\", \"react-router\", \"remix\", or \"vite\" to control related configs:\n * - \"next\": Includes Next.js config, excludes React Refresh.\n * - \"vite\" or \"none\": Includes React Refresh, excludes Next.js.\n * - \"remix\" or \"react-router\": Excludes both Next.js and React Refresh (these frameworks handle their own refresh logic).\n * - The reactRefresh property can override this framework-based behavior.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.storybook - Whether to include Storybook rules. Defaults to false.\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\" or \"bun\" or \"node\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `importRestrictions`: Whether to enforce imports from the correct testing framework.\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 options.turbo - Whether to include Turborepo rules. Defaults to false.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true. Can be an object with filenameCase property.\n * @param options.rules - This is for rules that you need to alter or turn off.\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 convex = false,\n functionStyle = \"arrow\",\n ignores = [],\n importPlugin = true,\n jsdoc = { requireJsdoc: false },\n query = false,\n react = false,\n rules,\n sorting = true,\n storybook = false,\n testing,\n turbo = false,\n typescript = true,\n unicorn = { filenameCase: \"kebabCase\" },\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n // Categorize user's custom rules first\n const categorizedRules = rules === undefined ? {} : processCustomRules(rules);\n\n const configs: Linter.Config[] = [\n ignoresConfig({\n reactFramework:\n isObject(react) && react.framework ? react.framework : \"none\",\n storybook,\n userIgnores: ignores,\n }),\n baseEslintConfig(\n functionStyle,\n Boolean(typescript),\n categorizedRules[configNames.base],\n ),\n ];\n\n if (functionStyle === \"arrow\") {\n configs.push(\n preferArrowFunctionConfig(\n categorizedRules[configNames.preferArrowFunction],\n ),\n );\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n categorizedRules[configNames.typescript],\n ) as Linter.Config[]),\n );\n }\n\n if (importPlugin) {\n configs.push(\n importConfig(Boolean(typescript), categorizedRules[configNames.import]),\n );\n }\n\n if (unicorn) {\n const filenameCase = isObject(unicorn) ? unicorn.filenameCase : undefined;\n configs.push(\n unicornConfig({\n customRules: categorizedRules[configNames.unicorn],\n filenameCase,\n }),\n );\n }\n\n if (sorting) {\n configs.push(\n perfectionistConfig(categorizedRules[configNames.perfectionist]),\n );\n }\n\n if (jsdoc !== false) {\n configs.push(\n jsdocConfig(\n jsdoc.requireJsdoc ?? false,\n categorizedRules[configNames.jsdoc],\n ),\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 importRestrictions: true,\n itOrTest: \"it\",\n };\n\n // Use the provided testing config or the default if testing is true\n const mergedTestingConfig: TestingConfig =\n isObject(testing) ?\n { ...defaultTestingConfig, ...testing }\n : defaultTestingConfig;\n\n // Destructure from the merged config\n const {\n filenamePattern,\n files,\n formattingRules,\n framework,\n importRestrictions,\n itOrTest,\n } = mergedTestingConfig;\n\n configs.push(\n testingConfig(\n {\n filenamePattern,\n files,\n formattingRules,\n framework,\n importRestrictions,\n itOrTest,\n typescript: Boolean(typescript),\n },\n categorizedRules[configNames.testing],\n ),\n );\n }\n\n if (react) {\n const reactOptions = isObject(react) ? react : {};\n\n // Apply reactRefresh based on framework setting or explicit override\n const shouldUseReactRefresh =\n // Explicit setting takes precedence\n reactOptions.reactRefresh === true ||\n // Framework-based default (vite/none use reactRefresh by default)\n ((reactOptions.framework === \"vite\" ||\n reactOptions.framework === \"none\") &&\n reactOptions.reactRefresh !== false);\n\n if (shouldUseReactRefresh) {\n configs.push(\n reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh]),\n );\n }\n\n configs.push(\n reactEslintConfig({\n customRules: categorizedRules[configNames.react],\n functionStyle,\n reactCompiler: reactOptions.reactCompiler ?? true,\n typescript: Boolean(typescript),\n }),\n );\n\n if (isObject(react) && react.framework === \"next\") {\n configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));\n }\n }\n\n if (query) {\n configs.push(queryConfig(categorizedRules[configNames.query]));\n }\n\n if (convex) {\n configs.push(\n convexConfig(categorizedRules[configNames.convex], Boolean(unicorn)),\n );\n }\n\n if (storybook) {\n configs.push(...storybookConfig(categorizedRules[configNames.storybook]));\n }\n\n if (turbo) {\n configs.push(turboConfig(categorizedRules[configNames.turbo]));\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","import type { Config as PrettierConfig } from \"prettier\";\nimport type { SortJsonOptions as SortJsonPluginOptions } from \"prettier-plugin-sort-json\";\nimport type { PluginOptions as TailwindPluginOptions } from \"prettier-plugin-tailwindcss\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\n\nexport interface PrettierConfigOptions extends PrettierConfig {\n cssOrderPlugin?: boolean;\n curlyPlugin?: boolean;\n jsonSortPlugin?: boolean | SortJsonPluginOptions;\n packageJsonPlugin?: boolean;\n parser?: \"default\" | \"oxc\";\n tailwindPlugin?: boolean | string | TailwindPluginOptions;\n}\n\nexport interface PrettierConfigWithPlugins\n extends PrettierConfig,\n SortJsonPluginOptions,\n TailwindPluginOptions {}\n\n/**\n * Creates a Prettier configuration object with optional Tailwind support\n *\n * @param options - Configuration options for Prettier\n * @param options.cssOrderPlugin CSS order sorting support\n * @param options.curlyPlugin Enforce curly braces for all control statements\n * @param options.jsonSortPlugin JSON sorting support\n * @param options.parser choose between default and oxc parser\n * @param options.packageJsonPlugin Package.json sorting support\n * @param options.tailwindPlugin Tailwind CSS formatting support\n * @returns Prettier configuration object with:\n * - Default Prettier configuration\n * - Experimental ternaries enabled\n * - OXC parser plugin\n * - CSS order plugin\n * - Curly braces plugin\n * - JSON sorting plugin\n * - Package.json sorting plugin\n * - Optional Tailwind plugin and functions\n */\nexport const prettierConfig = (\n options: PrettierConfigOptions = {},\n): PrettierConfigWithPlugins => {\n const {\n cssOrderPlugin = true,\n curlyPlugin = true,\n jsonSortPlugin = true,\n packageJsonPlugin = true,\n parser = \"oxc\",\n tailwindPlugin = false,\n ...rest\n } = options;\n\n const plugins: string[] = [];\n const config: PrettierConfigWithPlugins = {\n experimentalTernaries: true,\n ...rest,\n };\n\n if (parser === \"oxc\") {\n plugins.push(\"@prettier/plugin-oxc\");\n }\n\n if (cssOrderPlugin) {\n plugins.push(\"prettier-plugin-css-order\");\n }\n\n if (curlyPlugin) {\n plugins.push(\"prettier-plugin-curly\");\n }\n\n if (jsonSortPlugin) {\n plugins.push(\"prettier-plugin-sort-json\");\n\n if (isObject(jsonSortPlugin)) {\n Object.assign(config, jsonSortPlugin);\n } else {\n config.jsonRecursiveSort = true;\n }\n }\n\n if (packageJsonPlugin) {\n plugins.push(\"prettier-plugin-packagejson\");\n }\n\n if (tailwindPlugin) {\n plugins.push(\"prettier-plugin-tailwindcss\");\n const defaultTailwindFunctions = [\"clsx\", \"cva\", \"cn\"];\n\n if (isString(tailwindPlugin)) {\n // then it's the path to the stylesheet\n config.tailwindStylesheet = tailwindPlugin;\n config.tailwindFunctions = defaultTailwindFunctions;\n } else if (isObject(tailwindPlugin)) {\n Object.assign(config, tailwindPlugin);\n\n // Ensure defaultTailwindFunctions is applied if tailwindFunctions wasn't specified\n if (!tailwindPlugin.tailwindFunctions) {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n } else {\n config.tailwindFunctions = defaultTailwindFunctions;\n }\n }\n\n // Set plugins after all configurations are done\n config.plugins = plugins;\n\n return config;\n};\n"],"mappings":";AAMO,IAAM,WAAW,CAAC,UAAoC;AAC3D,SAAO,OAAO,UAAU;AAC1B;AAsCO,IAAM,WAAW,CAAC,UAAqD;AAC5E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;AC3CO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;AAQO,IAAM,kBAAkB,oBAAI,IAAwB;AAAA,EACzD,CAAC,eAAe,YAAY,MAAM;AAAA,EAClC,CAAC,mBAAmB,YAAY,KAAK;AAAA,EACrC,CAAC,sBAAsB,YAAY,UAAU;AAAA,EAC7C,CAAC,UAAU,YAAY,MAAM;AAAA,EAC7B,CAAC,YAAY,YAAY,MAAM;AAAA,EAC/B,CAAC,QAAQ,YAAY,OAAO;AAAA,EAC5B,CAAC,SAAS,YAAY,KAAK;AAAA,EAC3B,CAAC,UAAU,YAAY,MAAM;AAAA,EAC7B,CAAC,iBAAiB,YAAY,aAAa;AAAA,EAC3C,CAAC,SAAS,YAAY,KAAK;AAAA,EAC3B,CAAC,eAAe,YAAY,KAAK;AAAA,EACjC,CAAC,iBAAiB,YAAY,YAAY;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,IAC7B;AAAA,EACF;AAGA,SAAO,UAAU;AAEjB,SAAO;AACT;","names":["require","unicorn","rules","jsdoc","react","rules","turbo","unicorn"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-style-kit",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "A zero configuration style guide for ESLint and Prettier",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -45,35 +45,35 @@
|
|
|
45
45
|
"@convex-dev/eslint-plugin": "1.0.0",
|
|
46
46
|
"@prettier/plugin-oxc": "0.0.4",
|
|
47
47
|
"@tanstack/eslint-plugin-query": "5.91.2",
|
|
48
|
-
"@typescript-eslint/parser": "8.46.
|
|
49
|
-
"eslint": "9.
|
|
48
|
+
"@typescript-eslint/parser": "8.46.3",
|
|
49
|
+
"eslint": "9.39.1",
|
|
50
50
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
51
51
|
"eslint-plugin-import-x": "4.16.1",
|
|
52
52
|
"eslint-plugin-jest": "29.0.1",
|
|
53
|
-
"eslint-plugin-jsdoc": "61.1.
|
|
54
|
-
"eslint-plugin-nextjs": "1.1.
|
|
53
|
+
"eslint-plugin-jsdoc": "61.1.12",
|
|
54
|
+
"eslint-plugin-nextjs": "1.1.2",
|
|
55
55
|
"eslint-plugin-perfectionist": "4.15.1",
|
|
56
56
|
"eslint-plugin-prefer-arrow-functions": "3.9.1",
|
|
57
57
|
"eslint-plugin-react": "7.37.5",
|
|
58
58
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
59
59
|
"eslint-plugin-react-refresh": "0.4.24",
|
|
60
|
-
"eslint-plugin-storybook": "
|
|
61
|
-
"eslint-plugin-turbo": "2.
|
|
62
|
-
"eslint-plugin-unicorn": "
|
|
60
|
+
"eslint-plugin-storybook": "10.0.3",
|
|
61
|
+
"eslint-plugin-turbo": "2.6.0",
|
|
62
|
+
"eslint-plugin-unicorn": "62.0.0",
|
|
63
63
|
"eslint-plugin-vitest": "0.5.4",
|
|
64
|
-
"globals": "16.
|
|
64
|
+
"globals": "16.5.0",
|
|
65
65
|
"prettier": "3.6.2",
|
|
66
66
|
"prettier-plugin-css-order": "2.1.2",
|
|
67
67
|
"prettier-plugin-curly": "0.4.0",
|
|
68
68
|
"prettier-plugin-packagejson": "2.5.19",
|
|
69
69
|
"prettier-plugin-sort-json": "4.1.1",
|
|
70
70
|
"prettier-plugin-tailwindcss": "0.7.1",
|
|
71
|
-
"typescript-eslint": "8.46.
|
|
71
|
+
"typescript-eslint": "8.46.3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@repo/typescript-config": "workspace:*",
|
|
75
75
|
"@types/bun": "1.3.1",
|
|
76
|
-
"@types/node": "
|
|
76
|
+
"@types/node": "24.10.0",
|
|
77
77
|
"commander": "14.0.2",
|
|
78
78
|
"glob": "11.0.3",
|
|
79
79
|
"tsup": "8.5.0",
|
package/src/eslint/ignores.ts
CHANGED
|
@@ -25,6 +25,7 @@ export const ignoresConfig = ({
|
|
|
25
25
|
}): Linter.Config => ({
|
|
26
26
|
ignores: [
|
|
27
27
|
"**/dist/",
|
|
28
|
+
"**/build/",
|
|
28
29
|
...(reactFramework === "next" ? [".next"] : []),
|
|
29
30
|
...(reactFramework === "react-router" ? [".react-router"] : []),
|
|
30
31
|
...(storybook ? ["!.storybook"] : []),
|
package/src/eslint/index.ts
CHANGED
|
@@ -64,7 +64,7 @@ export interface EslintConfigOptions {
|
|
|
64
64
|
* @param options - The optional configuration object.
|
|
65
65
|
* @param options.convex - Whether to include Convex rules.
|
|
66
66
|
* @param options.functionStyle - The function style to enforce. Defaults to "arrow".
|
|
67
|
-
* @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `
|
|
67
|
+
* @param options.ignores - Additional paths to ignore. Already excludes `node_modules`, `dist`, and `build`.
|
|
68
68
|
* @param options.importPlugin - Whether to include the import plugin. Defaults to true.
|
|
69
69
|
* @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.
|
|
70
70
|
* @param options.query - Whether to include TanStack Query rules.
|
|
@@ -126,11 +126,10 @@ export const eslintConfig = (
|
|
|
126
126
|
),
|
|
127
127
|
];
|
|
128
128
|
|
|
129
|
-
if (
|
|
129
|
+
if (functionStyle === "arrow") {
|
|
130
130
|
configs.push(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
categorizedRules[configNames.jsdoc],
|
|
131
|
+
preferArrowFunctionConfig(
|
|
132
|
+
categorizedRules[configNames.preferArrowFunction],
|
|
134
133
|
),
|
|
135
134
|
);
|
|
136
135
|
}
|
|
@@ -150,45 +149,28 @@ export const eslintConfig = (
|
|
|
150
149
|
);
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
// Apply reactRefresh based on framework setting or explicit override
|
|
157
|
-
const shouldUseReactRefresh =
|
|
158
|
-
// Explicit setting takes precedence
|
|
159
|
-
reactOptions.reactRefresh === true ||
|
|
160
|
-
// Framework-based default (vite/none use reactRefresh by default)
|
|
161
|
-
((reactOptions.framework === "vite" ||
|
|
162
|
-
reactOptions.framework === "none") &&
|
|
163
|
-
reactOptions.reactRefresh !== false);
|
|
164
|
-
|
|
165
|
-
if (shouldUseReactRefresh) {
|
|
166
|
-
configs.push(
|
|
167
|
-
reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh]),
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
152
|
+
if (unicorn) {
|
|
153
|
+
const filenameCase = isObject(unicorn) ? unicorn.filenameCase : undefined;
|
|
171
154
|
configs.push(
|
|
172
|
-
|
|
173
|
-
customRules: categorizedRules[configNames.
|
|
174
|
-
|
|
175
|
-
reactCompiler: reactOptions.reactCompiler ?? true,
|
|
176
|
-
typescript: Boolean(typescript),
|
|
155
|
+
unicornConfig({
|
|
156
|
+
customRules: categorizedRules[configNames.unicorn],
|
|
157
|
+
filenameCase,
|
|
177
158
|
}),
|
|
178
159
|
);
|
|
179
|
-
|
|
180
|
-
if (isObject(react) && react.framework === "next") {
|
|
181
|
-
configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
|
|
182
|
-
}
|
|
183
160
|
}
|
|
184
161
|
|
|
185
|
-
if (
|
|
186
|
-
configs.push(
|
|
162
|
+
if (sorting) {
|
|
163
|
+
configs.push(
|
|
164
|
+
perfectionistConfig(categorizedRules[configNames.perfectionist]),
|
|
165
|
+
);
|
|
187
166
|
}
|
|
188
167
|
|
|
189
|
-
if (
|
|
168
|
+
if (jsdoc !== false) {
|
|
190
169
|
configs.push(
|
|
191
|
-
|
|
170
|
+
jsdocConfig(
|
|
171
|
+
jsdoc.requireJsdoc ?? false,
|
|
172
|
+
categorizedRules[configNames.jsdoc],
|
|
173
|
+
),
|
|
192
174
|
);
|
|
193
175
|
}
|
|
194
176
|
|
|
@@ -234,27 +216,45 @@ export const eslintConfig = (
|
|
|
234
216
|
);
|
|
235
217
|
}
|
|
236
218
|
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
219
|
+
if (react) {
|
|
220
|
+
const reactOptions = isObject(react) ? react : {};
|
|
221
|
+
|
|
222
|
+
// Apply reactRefresh based on framework setting or explicit override
|
|
223
|
+
const shouldUseReactRefresh =
|
|
224
|
+
// Explicit setting takes precedence
|
|
225
|
+
reactOptions.reactRefresh === true ||
|
|
226
|
+
// Framework-based default (vite/none use reactRefresh by default)
|
|
227
|
+
((reactOptions.framework === "vite" ||
|
|
228
|
+
reactOptions.framework === "none") &&
|
|
229
|
+
reactOptions.reactRefresh !== false);
|
|
230
|
+
|
|
231
|
+
if (shouldUseReactRefresh) {
|
|
232
|
+
configs.push(
|
|
233
|
+
reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh]),
|
|
234
|
+
);
|
|
235
|
+
}
|
|
242
236
|
|
|
243
|
-
if (unicorn) {
|
|
244
|
-
const filenameCase = isObject(unicorn) ? unicorn.filenameCase : undefined;
|
|
245
237
|
configs.push(
|
|
246
|
-
|
|
247
|
-
customRules: categorizedRules[configNames.
|
|
248
|
-
|
|
238
|
+
reactEslintConfig({
|
|
239
|
+
customRules: categorizedRules[configNames.react],
|
|
240
|
+
functionStyle,
|
|
241
|
+
reactCompiler: reactOptions.reactCompiler ?? true,
|
|
242
|
+
typescript: Boolean(typescript),
|
|
249
243
|
}),
|
|
250
244
|
);
|
|
245
|
+
|
|
246
|
+
if (isObject(react) && react.framework === "next") {
|
|
247
|
+
configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
|
|
248
|
+
}
|
|
251
249
|
}
|
|
252
250
|
|
|
253
|
-
if (
|
|
251
|
+
if (query) {
|
|
252
|
+
configs.push(queryConfig(categorizedRules[configNames.query]));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (convex) {
|
|
254
256
|
configs.push(
|
|
255
|
-
|
|
256
|
-
categorizedRules[configNames.preferArrowFunction],
|
|
257
|
-
),
|
|
257
|
+
convexConfig(categorizedRules[configNames.convex], Boolean(unicorn)),
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
260
|
|