js-style-kit 0.8.1 → 0.8.3

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 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 `dist`.
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
@@ -499,7 +499,7 @@ var convexRules = {
499
499
  // src/eslint/convex/config.ts
500
500
  var require2 = createRequire(import.meta.url);
501
501
  var convexPlugin = require2("@convex-dev/eslint-plugin");
502
- var convexConfig = (customRules) => ({
502
+ var convexConfig = (customRules, unicorn2) => ({
503
503
  files: ["**/convex/**/*.{ts,js}"],
504
504
  name: configNames.convex,
505
505
  plugins: {
@@ -507,7 +507,16 @@ var convexConfig = (customRules) => ({
507
507
  },
508
508
  rules: {
509
509
  ...convexRules,
510
- ...customRules ?? {}
510
+ ...customRules ?? {},
511
+ // Convex files must be camelCase
512
+ ...unicorn2 ? {
513
+ "unicorn/filename-case": [
514
+ "warn",
515
+ {
516
+ case: "camelCase"
517
+ }
518
+ ]
519
+ } : {}
511
520
  }
512
521
  });
513
522
 
@@ -519,6 +528,7 @@ var ignoresConfig = ({
519
528
  }) => ({
520
529
  ignores: [
521
530
  "**/dist/",
531
+ "**/build/",
522
532
  ...reactFramework === "next" ? [".next"] : [],
523
533
  ...reactFramework === "react-router" ? [".react-router"] : [],
524
534
  ...storybook ? ["!.storybook"] : [],
@@ -1653,11 +1663,10 @@ var eslintConfig = ({
1653
1663
  categorizedRules[configNames.base]
1654
1664
  )
1655
1665
  ];
1656
- if (jsdoc2 !== false) {
1666
+ if (functionStyle === "arrow") {
1657
1667
  configs.push(
1658
- jsdocConfig(
1659
- jsdoc2.requireJsdoc ?? false,
1660
- categorizedRules[configNames.jsdoc]
1668
+ preferArrowFunctionConfig(
1669
+ categorizedRules[configNames.preferArrowFunction]
1661
1670
  )
1662
1671
  );
1663
1672
  }
@@ -1674,35 +1683,27 @@ var eslintConfig = ({
1674
1683
  importConfig(Boolean(typescript), categorizedRules[configNames.import])
1675
1684
  );
1676
1685
  }
1677
- if (react2) {
1678
- const reactOptions = isObject(react2) ? react2 : {};
1679
- const shouldUseReactRefresh = (
1680
- // Explicit setting takes precedence
1681
- reactOptions.reactRefresh === true || // Framework-based default (vite/none use reactRefresh by default)
1682
- (reactOptions.framework === "vite" || reactOptions.framework === "none") && reactOptions.reactRefresh !== false
1683
- );
1684
- if (shouldUseReactRefresh) {
1685
- configs.push(
1686
- reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh])
1687
- );
1688
- }
1686
+ if (unicorn2) {
1687
+ const filenameCase = isObject(unicorn2) ? unicorn2.filenameCase : void 0;
1689
1688
  configs.push(
1690
- reactEslintConfig({
1691
- customRules: categorizedRules[configNames.react],
1692
- functionStyle,
1693
- reactCompiler: reactOptions.reactCompiler ?? true,
1694
- typescript: Boolean(typescript)
1689
+ unicornConfig({
1690
+ customRules: categorizedRules[configNames.unicorn],
1691
+ filenameCase
1695
1692
  })
1696
1693
  );
1697
- if (isObject(react2) && react2.framework === "next") {
1698
- configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
1699
- }
1700
1694
  }
1701
- if (query) {
1702
- configs.push(queryConfig(categorizedRules[configNames.query]));
1695
+ if (sorting) {
1696
+ configs.push(
1697
+ perfectionistConfig(categorizedRules[configNames.perfectionist])
1698
+ );
1703
1699
  }
1704
- if (convex) {
1705
- configs.push(convexConfig(categorizedRules[configNames.convex]));
1700
+ if (jsdoc2 !== false) {
1701
+ configs.push(
1702
+ jsdocConfig(
1703
+ jsdoc2.requireJsdoc ?? false,
1704
+ categorizedRules[configNames.jsdoc]
1705
+ )
1706
+ );
1706
1707
  }
1707
1708
  if (testing !== false) {
1708
1709
  const defaultTestingConfig = {
@@ -1737,25 +1738,36 @@ var eslintConfig = ({
1737
1738
  )
1738
1739
  );
1739
1740
  }
1740
- if (sorting) {
1741
- configs.push(
1742
- perfectionistConfig(categorizedRules[configNames.perfectionist])
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
1743
1747
  );
1744
- }
1745
- if (unicorn2) {
1746
- const filenameCase = isObject(unicorn2) ? unicorn2.filenameCase : void 0;
1748
+ if (shouldUseReactRefresh) {
1749
+ configs.push(
1750
+ reactRefreshEslintConfig(categorizedRules[configNames.reactRefresh])
1751
+ );
1752
+ }
1747
1753
  configs.push(
1748
- unicornConfig({
1749
- customRules: categorizedRules[configNames.unicorn],
1750
- filenameCase
1754
+ reactEslintConfig({
1755
+ customRules: categorizedRules[configNames.react],
1756
+ functionStyle,
1757
+ reactCompiler: reactOptions.reactCompiler ?? true,
1758
+ typescript: Boolean(typescript)
1751
1759
  })
1752
1760
  );
1761
+ if (isObject(react2) && react2.framework === "next") {
1762
+ configs.push(nextjsConfig(categorizedRules[configNames.nextjs]));
1763
+ }
1753
1764
  }
1754
- if (functionStyle === "arrow") {
1765
+ if (query) {
1766
+ configs.push(queryConfig(categorizedRules[configNames.query]));
1767
+ }
1768
+ if (convex) {
1755
1769
  configs.push(
1756
- preferArrowFunctionConfig(
1757
- categorizedRules[configNames.preferArrowFunction]
1758
- )
1770
+ convexConfig(categorizedRules[configNames.convex], Boolean(unicorn2))
1759
1771
  );
1760
1772
  }
1761
1773
  if (storybook) {