@alextheman/eslint-plugin 3.1.3 → 3.1.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.cjs CHANGED
@@ -3765,7 +3765,7 @@ module.exports = __toCommonJS(index_exports);
3765
3765
 
3766
3766
  // package.json
3767
3767
  var name = "@alextheman/eslint-plugin";
3768
- var version = "3.1.3";
3768
+ var version = "3.1.4";
3769
3769
 
3770
3770
  // src/configs/index.ts
3771
3771
  var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
@@ -4969,8 +4969,20 @@ var standardiseErrorMessages = createRule_default({
4969
4969
  var standardise_error_messages_default = standardiseErrorMessages;
4970
4970
 
4971
4971
  // src/rules/use-normalized-imports.ts
4972
- var import_path = __toESM(require("path"), 1);
4973
4972
  var import_zod6 = __toESM(require("zod"), 1);
4973
+
4974
+ // src/utility/normalizeImportPath.ts
4975
+ var import_path = __toESM(require("path"), 1);
4976
+ function normalizeImportPath(importPath) {
4977
+ const normalizedPath = import_path.default.posix.normalize(importPath);
4978
+ if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
4979
+ return `./${normalizedPath}`;
4980
+ }
4981
+ return normalizedPath;
4982
+ }
4983
+ var normalizeImportPath_default = normalizeImportPath;
4984
+
4985
+ // src/rules/use-normalized-imports.ts
4974
4986
  var useNormalizedImportsOptionsSchema = import_zod6.default.object({
4975
4987
  fixable: import_zod6.default.boolean()
4976
4988
  }).partial();
@@ -4999,7 +5011,7 @@ var useNormalizedImports = createRule_default({
4999
5011
  );
5000
5012
  return {
5001
5013
  ImportDeclaration(node) {
5002
- const normalizedPath = node.source.value.startsWith("./") ? `./${import_path.default.posix.normalize(node.source.value)}` : import_path.default.posix.normalize(node.source.value);
5014
+ const normalizedPath = normalizeImportPath_default(node.source.value);
5003
5015
  if (node.source.value !== normalizedPath) {
5004
5016
  return context.report({
5005
5017
  node,
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
4
4
  import z from 'zod';
5
5
 
6
6
  var name = "@alextheman/eslint-plugin";
7
- var version = "3.1.3";
7
+ var version = "3.1.4";
8
8
 
9
9
  type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
10
10
 
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
4
4
  import z from 'zod';
5
5
 
6
6
  var name = "@alextheman/eslint-plugin";
7
- var version = "3.1.3";
7
+ var version = "3.1.4";
8
8
 
9
9
  type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
10
10
 
package/dist/index.js CHANGED
@@ -3744,7 +3744,7 @@ var require_src = __commonJS({
3744
3744
 
3745
3745
  // package.json
3746
3746
  var name = "@alextheman/eslint-plugin";
3747
- var version = "3.1.3";
3747
+ var version = "3.1.4";
3748
3748
 
3749
3749
  // src/configs/index.ts
3750
3750
  import packageJson from "eslint-plugin-package-json";
@@ -4948,8 +4948,20 @@ var standardiseErrorMessages = createRule_default({
4948
4948
  var standardise_error_messages_default = standardiseErrorMessages;
4949
4949
 
4950
4950
  // src/rules/use-normalized-imports.ts
4951
- import path from "path";
4952
4951
  import z6 from "zod";
4952
+
4953
+ // src/utility/normalizeImportPath.ts
4954
+ import path from "path";
4955
+ function normalizeImportPath(importPath) {
4956
+ const normalizedPath = path.posix.normalize(importPath);
4957
+ if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
4958
+ return `./${normalizedPath}`;
4959
+ }
4960
+ return normalizedPath;
4961
+ }
4962
+ var normalizeImportPath_default = normalizeImportPath;
4963
+
4964
+ // src/rules/use-normalized-imports.ts
4953
4965
  var useNormalizedImportsOptionsSchema = z6.object({
4954
4966
  fixable: z6.boolean()
4955
4967
  }).partial();
@@ -4978,7 +4990,7 @@ var useNormalizedImports = createRule_default({
4978
4990
  );
4979
4991
  return {
4980
4992
  ImportDeclaration(node) {
4981
- const normalizedPath = node.source.value.startsWith("./") ? `./${path.posix.normalize(node.source.value)}` : path.posix.normalize(node.source.value);
4993
+ const normalizedPath = normalizeImportPath_default(node.source.value);
4982
4994
  if (node.source.value !== normalizedPath) {
4983
4995
  return context.report({
4984
4996
  node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "repository": {
6
6
  "type": "git",