New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@html-eslint/eslint-plugin

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@html-eslint/eslint-plugin - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

lib/rules/no-extra-spacing-attrs.js

2

lib/configs/recommended.js

@@ -7,3 +7,5 @@ module.exports = {

"@html-eslint/require-title": "error",
"@html-eslint/no-multiple-h1": "error",
"@html-eslint/no-extra-spacing-attrs": "error",
},
};

@@ -7,2 +7,4 @@ const requireLang = require("./require-lang");

const noInlineStyles = require("./no-inline-styles");
const noMultipleH1 = require("./no-multiple-h1");
const noExtraSpacingAttrs = require("./no-extra-spacing-attrs");

@@ -16,2 +18,4 @@ module.exports = {

"no-inline-styles": noInlineStyles,
"no-multiple-h1": noMultipleH1,
"no-extra-spacing-attrs": noExtraSpacingAttrs,
};

9

lib/rules/no-duplicate-id.js

@@ -9,2 +9,3 @@ /**

const CATEGORY = require("../constants/rule-category");
const utils = require("./utils");

@@ -20,3 +21,3 @@ const MESSAGE_IDS = {

docs: {
description: "require `<!DOCTYPE HTML>` in html,",
description: "Disallow to use duplicate id",
category: CATEGORY.BEST_PRACTICE,

@@ -26,6 +27,6 @@ recommended: true,

fixable: true,
fixable: null,
schema: [],
messages: {
[MESSAGE_IDS.DUPLICATE_ID]: "missing `<!DOCTYPE HTML>`",
[MESSAGE_IDS.DUPLICATE_ID]: "Unexpected duplicate id",
},

@@ -38,3 +39,3 @@ },

"*"(node) {
const idAttr = (node.attrs || []).find((attr) => attr.name === "id");
const idAttr = utils.findAttr(node, "id");
if (idAttr) {

@@ -41,0 +42,0 @@ if (!IdNodesMap.has(idAttr.value)) {

@@ -9,2 +9,3 @@ /**

const CATEGORY = require("../constants/rule-category");
const utils = require("./utils");

@@ -20,3 +21,3 @@ const MESSAGE_IDS = {

docs: {
description: "disallow using inline style",
description: "Disallow using inline style",
category: CATEGORY.BEST_PRACTICE,

@@ -26,3 +27,3 @@ recommended: false,

fixable: true,
fixable: null,
schema: [],

@@ -37,7 +38,3 @@ messages: {

"*"(node) {
if (
(node.attrs || []).some((attr) => {
return attr.name === "style";
})
) {
if (utils.hasAttr(node, "style")) {
context.report({

@@ -44,0 +41,0 @@ node: node.startTag,

@@ -19,3 +19,3 @@ /**

docs: {
description: "require `<!DOCTYPE HTML>` in html,",
description: "Require `<!DOCTYPE HTML>` in html,",
category: CATEGORY.BEST_PRACTICE,

@@ -28,3 +28,3 @@ recommended: true,

messages: {
[MESSAGE_IDS.MISSING_DOCTYPE]: "missing `<!DOCTYPE HTML>`",
[MESSAGE_IDS.MISSING_DOCTYPE]: "Missing `<!DOCTYPE HTML>`",
},

@@ -31,0 +31,0 @@ },

@@ -19,3 +19,3 @@ /**

docs: {
description: "require `alt` attribute at `<img>` tag",
description: "Require `alt` attribute at `<img>` tag",
category: CATEGORY.ACCESSIBILITY,

@@ -28,3 +28,3 @@ recommended: true,

messages: {
[MESSAGE_IDS.MISSING_ALT]: "missing `alt` attribute at `<img>` tag",
[MESSAGE_IDS.MISSING_ALT]: "Missing `alt` attribute at `<img>` tag",
},

@@ -31,0 +31,0 @@ },

@@ -10,2 +10,3 @@ /**

const IOS_639_1 = require("../constants/iso_639_1");
const utils = require("./utils");

@@ -22,3 +23,3 @@ const MESSAGE_IDS = {

docs: {
description: "require `lang` attribute at `<html>` tag",
description: "Require `lang` attribute at `<html>` tag",
category: CATEGORY.SEO,

@@ -31,4 +32,4 @@ recommended: true,

messages: {
[MESSAGE_IDS.MISSING_LANG]: "missing `lang` attribute at `<html>` tag",
[MESSAGE_IDS.INVALID_LANG]: "invalid value of `lang` attribute",
[MESSAGE_IDS.MISSING_LANG]: "Missing `lang` attribute at `<html>` tag",
[MESSAGE_IDS.INVALID_LANG]: "Invalid value of `lang` attribute",
},

@@ -40,4 +41,3 @@ },

Html(node) {
const attrs = node.attrs || [];
const langAttr = attrs.find(isLangAttribute);
const langAttr = utils.findAttr(node, "lang");
if (!langAttr) {

@@ -58,5 +58,1 @@ context.report({

};
function isLangAttribute(attr) {
return attr.name === "lang";
}

@@ -20,3 +20,3 @@ /**

docs: {
description: "require `<title><title/>` in the `<head><head/>`",
description: "Require `<title><title/>` in the `<head><head/>`",
category: CATEGORY.SEO,

@@ -30,4 +30,4 @@ recommended: true,

[MESSAGE_IDS.MISSING_TITLE]:
"missing `<title><title/>` in the `<head><head/>`",
[MESSAGE_IDS.EMPTY_TITLE]: "empty text in `<title><title/>`",
"Missing `<title><title/>` in the `<head><head/>`",
[MESSAGE_IDS.EMPTY_TITLE]: "Unexpected empty text in `<title><title/>`",
},

@@ -34,0 +34,0 @@ },

@@ -5,2 +5,3 @@ export type RuleCategory = {

ACCESSIBILITY: "Accessibility";
STYLE: "Style";
};
{
"name": "@html-eslint/eslint-plugin",
"version": "0.1.2",
"version": "0.2.0",
"description": "ESLint plugin for html",

@@ -30,5 +30,5 @@ "author": "yeonjuan",

"devDependencies": {
"@html-eslint/parser": "^0.1.0"
"@html-eslint/parser": "^0.2.0"
},
"gitHead": "f97a0c0e2d461922ecfd21acd2368b20e9fd11a2"
"gitHead": "1bac029775d06cac9f8f4a3c1d606295ef13913d"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc