@alextheman/eslint-plugin 4.0.0 → 4.0.1
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 +4 -16
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -16
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3771,7 +3771,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
3771
3771
|
|
|
3772
3772
|
// package.json
|
|
3773
3773
|
var name = "@alextheman/eslint-plugin";
|
|
3774
|
-
var version = "4.0.
|
|
3774
|
+
var version = "4.0.1";
|
|
3775
3775
|
|
|
3776
3776
|
// src/configs/personal/testsBase.ts
|
|
3777
3777
|
var import_globals = __toESM(require_globals2(), 1);
|
|
@@ -4982,20 +4982,8 @@ var standardiseErrorMessages = createRule_default({
|
|
|
4982
4982
|
var standardise_error_messages_default = standardiseErrorMessages;
|
|
4983
4983
|
|
|
4984
4984
|
// src/rules/use-normalized-imports.ts
|
|
4985
|
+
var import_utility5 = require("@alextheman/utility");
|
|
4985
4986
|
var import_zod6 = __toESM(require("zod"), 1);
|
|
4986
|
-
|
|
4987
|
-
// src/utility/normalizeImportPath.ts
|
|
4988
|
-
var import_path = __toESM(require("path"), 1);
|
|
4989
|
-
function normalizeImportPath(importPath) {
|
|
4990
|
-
const normalizedPath = import_path.default.posix.normalize(importPath);
|
|
4991
|
-
if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
|
|
4992
|
-
return `./${normalizedPath}`;
|
|
4993
|
-
}
|
|
4994
|
-
return normalizedPath;
|
|
4995
|
-
}
|
|
4996
|
-
var normalizeImportPath_default = normalizeImportPath;
|
|
4997
|
-
|
|
4998
|
-
// src/rules/use-normalized-imports.ts
|
|
4999
4987
|
var useNormalizedImportsOptionsSchema = import_zod6.default.object({
|
|
5000
4988
|
fixable: import_zod6.default.boolean()
|
|
5001
4989
|
}).partial();
|
|
@@ -5007,7 +4995,7 @@ var useNormalizedImports = createRule_default({
|
|
|
5007
4995
|
name: "use-normalized-imports",
|
|
5008
4996
|
meta: {
|
|
5009
4997
|
docs: {
|
|
5010
|
-
description: "Enforce the usage of
|
|
4998
|
+
description: "Enforce the usage of normalized imports (i.e. import paths that you would only get from path.posix.normalize())"
|
|
5011
4999
|
},
|
|
5012
5000
|
messages: {
|
|
5013
5001
|
pathNotNormalized: "Import path {{nonNormalized}} is not normalised. Please use {{normalized}} instead."
|
|
@@ -5024,7 +5012,7 @@ var useNormalizedImports = createRule_default({
|
|
|
5024
5012
|
);
|
|
5025
5013
|
return {
|
|
5026
5014
|
ImportDeclaration(node) {
|
|
5027
|
-
const normalizedPath =
|
|
5015
|
+
const normalizedPath = (0, import_utility5.normalizeImportPath)(node.source.value);
|
|
5028
5016
|
if (node.source.value !== normalizedPath) {
|
|
5029
5017
|
return context.report({
|
|
5030
5018
|
node,
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { RuleFixer, RuleFix, RuleContext } from '@typescript-eslint/utils/ts-esl
|
|
|
6
6
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
7
7
|
|
|
8
8
|
var name = "@alextheman/eslint-plugin";
|
|
9
|
-
var version = "4.0.
|
|
9
|
+
var version = "4.0.1";
|
|
10
10
|
|
|
11
11
|
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;
|
|
12
12
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { RuleFixer, RuleFix, RuleContext } from '@typescript-eslint/utils/ts-esl
|
|
|
6
6
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
7
7
|
|
|
8
8
|
var name = "@alextheman/eslint-plugin";
|
|
9
|
-
var version = "4.0.
|
|
9
|
+
var version = "4.0.1";
|
|
10
10
|
|
|
11
11
|
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;
|
|
12
12
|
|
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 = "4.0.
|
|
3747
|
+
var version = "4.0.1";
|
|
3748
3748
|
|
|
3749
3749
|
// src/configs/personal/testsBase.ts
|
|
3750
3750
|
var import_globals = __toESM(require_globals2(), 1);
|
|
@@ -4955,20 +4955,8 @@ var standardiseErrorMessages = createRule_default({
|
|
|
4955
4955
|
var standardise_error_messages_default = standardiseErrorMessages;
|
|
4956
4956
|
|
|
4957
4957
|
// src/rules/use-normalized-imports.ts
|
|
4958
|
+
import { normalizeImportPath } from "@alextheman/utility";
|
|
4958
4959
|
import z6 from "zod";
|
|
4959
|
-
|
|
4960
|
-
// src/utility/normalizeImportPath.ts
|
|
4961
|
-
import path from "path";
|
|
4962
|
-
function normalizeImportPath(importPath) {
|
|
4963
|
-
const normalizedPath = path.posix.normalize(importPath);
|
|
4964
|
-
if (importPath.startsWith("./") && !normalizedPath.startsWith("./")) {
|
|
4965
|
-
return `./${normalizedPath}`;
|
|
4966
|
-
}
|
|
4967
|
-
return normalizedPath;
|
|
4968
|
-
}
|
|
4969
|
-
var normalizeImportPath_default = normalizeImportPath;
|
|
4970
|
-
|
|
4971
|
-
// src/rules/use-normalized-imports.ts
|
|
4972
4960
|
var useNormalizedImportsOptionsSchema = z6.object({
|
|
4973
4961
|
fixable: z6.boolean()
|
|
4974
4962
|
}).partial();
|
|
@@ -4980,7 +4968,7 @@ var useNormalizedImports = createRule_default({
|
|
|
4980
4968
|
name: "use-normalized-imports",
|
|
4981
4969
|
meta: {
|
|
4982
4970
|
docs: {
|
|
4983
|
-
description: "Enforce the usage of
|
|
4971
|
+
description: "Enforce the usage of normalized imports (i.e. import paths that you would only get from path.posix.normalize())"
|
|
4984
4972
|
},
|
|
4985
4973
|
messages: {
|
|
4986
4974
|
pathNotNormalized: "Import path {{nonNormalized}} is not normalised. Please use {{normalized}} instead."
|
|
@@ -4997,7 +4985,7 @@ var useNormalizedImports = createRule_default({
|
|
|
4997
4985
|
);
|
|
4998
4986
|
return {
|
|
4999
4987
|
ImportDeclaration(node) {
|
|
5000
|
-
const normalizedPath =
|
|
4988
|
+
const normalizedPath = normalizeImportPath(node.source.value);
|
|
5001
4989
|
if (node.source.value !== normalizedPath) {
|
|
5002
4990
|
return context.report({
|
|
5003
4991
|
node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"update-peer-dependencies": "bash -c 'npx npm-check-updates --dep peer -u \"$@\" && npm install' --"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@alextheman/utility": "^2.
|
|
43
|
+
"@alextheman/utility": "^2.20.0",
|
|
44
44
|
"@typescript-eslint/utils": "^8.47.0",
|
|
45
45
|
"common-tags": "^1.8.2",
|
|
46
46
|
"zod": "^4.1.12"
|