@superdispatch/eslint-plugin-ui 0.21.8 → 0.21.14
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/.turbo/turbo-version.log +2 -2
- package/package.json +3 -3
- package/pkg/.tsbuildinfo +1 -1
- package/pkg/index.d.ts +13 -13
- package/pkg/index.js +18 -18
- package/pkg/rules/no-color-literals.d.ts +6 -6
- package/pkg/rules/no-color-literals.js +82 -82
- package/pkg/rules/no-restricted-modules.d.ts +6 -6
- package/pkg/rules/no-restricted-modules.js +75 -75
- package/pkg/utils/createRule.d.ts +2 -2
- package/pkg/utils/createRule.js +5 -5
package/pkg/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const rules: {
|
|
2
|
-
readonly 'no-color-literals': import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"suggestColor", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
3
|
-
readonly 'no-restricted-modules': import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"restrict", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
4
|
-
};
|
|
5
|
-
export declare const configs: {
|
|
6
|
-
readonly recommended: {
|
|
7
|
-
readonly plugins: readonly ["@superdispatch/ui"];
|
|
8
|
-
readonly rules: {
|
|
9
|
-
readonly '@superdispatch/ui/no-color-literals': readonly ["error"];
|
|
10
|
-
readonly '@superdispatch/ui/no-restricted-modules': readonly ["error"];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
1
|
+
export declare const rules: {
|
|
2
|
+
readonly 'no-color-literals': import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"suggestColor", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
3
|
+
readonly 'no-restricted-modules': import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"restrict", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
4
|
+
};
|
|
5
|
+
export declare const configs: {
|
|
6
|
+
readonly recommended: {
|
|
7
|
+
readonly plugins: readonly ["@superdispatch/ui"];
|
|
8
|
+
readonly rules: {
|
|
9
|
+
readonly '@superdispatch/ui/no-color-literals': readonly ["error"];
|
|
10
|
+
readonly '@superdispatch/ui/no-restricted-modules': readonly ["error"];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
package/pkg/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configs = exports.rules = void 0;
|
|
4
|
-
const no_color_literals_1 = require("./rules/no-color-literals");
|
|
5
|
-
const no_restricted_modules_1 = require("./rules/no-restricted-modules");
|
|
6
|
-
exports.rules = {
|
|
7
|
-
'no-color-literals': no_color_literals_1.rule,
|
|
8
|
-
'no-restricted-modules': no_restricted_modules_1.rule,
|
|
9
|
-
};
|
|
10
|
-
exports.configs = {
|
|
11
|
-
recommended: {
|
|
12
|
-
plugins: ['@superdispatch/ui'],
|
|
13
|
-
rules: {
|
|
14
|
-
'@superdispatch/ui/no-color-literals': ['error'],
|
|
15
|
-
'@superdispatch/ui/no-restricted-modules': ['error'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configs = exports.rules = void 0;
|
|
4
|
+
const no_color_literals_1 = require("./rules/no-color-literals");
|
|
5
|
+
const no_restricted_modules_1 = require("./rules/no-restricted-modules");
|
|
6
|
+
exports.rules = {
|
|
7
|
+
'no-color-literals': no_color_literals_1.rule,
|
|
8
|
+
'no-restricted-modules': no_restricted_modules_1.rule,
|
|
9
|
+
};
|
|
10
|
+
exports.configs = {
|
|
11
|
+
recommended: {
|
|
12
|
+
plugins: ['@superdispatch/ui'],
|
|
13
|
+
rules: {
|
|
14
|
+
'@superdispatch/ui/no-color-literals': ['error'],
|
|
15
|
+
'@superdispatch/ui/no-restricted-modules': ['error'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
readonly suggestColor: "Use `Color.{{name}}` from \"@superdispatch/ui\"";
|
|
3
|
-
};
|
|
4
|
-
export declare type MessageIds = keyof typeof messages;
|
|
5
|
-
export declare const rule: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"suggestColor", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
6
|
-
export {};
|
|
1
|
+
declare const messages: {
|
|
2
|
+
readonly suggestColor: "Use `Color.{{name}}` from \"@superdispatch/ui\"";
|
|
3
|
+
};
|
|
4
|
+
export declare type MessageIds = keyof typeof messages;
|
|
5
|
+
export declare const rule: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"suggestColor", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
6
|
+
export {};
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rule = void 0;
|
|
4
|
-
const ui_1 = require("@superdispatch/ui");
|
|
5
|
-
const createRule_1 = require("../utils/createRule");
|
|
6
|
-
//
|
|
7
|
-
// Utils
|
|
8
|
-
//
|
|
9
|
-
function normalizeHex(hex) {
|
|
10
|
-
hex = hex.toLowerCase();
|
|
11
|
-
// #ffffff -> #fff
|
|
12
|
-
if (new Set(hex).size === 2) {
|
|
13
|
-
hex = hex.charAt(0) + hex.charAt(1).repeat(3);
|
|
14
|
-
}
|
|
15
|
-
return hex;
|
|
16
|
-
}
|
|
17
|
-
const COLOR_KEY_CACHE = new Map();
|
|
18
|
-
function findColorName(color) {
|
|
19
|
-
if (COLOR_KEY_CACHE.size === 0) {
|
|
20
|
-
for (const [key, hex] of Object.entries(ui_1.Color)) {
|
|
21
|
-
COLOR_KEY_CACHE.set(normalizeHex(hex), key);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return COLOR_KEY_CACHE.get(color);
|
|
25
|
-
}
|
|
26
|
-
const HEX_COLOR_PATTERN = /(#\b([a-f0-9]{3}|[a-f0-9]{6})\b)/gim;
|
|
27
|
-
function* listColorNames(text) {
|
|
28
|
-
for (const [, hex] of text.matchAll(HEX_COLOR_PATTERN)) {
|
|
29
|
-
if (hex) {
|
|
30
|
-
const color = normalizeHex(hex);
|
|
31
|
-
const name = findColorName(color);
|
|
32
|
-
if (name)
|
|
33
|
-
yield name;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//
|
|
38
|
-
// Rule
|
|
39
|
-
//
|
|
40
|
-
const messages = {
|
|
41
|
-
suggestColor: 'Use `Color.{{name}}` from "@superdispatch/ui"',
|
|
42
|
-
};
|
|
43
|
-
exports.rule = (0, createRule_1.createRule)({
|
|
44
|
-
name: 'no-restricted-modules',
|
|
45
|
-
defaultOptions: [],
|
|
46
|
-
meta: {
|
|
47
|
-
messages,
|
|
48
|
-
type: 'problem',
|
|
49
|
-
fixable: 'code',
|
|
50
|
-
docs: {
|
|
51
|
-
recommended: 'error',
|
|
52
|
-
description: 'Disallows to use Material UI modules',
|
|
53
|
-
},
|
|
54
|
-
schema: [],
|
|
55
|
-
},
|
|
56
|
-
create(context) {
|
|
57
|
-
return {
|
|
58
|
-
Literal(node) {
|
|
59
|
-
if (typeof node.value == 'string') {
|
|
60
|
-
for (const name of listColorNames(node.value)) {
|
|
61
|
-
context.report({
|
|
62
|
-
node,
|
|
63
|
-
data: { name },
|
|
64
|
-
messageId: 'suggestColor',
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
TemplateLiteral(node) {
|
|
70
|
-
for (const quasi of node.quasis) {
|
|
71
|
-
for (const name of listColorNames(quasi.value.raw)) {
|
|
72
|
-
context.report({
|
|
73
|
-
node,
|
|
74
|
-
data: { name },
|
|
75
|
-
messageId: 'suggestColor',
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
},
|
|
82
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rule = void 0;
|
|
4
|
+
const ui_1 = require("@superdispatch/ui");
|
|
5
|
+
const createRule_1 = require("../utils/createRule");
|
|
6
|
+
//
|
|
7
|
+
// Utils
|
|
8
|
+
//
|
|
9
|
+
function normalizeHex(hex) {
|
|
10
|
+
hex = hex.toLowerCase();
|
|
11
|
+
// #ffffff -> #fff
|
|
12
|
+
if (new Set(hex).size === 2) {
|
|
13
|
+
hex = hex.charAt(0) + hex.charAt(1).repeat(3);
|
|
14
|
+
}
|
|
15
|
+
return hex;
|
|
16
|
+
}
|
|
17
|
+
const COLOR_KEY_CACHE = new Map();
|
|
18
|
+
function findColorName(color) {
|
|
19
|
+
if (COLOR_KEY_CACHE.size === 0) {
|
|
20
|
+
for (const [key, hex] of Object.entries(ui_1.Color)) {
|
|
21
|
+
COLOR_KEY_CACHE.set(normalizeHex(hex), key);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return COLOR_KEY_CACHE.get(color);
|
|
25
|
+
}
|
|
26
|
+
const HEX_COLOR_PATTERN = /(#\b([a-f0-9]{3}|[a-f0-9]{6})\b)/gim;
|
|
27
|
+
function* listColorNames(text) {
|
|
28
|
+
for (const [, hex] of text.matchAll(HEX_COLOR_PATTERN)) {
|
|
29
|
+
if (hex) {
|
|
30
|
+
const color = normalizeHex(hex);
|
|
31
|
+
const name = findColorName(color);
|
|
32
|
+
if (name)
|
|
33
|
+
yield name;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//
|
|
38
|
+
// Rule
|
|
39
|
+
//
|
|
40
|
+
const messages = {
|
|
41
|
+
suggestColor: 'Use `Color.{{name}}` from "@superdispatch/ui"',
|
|
42
|
+
};
|
|
43
|
+
exports.rule = (0, createRule_1.createRule)({
|
|
44
|
+
name: 'no-restricted-modules',
|
|
45
|
+
defaultOptions: [],
|
|
46
|
+
meta: {
|
|
47
|
+
messages,
|
|
48
|
+
type: 'problem',
|
|
49
|
+
fixable: 'code',
|
|
50
|
+
docs: {
|
|
51
|
+
recommended: 'error',
|
|
52
|
+
description: 'Disallows to use Material UI modules',
|
|
53
|
+
},
|
|
54
|
+
schema: [],
|
|
55
|
+
},
|
|
56
|
+
create(context) {
|
|
57
|
+
return {
|
|
58
|
+
Literal(node) {
|
|
59
|
+
if (typeof node.value == 'string') {
|
|
60
|
+
for (const name of listColorNames(node.value)) {
|
|
61
|
+
context.report({
|
|
62
|
+
node,
|
|
63
|
+
data: { name },
|
|
64
|
+
messageId: 'suggestColor',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
TemplateLiteral(node) {
|
|
70
|
+
for (const quasi of node.quasis) {
|
|
71
|
+
for (const name of listColorNames(quasi.value.raw)) {
|
|
72
|
+
context.report({
|
|
73
|
+
node,
|
|
74
|
+
data: { name },
|
|
75
|
+
messageId: 'suggestColor',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
readonly restrict: "Usage of `{{restrictedName}}` from `{{restrictedModule}}` is restricted, use `{{suggestedName}}` from the `{{suggestedModule}}`";
|
|
3
|
-
};
|
|
4
|
-
export declare type MessageIds = keyof typeof messages;
|
|
5
|
-
export declare const rule: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"restrict", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
6
|
-
export {};
|
|
1
|
+
declare const messages: {
|
|
2
|
+
readonly restrict: "Usage of `{{restrictedName}}` from `{{restrictedModule}}` is restricted, use `{{suggestedName}}` from the `{{suggestedModule}}`";
|
|
3
|
+
};
|
|
4
|
+
export declare type MessageIds = keyof typeof messages;
|
|
5
|
+
export declare const rule: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"restrict", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
6
|
+
export {};
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rule = void 0;
|
|
4
|
-
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
|
5
|
-
const createRule_1 = require("../utils/createRule");
|
|
6
|
-
const messages = {
|
|
7
|
-
restrict: 'Usage of `{{restrictedName}}` from `{{restrictedModule}}` is restricted, use `{{suggestedName}}` from the `{{suggestedModule}}`',
|
|
8
|
-
};
|
|
9
|
-
const RESTRICTIONS = {
|
|
10
|
-
'@material-ui/lab': {
|
|
11
|
-
Alert: ['Alert', '@superdispatch/ui-lab'],
|
|
12
|
-
},
|
|
13
|
-
'@material-ui/core': {
|
|
14
|
-
Grid: ['Columns', '@superdispatch/ui-lab'],
|
|
15
|
-
Box: ['Box', '@superdispatch/ui-lab'],
|
|
16
|
-
Button: ['Button', '@superdispatch/ui-lab'],
|
|
17
|
-
Snackbar: ['Snackbar', '@superdispatch/ui'],
|
|
18
|
-
SnackbarContent: ['SnackbarContent', '@superdispatch/ui'],
|
|
19
|
-
},
|
|
20
|
-
'@superdispatch/ui': {
|
|
21
|
-
Button: ['Button', '@superdispatch/ui-lab'],
|
|
22
|
-
GridStack: ['Stack', '@superdispatch/ui'],
|
|
23
|
-
InlineGrid: ['Inline', '@superdispatch/ui'],
|
|
24
|
-
DescriptionList: ['Stack', '@superdispatch/ui-lab'],
|
|
25
|
-
DescriptionListItem: ['DescriptionItem', '@superdispatch/ui-lab'],
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
exports.rule = (0, createRule_1.createRule)({
|
|
29
|
-
name: 'no-restricted-modules',
|
|
30
|
-
defaultOptions: [],
|
|
31
|
-
meta: {
|
|
32
|
-
messages,
|
|
33
|
-
type: 'problem',
|
|
34
|
-
fixable: 'code',
|
|
35
|
-
docs: {
|
|
36
|
-
recommended: 'error',
|
|
37
|
-
description: 'Disallows to use Material UI modules',
|
|
38
|
-
},
|
|
39
|
-
schema: [],
|
|
40
|
-
},
|
|
41
|
-
create(context) {
|
|
42
|
-
return {
|
|
43
|
-
ImportDeclaration(node) {
|
|
44
|
-
const { value: restrictedModule } = node.source;
|
|
45
|
-
if (typeof restrictedModule != 'string')
|
|
46
|
-
return;
|
|
47
|
-
const packageRestrictions = RESTRICTIONS[restrictedModule];
|
|
48
|
-
if (!packageRestrictions)
|
|
49
|
-
return;
|
|
50
|
-
for (const specifier of node.specifiers) {
|
|
51
|
-
if (specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
const restrictedName = specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportDefaultSpecifier
|
|
55
|
-
? 'default'
|
|
56
|
-
: specifier.imported.name;
|
|
57
|
-
const moduleRestrictions = packageRestrictions[restrictedName];
|
|
58
|
-
if (!moduleRestrictions)
|
|
59
|
-
continue;
|
|
60
|
-
const [suggestedName, suggestedModule] = moduleRestrictions;
|
|
61
|
-
context.report({
|
|
62
|
-
node: specifier,
|
|
63
|
-
data: {
|
|
64
|
-
restrictedName,
|
|
65
|
-
restrictedModule,
|
|
66
|
-
suggestedName,
|
|
67
|
-
suggestedModule,
|
|
68
|
-
},
|
|
69
|
-
messageId: 'restrict',
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rule = void 0;
|
|
4
|
+
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
|
5
|
+
const createRule_1 = require("../utils/createRule");
|
|
6
|
+
const messages = {
|
|
7
|
+
restrict: 'Usage of `{{restrictedName}}` from `{{restrictedModule}}` is restricted, use `{{suggestedName}}` from the `{{suggestedModule}}`',
|
|
8
|
+
};
|
|
9
|
+
const RESTRICTIONS = {
|
|
10
|
+
'@material-ui/lab': {
|
|
11
|
+
Alert: ['Alert', '@superdispatch/ui-lab'],
|
|
12
|
+
},
|
|
13
|
+
'@material-ui/core': {
|
|
14
|
+
Grid: ['Columns', '@superdispatch/ui-lab'],
|
|
15
|
+
Box: ['Box', '@superdispatch/ui-lab'],
|
|
16
|
+
Button: ['Button', '@superdispatch/ui-lab'],
|
|
17
|
+
Snackbar: ['Snackbar', '@superdispatch/ui'],
|
|
18
|
+
SnackbarContent: ['SnackbarContent', '@superdispatch/ui'],
|
|
19
|
+
},
|
|
20
|
+
'@superdispatch/ui': {
|
|
21
|
+
Button: ['Button', '@superdispatch/ui-lab'],
|
|
22
|
+
GridStack: ['Stack', '@superdispatch/ui'],
|
|
23
|
+
InlineGrid: ['Inline', '@superdispatch/ui'],
|
|
24
|
+
DescriptionList: ['Stack', '@superdispatch/ui-lab'],
|
|
25
|
+
DescriptionListItem: ['DescriptionItem', '@superdispatch/ui-lab'],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
exports.rule = (0, createRule_1.createRule)({
|
|
29
|
+
name: 'no-restricted-modules',
|
|
30
|
+
defaultOptions: [],
|
|
31
|
+
meta: {
|
|
32
|
+
messages,
|
|
33
|
+
type: 'problem',
|
|
34
|
+
fixable: 'code',
|
|
35
|
+
docs: {
|
|
36
|
+
recommended: 'error',
|
|
37
|
+
description: 'Disallows to use Material UI modules',
|
|
38
|
+
},
|
|
39
|
+
schema: [],
|
|
40
|
+
},
|
|
41
|
+
create(context) {
|
|
42
|
+
return {
|
|
43
|
+
ImportDeclaration(node) {
|
|
44
|
+
const { value: restrictedModule } = node.source;
|
|
45
|
+
if (typeof restrictedModule != 'string')
|
|
46
|
+
return;
|
|
47
|
+
const packageRestrictions = RESTRICTIONS[restrictedModule];
|
|
48
|
+
if (!packageRestrictions)
|
|
49
|
+
return;
|
|
50
|
+
for (const specifier of node.specifiers) {
|
|
51
|
+
if (specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const restrictedName = specifier.type === experimental_utils_1.AST_NODE_TYPES.ImportDefaultSpecifier
|
|
55
|
+
? 'default'
|
|
56
|
+
: specifier.imported.name;
|
|
57
|
+
const moduleRestrictions = packageRestrictions[restrictedName];
|
|
58
|
+
if (!moduleRestrictions)
|
|
59
|
+
continue;
|
|
60
|
+
const [suggestedName, suggestedModule] = moduleRestrictions;
|
|
61
|
+
context.report({
|
|
62
|
+
node: specifier,
|
|
63
|
+
data: {
|
|
64
|
+
restrictedName,
|
|
65
|
+
restrictedModule,
|
|
66
|
+
suggestedName,
|
|
67
|
+
suggestedModule,
|
|
68
|
+
},
|
|
69
|
+
messageId: 'restrict',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ESLintUtils } from '@typescript-eslint/experimental-utils';
|
|
2
|
-
export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/experimental-utils';
|
|
2
|
+
export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|
package/pkg/utils/createRule.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRule = void 0;
|
|
4
|
-
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
|
5
|
-
exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator((ruleName) => `https://github.com/superdispatch/web-ui/blob/main/packages/eslint-plugin/src/rules/${ruleName}.ts`);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRule = void 0;
|
|
4
|
+
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
|
5
|
+
exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator((ruleName) => `https://github.com/superdispatch/web-ui/blob/main/packages/eslint-plugin/src/rules/${ruleName}.ts`);
|