@fluid-topics/ft-eslint 1.3.14 → 1.3.15
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/build/external-rules.js
CHANGED
|
@@ -6,6 +6,7 @@ export const externalRules = {
|
|
|
6
6
|
{
|
|
7
7
|
arrays: "always-multiline",
|
|
8
8
|
objects: "always-multiline",
|
|
9
|
+
enums: "always-multiline",
|
|
9
10
|
},
|
|
10
11
|
],
|
|
11
12
|
"@stylistic/array-bracket-spacing": ["error", "always"],
|
|
@@ -21,4 +22,5 @@ export const externalRules = {
|
|
|
21
22
|
destructuredArrayIgnorePattern: "^_",
|
|
22
23
|
},
|
|
23
24
|
],
|
|
25
|
+
"@typescript-eslint/no-explicit-any": ["warn"],
|
|
24
26
|
};
|
package/build/plugin.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare const plugin: {
|
|
|
7
7
|
"quoted-attributes": import("eslint").Rule.RuleModule;
|
|
8
8
|
"typography-variant": import("eslint").Rule.RuleModule;
|
|
9
9
|
"interface-no-commas": import("eslint").Rule.RuleModule;
|
|
10
|
+
"number-property": import("eslint").Rule.RuleModule;
|
|
10
11
|
};
|
|
11
12
|
configs: {
|
|
12
13
|
recommended: {};
|
package/build/plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { quotedAttributesRule } from "./rules/quoted-attributes";
|
|
2
2
|
import { typographyVariantRule } from "./rules/typography-variant";
|
|
3
3
|
import { interfaceNoCommaRule } from "./rules/interface-no-commas";
|
|
4
|
+
import { numberPropertyRule } from "./rules/number-property";
|
|
4
5
|
const plugin = {
|
|
5
6
|
meta: {
|
|
6
7
|
name: "eslint-plugin-fluid-topics",
|
|
@@ -10,6 +11,7 @@ const plugin = {
|
|
|
10
11
|
"quoted-attributes": quotedAttributesRule,
|
|
11
12
|
"typography-variant": typographyVariantRule,
|
|
12
13
|
"interface-no-commas": interfaceNoCommaRule,
|
|
14
|
+
"number-property": numberPropertyRule,
|
|
13
15
|
},
|
|
14
16
|
configs: {
|
|
15
17
|
recommended: {},
|
|
@@ -24,6 +26,7 @@ const flatConfigs = {
|
|
|
24
26
|
"ft/quoted-attributes": "error",
|
|
25
27
|
"ft/typography-variant": "warn",
|
|
26
28
|
"ft/interface-no-commas": "error",
|
|
29
|
+
"ft/number-property": "error",
|
|
27
30
|
},
|
|
28
31
|
},
|
|
29
32
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const numberPropertyRule = {
|
|
2
|
+
meta: {
|
|
3
|
+
docs: {
|
|
4
|
+
description: "Enforces that interfaces declarations do not use commas",
|
|
5
|
+
recommended: false,
|
|
6
|
+
},
|
|
7
|
+
fixable: "code",
|
|
8
|
+
hasSuggestions: true,
|
|
9
|
+
schema: [],
|
|
10
|
+
messages: {
|
|
11
|
+
forbiddenNumberProperty: "@property is not allowed on number properties, use @numberProperty instead.",
|
|
12
|
+
replaceNumberProperty: "Replace @property with @numberProperty",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
create(context) {
|
|
16
|
+
return {
|
|
17
|
+
"PropertyDefinition[typeAnnotation.typeAnnotation.type=TSNumberKeyword]": (node) => {
|
|
18
|
+
var _a;
|
|
19
|
+
for (const decorator of (_a = node.decorators) !== null && _a !== void 0 ? _a : []) {
|
|
20
|
+
if (decorator.expression.type !== "CallExpression") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const expression = decorator.expression;
|
|
24
|
+
if (expression.callee.type !== "Identifier") {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const callee = expression.callee;
|
|
28
|
+
if (callee.name === "property") {
|
|
29
|
+
context.report({
|
|
30
|
+
loc: decorator.loc,
|
|
31
|
+
messageId: "forbiddenNumberProperty",
|
|
32
|
+
suggest: [
|
|
33
|
+
{
|
|
34
|
+
messageId: "replaceNumberProperty",
|
|
35
|
+
fix: (fixer) => fixer.replaceTextRange(decorator.range, "@numberProperty()"),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-eslint",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "ESlint rules for web components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lit": "3.1.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "5aa2861244264a93f9ce941c3541191eb22a4650"
|
|
25
25
|
}
|