@fluid-topics/ft-eslint 1.3.4 → 1.3.5
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/default-config.d.ts +1 -0
- package/build/default-config.js +33 -0
- package/build/external-rules.d.ts +2 -0
- package/build/external-rules.js +24 -0
- package/build/plugin.d.ts +14 -2
- package/build/plugin.js +17 -6
- package/build/rules/quoted-attributes.js +4 -4
- package/build/rules/typography-variant.js +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultConfig: {}[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import { configs as litConfigs } from "eslint-plugin-lit";
|
|
3
|
+
import { configs as wcConfigs } from "eslint-plugin-wc";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
6
|
+
import ft from "./plugin";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
import { externalRules } from "./external-rules";
|
|
9
|
+
export const defaultConfig = [
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
litConfigs["flat/recommended"],
|
|
12
|
+
wcConfigs["flat/recommended"],
|
|
13
|
+
tseslint.configs.recommended,
|
|
14
|
+
stylistic.configs.customize({
|
|
15
|
+
indent: 4,
|
|
16
|
+
quotes: "double",
|
|
17
|
+
jsx: false,
|
|
18
|
+
braceStyle: "1tbs",
|
|
19
|
+
}),
|
|
20
|
+
ft.configs.recommended,
|
|
21
|
+
{
|
|
22
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
|
|
23
|
+
languageOptions: {
|
|
24
|
+
globals: globals.browser,
|
|
25
|
+
},
|
|
26
|
+
rules: externalRules,
|
|
27
|
+
settings: {
|
|
28
|
+
lit: {
|
|
29
|
+
elementBaseClasses: ["FtLitElement", "FtLitElementRedux"],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const externalRules = {
|
|
2
|
+
"lit/no-property-change-update": ["warn"],
|
|
3
|
+
"lit/lifecycle-super": ["error"],
|
|
4
|
+
"@stylistic/comma-dangle": [
|
|
5
|
+
"error",
|
|
6
|
+
{
|
|
7
|
+
arrays: "always-multiline",
|
|
8
|
+
objects: "always-multiline",
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
"@stylistic/array-bracket-spacing": ["error", "always"],
|
|
12
|
+
"@stylistic/template-curly-spacing": ["error", "always"],
|
|
13
|
+
"@stylistic/arrow-parens": ["error", "as-needed"],
|
|
14
|
+
"@stylistic/indent": ["off"],
|
|
15
|
+
"@stylistic/multiline-ternary": ["off"],
|
|
16
|
+
"@stylistic/indent-binary-ops": ["off"],
|
|
17
|
+
"@stylistic/no-trailing-spaces": ["off"],
|
|
18
|
+
"@typescript-eslint/no-unused-vars": [
|
|
19
|
+
"error",
|
|
20
|
+
{
|
|
21
|
+
destructuredArrayIgnorePattern: "^_",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
package/build/plugin.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const plugin: {
|
|
2
|
+
meta: {
|
|
3
|
+
name: string;
|
|
4
|
+
namespace: string;
|
|
5
|
+
};
|
|
6
|
+
rules: {
|
|
7
|
+
"quoted-attributes": import("eslint").Rule.RuleModule;
|
|
8
|
+
"typography-variant": import("eslint").Rule.RuleModule;
|
|
9
|
+
"interface-no-commas": import("eslint").Rule.RuleModule;
|
|
10
|
+
};
|
|
11
|
+
configs: {
|
|
12
|
+
recommended: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
3
15
|
export default plugin;
|
package/build/plugin.js
CHANGED
|
@@ -2,19 +2,30 @@ import { quotedAttributesRule } from "./rules/quoted-attributes";
|
|
|
2
2
|
import { typographyVariantRule } from "./rules/typography-variant";
|
|
3
3
|
import { interfaceNoCommaRule } from "./rules/interface-no-commas";
|
|
4
4
|
const plugin = {
|
|
5
|
+
meta: {
|
|
6
|
+
name: "eslint-plugin-fluid-topics",
|
|
7
|
+
namespace: "ft",
|
|
8
|
+
},
|
|
5
9
|
rules: {
|
|
6
10
|
"quoted-attributes": quotedAttributesRule,
|
|
7
11
|
"typography-variant": typographyVariantRule,
|
|
8
12
|
"interface-no-commas": interfaceNoCommaRule,
|
|
9
13
|
},
|
|
10
14
|
configs: {
|
|
11
|
-
recommended: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
recommended: {},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const flatConfigs = {
|
|
19
|
+
recommended: {
|
|
20
|
+
plugins: {
|
|
21
|
+
ft: plugin,
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
"ft/quoted-attributes": "error",
|
|
25
|
+
"ft/typography-variant": "warn",
|
|
26
|
+
"ft/interface-no-commas": "error",
|
|
17
27
|
},
|
|
18
28
|
},
|
|
19
29
|
};
|
|
30
|
+
Object.assign(plugin.configs, flatConfigs);
|
|
20
31
|
export default plugin;
|
|
@@ -8,10 +8,10 @@ export const quotedAttributesRule = {
|
|
|
8
8
|
fixable: "code",
|
|
9
9
|
schema: [],
|
|
10
10
|
messages: {
|
|
11
|
-
alwaysQuote: "Attributes must be quoted inside templates "
|
|
12
|
-
" (e.g. `foo=\"${bar}\"`)",
|
|
13
|
-
neverQuote: "Properties, events and booleans must not be quoted inside templates "
|
|
14
|
-
" (e.g. `.foo=${bar}`)",
|
|
11
|
+
alwaysQuote: "Attributes must be quoted inside templates "
|
|
12
|
+
+ " (e.g. `foo=\"${bar}\"`)",
|
|
13
|
+
neverQuote: "Properties, events and booleans must not be quoted inside templates "
|
|
14
|
+
+ " (e.g. `.foo=${bar}`)",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
create(context) {
|
|
@@ -9,8 +9,8 @@ export const typographyVariantRule = {
|
|
|
9
9
|
schema: [],
|
|
10
10
|
messages: {
|
|
11
11
|
mandatoryVariant: "<ft-typography> must have a variant attribute",
|
|
12
|
-
variantUsesEnum: "variant attribute must use an enum value "
|
|
13
|
-
" (e.g. `variant=\"${ FtTypographyVariants.title1 }\"`)",
|
|
12
|
+
variantUsesEnum: "variant attribute must use an enum value "
|
|
13
|
+
+ " (e.g. `variant=\"${ FtTypographyVariants.title1 }\"`)",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
create(context) {
|
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.5",
|
|
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": "87377b99617257593de238b08c41d2638617f501"
|
|
25
25
|
}
|