@alextheman/eslint-plugin 1.0.6 → 1.0.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.cjs +36 -5
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -5
- package/package.json +4 -2
package/dist/index.cjs
CHANGED
|
@@ -27,17 +27,17 @@ module.exports = __toCommonJS(index_exports);
|
|
|
27
27
|
|
|
28
28
|
// package.json
|
|
29
29
|
var name = "@alextheman/eslint-plugin";
|
|
30
|
-
var version = "1.0.
|
|
30
|
+
var version = "1.0.7";
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// create-rule.ts
|
|
33
33
|
var import_utils = require("@typescript-eslint/utils");
|
|
34
34
|
var createRule = import_utils.ESLintUtils.RuleCreator((ruleName) => {
|
|
35
35
|
return `https://github.com/AlexMan123456/eslint-plugin/${ruleName}`;
|
|
36
36
|
});
|
|
37
|
-
var
|
|
37
|
+
var create_rule_default = createRule;
|
|
38
38
|
|
|
39
39
|
// src/rules/no-namespace-imports.ts
|
|
40
|
-
var noNamespaceImports =
|
|
40
|
+
var noNamespaceImports = create_rule_default({
|
|
41
41
|
name: "no-namespace-imports",
|
|
42
42
|
meta: {
|
|
43
43
|
docs: {
|
|
@@ -88,9 +88,40 @@ var noNamespaceImports = createRule_default({
|
|
|
88
88
|
});
|
|
89
89
|
var no_namespace_imports_default = noNamespaceImports;
|
|
90
90
|
|
|
91
|
+
// src/rules/no-relative-imports.ts
|
|
92
|
+
var noRelativeImports = create_rule_default({
|
|
93
|
+
name: "",
|
|
94
|
+
meta: {
|
|
95
|
+
docs: { description: "Forbid the use of relative imports" },
|
|
96
|
+
messages: {
|
|
97
|
+
message: "Relative import from '{{source}}' is not allowed."
|
|
98
|
+
},
|
|
99
|
+
type: "suggestion",
|
|
100
|
+
schema: []
|
|
101
|
+
},
|
|
102
|
+
defaultOptions: [],
|
|
103
|
+
create(context) {
|
|
104
|
+
return {
|
|
105
|
+
ImportDeclaration(node) {
|
|
106
|
+
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
107
|
+
context.report({
|
|
108
|
+
node,
|
|
109
|
+
messageId: "message",
|
|
110
|
+
data: {
|
|
111
|
+
source: node.source.value
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
var no_relative_imports_default = noRelativeImports;
|
|
120
|
+
|
|
91
121
|
// src/rules/index.ts
|
|
92
122
|
var rules_default = {
|
|
93
|
-
"no-namespace-imports": no_namespace_imports_default
|
|
123
|
+
"no-namespace-imports": no_namespace_imports_default,
|
|
124
|
+
"no-relative-imports": no_relative_imports_default
|
|
94
125
|
};
|
|
95
126
|
|
|
96
127
|
// src/index.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +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
8
|
};
|
|
8
9
|
|
|
9
10
|
declare const meta: {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +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
8
|
};
|
|
8
9
|
|
|
9
10
|
declare const meta: {
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "@alextheman/eslint-plugin";
|
|
3
|
-
var version = "1.0.
|
|
3
|
+
var version = "1.0.7";
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// create-rule.ts
|
|
6
6
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
7
7
|
var createRule = ESLintUtils.RuleCreator((ruleName) => {
|
|
8
8
|
return `https://github.com/AlexMan123456/eslint-plugin/${ruleName}`;
|
|
9
9
|
});
|
|
10
|
-
var
|
|
10
|
+
var create_rule_default = createRule;
|
|
11
11
|
|
|
12
12
|
// src/rules/no-namespace-imports.ts
|
|
13
|
-
var noNamespaceImports =
|
|
13
|
+
var noNamespaceImports = create_rule_default({
|
|
14
14
|
name: "no-namespace-imports",
|
|
15
15
|
meta: {
|
|
16
16
|
docs: {
|
|
@@ -61,9 +61,40 @@ var noNamespaceImports = createRule_default({
|
|
|
61
61
|
});
|
|
62
62
|
var no_namespace_imports_default = noNamespaceImports;
|
|
63
63
|
|
|
64
|
+
// src/rules/no-relative-imports.ts
|
|
65
|
+
var noRelativeImports = create_rule_default({
|
|
66
|
+
name: "",
|
|
67
|
+
meta: {
|
|
68
|
+
docs: { description: "Forbid the use of relative imports" },
|
|
69
|
+
messages: {
|
|
70
|
+
message: "Relative import from '{{source}}' is not allowed."
|
|
71
|
+
},
|
|
72
|
+
type: "suggestion",
|
|
73
|
+
schema: []
|
|
74
|
+
},
|
|
75
|
+
defaultOptions: [],
|
|
76
|
+
create(context) {
|
|
77
|
+
return {
|
|
78
|
+
ImportDeclaration(node) {
|
|
79
|
+
if (node.source.value.includes("./") || node.source.value.includes("../")) {
|
|
80
|
+
context.report({
|
|
81
|
+
node,
|
|
82
|
+
messageId: "message",
|
|
83
|
+
data: {
|
|
84
|
+
source: node.source.value
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var no_relative_imports_default = noRelativeImports;
|
|
93
|
+
|
|
64
94
|
// src/rules/index.ts
|
|
65
95
|
var rules_default = {
|
|
66
|
-
"no-namespace-imports": no_namespace_imports_default
|
|
96
|
+
"no-namespace-imports": no_namespace_imports_default,
|
|
97
|
+
"no-relative-imports": no_relative_imports_default
|
|
67
98
|
};
|
|
68
99
|
|
|
69
100
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
8
10
|
"scripts": {
|
|
9
11
|
"test": "jest",
|
|
10
12
|
"format": "prettier --write --parser typescript 'src/**/*.ts' '__tests__/**/*.ts' && ESLINT_MODE=fix eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'",
|