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

eslint-plugin-microsoft-typescript

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-microsoft-typescript - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

36

dist/rules/no-double-space.js

@@ -32,22 +32,28 @@ "use strict";

|| token.type === experimental_utils_1.AST_TOKEN_TYPES.String); };
var checkSoubleSpace = function () {
var checkDoubleSpaceInComment = function (comment, token) {
var firstNonSpace = /\S/.exec(comment);
if (!firstNonSpace) {
return;
}
var rgx = /[^/*. ] {2,}[^-!/= ]/g;
rgx.lastIndex = firstNonSpace.index;
var doubleSpace = rgx.exec(comment);
if (doubleSpace && !comment.includes(PARAM)) {
context.report({
messageId: 'noDoubleSpaceError',
node: token,
loc: { line: token.loc.start.line, column: doubleSpace.index + 1 },
});
}
};
var checkDoubleSpace = function () {
tokensAndComments.forEach(function (leftToken, leftIndex) {
if (isComment(leftToken)) {
var _a = leftToken.range, start = _a[0], end = _a[1];
var comment = sourceCodeText.slice(start, end);
if (comment.includes(PARAM)) {
return;
}
var column = comment.indexOf(DOUBLE_SPACE);
if (column >= 0) {
context.report({
messageId: 'noDoubleSpaceError',
node: leftToken,
loc: { line: leftToken.loc.start.line, column: column },
});
}
sourceCodeText.slice(start, end).split('\n')
.forEach(function (comment) { return checkDoubleSpaceInComment(comment, leftToken); });
return;
}
var rightToken = tokensAndComments[leftIndex + 1];
if (shouldSkipToken(leftToken, leftIndex) || leftToken.loc.start.line < rightToken.loc.end.line) {
if (shouldSkipToken(leftToken, leftIndex) || isComment(rightToken) || leftToken.loc.start.line < rightToken.loc.end.line) {
return;

@@ -66,5 +72,5 @@ }

return {
Program: checkSoubleSpace,
Program: checkDoubleSpace,
};
},
});
{
"name": "eslint-plugin-microsoft-typescript",
"version": "0.1.0",
"version": "0.1.1",
"description": "ESlint rules for TypeScript",

@@ -5,0 +5,0 @@ "keywords": [

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