@alextheman/eslint-plugin 1.0.14 → 1.0.16
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 +13 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -8
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
37
|
|
|
38
38
|
// package.json
|
|
39
39
|
var name = "@alextheman/eslint-plugin";
|
|
40
|
-
var version = "1.0.
|
|
40
|
+
var version = "1.0.16";
|
|
41
41
|
|
|
42
42
|
// create-rule.ts
|
|
43
43
|
var import_utils = require("@typescript-eslint/utils");
|
|
@@ -105,7 +105,8 @@ var noRelativeImports = create_rule_default({
|
|
|
105
105
|
meta: {
|
|
106
106
|
docs: { description: "Forbid the use of relative imports" },
|
|
107
107
|
messages: {
|
|
108
|
-
message:
|
|
108
|
+
message: 'Relative import from "{{source}}" is not allowed.',
|
|
109
|
+
stupidPath: 'Who the hell imports from "{{source}}"?! Know your own project directory, Goddamnit!'
|
|
109
110
|
},
|
|
110
111
|
type: "suggestion",
|
|
111
112
|
fixable: "code",
|
|
@@ -116,6 +117,16 @@ var noRelativeImports = create_rule_default({
|
|
|
116
117
|
return {
|
|
117
118
|
ImportDeclaration(node) {
|
|
118
119
|
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
120
|
+
if (!node.source.value.startsWith("./") && !node.source.value.startsWith("../")) {
|
|
121
|
+
context.report({
|
|
122
|
+
node,
|
|
123
|
+
messageId: "stupidPath",
|
|
124
|
+
data: {
|
|
125
|
+
source: node.source.value
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
119
130
|
context.report({
|
|
120
131
|
node,
|
|
121
132
|
messageId: "message",
|
|
@@ -126,12 +137,6 @@ var noRelativeImports = create_rule_default({
|
|
|
126
137
|
if (!context.parserOptions.tsconfigRootDir) {
|
|
127
138
|
return null;
|
|
128
139
|
}
|
|
129
|
-
if (!node.source.value.startsWith("./") && !node.source.value.startsWith("../")) {
|
|
130
|
-
console.warn(
|
|
131
|
-
`Who the hell imports from ${node.source.value}?! Know your own project directory, Goddamnit!`
|
|
132
|
-
);
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
140
|
const fullImportPath = import_path.default.resolve(
|
|
136
141
|
import_path.default.dirname(context.physicalFilename),
|
|
137
142
|
node.source.value
|
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
"no-namespace-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [{
|
|
5
5
|
allow: string[];
|
|
6
6
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
7
|
-
"no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
7
|
+
"no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message" | "stupidPath", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
declare const meta: {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
"no-namespace-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [{
|
|
5
5
|
allow: string[];
|
|
6
6
|
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
7
|
-
"no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
7
|
+
"no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message" | "stupidPath", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
declare const meta: {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@alextheman/eslint-plugin";
|
|
3
|
-
var version = "1.0.
|
|
3
|
+
var version = "1.0.16";
|
|
4
4
|
|
|
5
5
|
// create-rule.ts
|
|
6
6
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
@@ -68,7 +68,8 @@ var noRelativeImports = create_rule_default({
|
|
|
68
68
|
meta: {
|
|
69
69
|
docs: { description: "Forbid the use of relative imports" },
|
|
70
70
|
messages: {
|
|
71
|
-
message:
|
|
71
|
+
message: 'Relative import from "{{source}}" is not allowed.',
|
|
72
|
+
stupidPath: 'Who the hell imports from "{{source}}"?! Know your own project directory, Goddamnit!'
|
|
72
73
|
},
|
|
73
74
|
type: "suggestion",
|
|
74
75
|
fixable: "code",
|
|
@@ -79,6 +80,16 @@ var noRelativeImports = create_rule_default({
|
|
|
79
80
|
return {
|
|
80
81
|
ImportDeclaration(node) {
|
|
81
82
|
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
83
|
+
if (!node.source.value.startsWith("./") && !node.source.value.startsWith("../")) {
|
|
84
|
+
context.report({
|
|
85
|
+
node,
|
|
86
|
+
messageId: "stupidPath",
|
|
87
|
+
data: {
|
|
88
|
+
source: node.source.value
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
82
93
|
context.report({
|
|
83
94
|
node,
|
|
84
95
|
messageId: "message",
|
|
@@ -89,12 +100,6 @@ var noRelativeImports = create_rule_default({
|
|
|
89
100
|
if (!context.parserOptions.tsconfigRootDir) {
|
|
90
101
|
return null;
|
|
91
102
|
}
|
|
92
|
-
if (!node.source.value.startsWith("./") && !node.source.value.startsWith("../")) {
|
|
93
|
-
console.warn(
|
|
94
|
-
`Who the hell imports from ${node.source.value}?! Know your own project directory, Goddamnit!`
|
|
95
|
-
);
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
103
|
const fullImportPath = path.resolve(
|
|
99
104
|
path.dirname(context.physicalFilename),
|
|
100
105
|
node.source.value
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"eslint-plugin-import": "^2.32.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@alextheman/eslint-config-typescript-base": "^1.0.9",
|
|
34
33
|
"@types/eslint": "^9.6.1",
|
|
35
34
|
"@types/jest": "^30.0.0",
|
|
36
35
|
"@types/node": "^24.0.13",
|
|
@@ -38,8 +37,10 @@
|
|
|
38
37
|
"@typescript-eslint/utils": "^8.37.0",
|
|
39
38
|
"eslint": "^9.31.0",
|
|
40
39
|
"eslint-plugin-eslint-plugin": "^6.5.0",
|
|
40
|
+
"globals": "^16.3.0",
|
|
41
41
|
"husky": "^9.1.7",
|
|
42
42
|
"jest": "^30.0.4",
|
|
43
|
+
"prettier": "^3.6.2",
|
|
43
44
|
"ts-jest": "^29.4.0",
|
|
44
45
|
"tsup": "^8.5.0",
|
|
45
46
|
"typescript": "^5.8.3"
|