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
71
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.6.5 to 0.7.0

lib/rules/no-non-scalable-viewport.js

1

lib/constants/node-types.js

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

SCRIPT: "Script",
META: "Meta",
};

26

lib/rules/element-newline.js

@@ -0,1 +1,5 @@

/**
* @typedef {import("../types").HTMLNode} HTMLNode
*/
const { RULE_CATEGORY, NODE_TYPES } = require("../constants");

@@ -13,3 +17,3 @@

docs: {
description: "Enforce newline between elements",
description: "Enforce newline between elements.",
category: RULE_CATEGORY.STYLE,

@@ -90,10 +94,16 @@ recommended: true,

/**
* Checks whether two nodes are on the same line or not.
* @param {HTMLNode} nodeBefore A node before
* @param {HTMLNode} nodeAfter A node after
* @returns {boolean} `true` if two nodes are on the same line, otherwise `false`.
*/
function isOnTheSameLine(nodeBefore, nodeAfter) {
return (
nodeBefore &&
nodeAfter &&
nodeBefore.loc &&
nodeAfter.loc &&
nodeBefore.loc.end.line === nodeAfter.loc.start.line
);
if (nodeBefore && nodeAfter) {
if (nodeBefore.endTag) {
return nodeBefore.endTag.loc.end.line === nodeAfter.loc.start.line;
}
return nodeBefore.loc.start.line === nodeAfter.loc.start.line;
}
return false;
}

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

const requireClosingTags = require("./require-closing-tags");
const requireMetaDescription = require("./require-meta-description");
const requireFrameTitle = require("./require-frame-title");
const noNonScalableViewport = require("./no-non-scalable-viewport");
const noPositiveTabindex = require("./no-positive-tabindex");
const requireMetaViewport = require("./require-meta-viewport");

@@ -36,2 +41,7 @@ module.exports = {

"require-closing-tags": requireClosingTags,
"require-meta-description": requireMetaDescription,
"require-frame-title": requireFrameTitle,
"no-non-scalable-viewport": noNonScalableViewport,
"no-positive-tabindex": noPositiveTabindex,
"require-meta-viewport": requireMetaViewport,
};
const { RULE_CATEGORY } = require("../constants");
const MESSAGE_IDS = {
MISSING_DOCTYPE: "missingDoctype",
MISSING: "missing",
};

@@ -20,3 +20,3 @@

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

@@ -35,5 +35,5 @@ },

node,
messageId: MESSAGE_IDS.MISSING_DOCTYPE,
messageId: MESSAGE_IDS.MISSING,
fix(fixer) {
return fixer.insertTextBefore(node, "<!DOCTYPE html>\n");
return fixer.insertTextBeforeRange([0, 0], "<!DOCTYPE html>\n");
},

@@ -40,0 +40,0 @@ });

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

SCRIPT: "Script";
META: "Meta";
};

@@ -19,0 +20,0 @@

{
"name": "@html-eslint/eslint-plugin",
"version": "0.6.5",
"version": "0.7.0",
"description": "ESLint plugin for html",

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

"devDependencies": {
"@html-eslint/parser": "^0.6.0"
"@html-eslint/parser": "^0.7.0"
},
"gitHead": "db6c66935e2ee0e2a5febce3f51bc7cc1bb589e0"
"gitHead": "a88f7f4b5199ead03455753d07a6f8669dc46427"
}
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