Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-50934 webcomponents Improve linting of html templates #13265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ instructors=Instructors in this site
instructors_answer=Instructor's Answer
invalid_lock_date=You've entered an invalid lock or accept until date. Those dates MUST be later than the due date.
late=late
layout1_tooltip=Click to select layout 1 for this dashboardthumbnail_alt=
least_active=Least Active
loading_1=Loading the data ...
loading_2=This may take a few seconds.
Expand Down
4 changes: 4 additions & 0 deletions webcomponents/bundle/src/main/bundle/dashboard.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ option3=Option 3
select=Select
layout=Layout
layout_tooltip=Launch the layout picker
layout1_tooltip=Click to select layout 1 for this dashboard
layout2_tooltip=Click to select layout 2 for this dashboard
layout3_tooltip=Click to select layout 3 for this dashboard
site_image_alt=Site dashboard image
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cancel=Cancel
image_picker_label=Select an image to use
editing_image_alt=Image being currently edited
pan_down=Pan image down
pan_left=Pan image left
pan_right=Pan image right
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ save=Save
cancel=Cancel
remove=Remove
done=Done
editing_image_alt=Image being currently edited
54 changes: 29 additions & 25 deletions webcomponents/tool/src/main/frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
import html from "eslint-plugin-html";
import lit from "eslint-plugin-lit";
import wc from "eslint-plugin-wc";
import html from "@html-eslint/eslint-plugin";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
...compat.extends("eslint:recommended", "plugin:wc/recommended", "plugin:lit/recommended"),
{
plugins: {
html,
lit,
wc,
},

languageOptions: {
globals: {
...globals.browser,
Expand All @@ -46,6 +26,7 @@ export default [
sourceType: "module",
},
rules: {
...js.configs.recommended.rules,
"accessor-pairs": "error",
"array-bracket-spacing": [ "error", "always" ],
"array-callback-return": "error",
Expand Down Expand Up @@ -147,10 +128,33 @@ export default [
"space-infix-ops": "error",
"space-before-blocks": "error",
strict: "error",

yoda: [ "error", "never", {
onlyEquality: true,
} ],
yoda: [ "error", "never", { onlyEquality: true } ],
},
},
{
plugins: {
"@html-eslint": html,
},
rules: {
...html.configs.recommended.rules,
"@html-eslint/require-doctype": "off",
"@html-eslint/require-lang": "off",
"@html-eslint/require-title": "off",
"@html-eslint/indent": "off",
"@html-eslint/quotes": "off",
"@html-eslint/attrs-newline": "off",
"@html-eslint/element-newline": "off",
"@html-eslint/id-naming-convention": [ "warn", "regex", { pattern: "^((?:[a-z0-9]+-?)|(?:-?\\$\\{[^\}]+\\}-?))*$", flags: "y" } ],
"@html-eslint/no-extra-spacing-attrs": "warn",
"@html-eslint/require-img-alt": "error",
"@html-eslint/require-closing-tags": [ "warn", { selfClosing: "always" }],
//"@html-eslint/require-closing-tags": "off",
"@html-eslint/require-input-label": "warn",
"@html-eslint/no-abstract-roles": "error",
"@html-eslint/no-accesskey-attrs": "error",
"@html-eslint/no-heading-inside-button": "error",
"@html-eslint/no-invalid-role": "error",
"@html-eslint/no-positive-tabindex": "error",
},
},
];
Loading
Loading