@zayne-labs/eslint-config 0.9.5 → 0.9.7

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.js CHANGED
@@ -914,19 +914,41 @@ const defaultPluginRenameMap = defineEnum({
914
914
  "import-x": "import",
915
915
  n: "node"
916
916
  });
917
+ const allowedNextJsExportNames = [
918
+ "dynamic",
919
+ "dynamicParams",
920
+ "revalidate",
921
+ "fetchCache",
922
+ "runtime",
923
+ "preferredRegion",
924
+ "maxDuration",
925
+ "config",
926
+ "generateStaticParams",
927
+ "metadata",
928
+ "generateMetadata",
929
+ "viewport",
930
+ "generateViewport"
931
+ ];
932
+ const allowedReactRouterExportNames = [
933
+ "meta",
934
+ "links",
935
+ "headers",
936
+ "loader",
937
+ "action"
938
+ ];
917
939
 
918
940
  //#endregion
919
941
  //#region src/configs/react.ts
920
942
  const ReactRefreshAllowConstantExportPackages = ["vite"];
921
- const RemixPackages = [
922
- "@remix-run/node",
923
- "@remix-run/react",
924
- "@remix-run/serve",
925
- "@remix-run/dev"
943
+ const ReactRouterPackages = [
944
+ "@react-router/node",
945
+ "@react-router/react",
946
+ "@react-router/serve",
947
+ "@react-router/dev"
926
948
  ];
927
949
  const NextJsPackages = ["next"];
928
950
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists(i));
929
- const isUsingRemix = RemixPackages.some((i) => isPackageExists(i));
951
+ const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
930
952
  const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
931
953
  const react = async (options = {}) => {
932
954
  const { compiler = false, files = [GLOB_SRC], nextjs = isUsingNext, overrides, refresh = true, typescript: typescript$1 = true } = options;
@@ -1001,27 +1023,7 @@ const react = async (options = {}) => {
1001
1023
  plugins: { "react-refresh": eslintPluginReactRefresh },
1002
1024
  rules: { "react-refresh/only-export-components": ["warn", {
1003
1025
  allowConstantExport: isAllowConstantExport,
1004
- allowExportNames: [...isUsingNext ? [
1005
- "dynamic",
1006
- "dynamicParams",
1007
- "revalidate",
1008
- "fetchCache",
1009
- "runtime",
1010
- "preferredRegion",
1011
- "maxDuration",
1012
- "config",
1013
- "generateStaticParams",
1014
- "metadata",
1015
- "generateMetadata",
1016
- "viewport",
1017
- "generateViewport"
1018
- ] : [], ...isUsingRemix ? [
1019
- "meta",
1020
- "links",
1021
- "headers",
1022
- "loader",
1023
- "action"
1024
- ] : []]
1026
+ allowExportNames: [...isUsingNext ? allowedNextJsExportNames : [], ...isUsingReactRouter ? allowedReactRouterExportNames : []]
1025
1027
  }] }
1026
1028
  });
1027
1029
  if (compiler) config.push({
@@ -1356,11 +1358,13 @@ const tailwindcssBetter = async (options = {}) => {
1356
1358
  {
1357
1359
  name: "zayne/tailwindcss-better/rules",
1358
1360
  rules: {
1361
+ "tailwindcss-better/enforce-consistent-important-position": "warn",
1359
1362
  "tailwindcss-better/enforce-consistent-line-wrapping": "off",
1360
1363
  "tailwindcss-better/enforce-consistent-variable-syntax": "warn",
1361
1364
  "tailwindcss-better/enforce-shorthand-classes": "warn",
1362
1365
  "tailwindcss-better/multiline": "off",
1363
1366
  "tailwindcss-better/no-conflicting-classes": "warn",
1367
+ "tailwindcss-better/no-deprecated-classes": "warn",
1364
1368
  "tailwindcss-better/no-unregistered-classes": "warn",
1365
1369
  ...overrides
1366
1370
  }
@@ -1448,7 +1452,7 @@ const typescript = async (options = {}) => {
1448
1452
  GLOB_TS,
1449
1453
  GLOB_TSX,
1450
1454
  ...componentExts.map((ext) => `**/*.${ext}`)
1451
- ], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS], tsconfigPath, isTypeAware = Boolean(tsconfigPath), overrides, overridesTypeAware, parserOptions, stylistic: stylistic$1 = true } = options;
1455
+ ], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS], tsconfigPath = true, isTypeAware = Boolean(tsconfigPath), overrides, overridesTypeAware, parserOptions, stylistic: stylistic$1 = true } = options;
1452
1456
  const tsEslint = await interopDefault(import("typescript-eslint"));
1453
1457
  const projectServiceObject = isTypeAware && (allowDefaultProject ? {
1454
1458
  projectService: {
@@ -1457,7 +1461,7 @@ const typescript = async (options = {}) => {
1457
1461
  },
1458
1462
  tsconfigRootDir: process.cwd()
1459
1463
  } : {
1460
- project: tsconfigPath ?? true,
1464
+ project: tsconfigPath,
1461
1465
  tsconfigRootDir: process.cwd()
1462
1466
  });
1463
1467
  const makeParser = (parsedFiles, ignores$1) => ({
@@ -1855,6 +1859,7 @@ const zayne = (options = {}, ...userConfigs) => {
1855
1859
  componentExts,
1856
1860
  isTypeAware,
1857
1861
  stylistic: isStylistic,
1862
+ tsconfigPath,
1858
1863
  ...resolveOptions(enableTypeScript)
1859
1864
  }));
1860
1865
  if (enableStylistic) configs.push(stylistic({