Socket
Socket
Sign inDemoInstall

@typescript-eslint/eslint-plugin

Package Overview
Dependencies
Maintainers
2
Versions
3793
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 8.8.2-alpha.2 to 8.8.2-alpha.3

6

dist/rules/class-methods-use-this.js

@@ -181,8 +181,8 @@ "use strict";

*/
'PropertyDefinition:exit'() {
popContext();
},
'PropertyDefinition > *.key:exit'() {
pushContext();
},
'PropertyDefinition:exit'() {
popContext();
},
/*

@@ -189,0 +189,0 @@ * Class static blocks are implicit functions. They aren't required to use `this`,

@@ -30,3 +30,3 @@ "use strict";

const util_1 = require("../util");
const astIgnoreKeys = new Set(['range', 'loc', 'parent']);
const astIgnoreKeys = new Set(['loc', 'parent', 'range']);
const isSameAstNode = (actualNode, expectedNode) => {

@@ -33,0 +33,0 @@ if (actualNode === expectedNode) {

@@ -31,8 +31,8 @@ "use strict";

const FUNCTION_CONSTRUCTOR = 'Function';
const GLOBAL_CANDIDATES = new Set(['global', 'window', 'globalThis']);
const GLOBAL_CANDIDATES = new Set(['global', 'globalThis', 'window']);
const EVAL_LIKE_METHODS = new Set([
'execScript',
'setImmediate',
'setInterval',
'setTimeout',
'execScript',
]);

@@ -39,0 +39,0 @@ exports.default = (0, util_1.createRule)({

@@ -44,9 +44,9 @@ "use strict";

const CLASS_DECLARATION_MERGE_NODES = new Set([
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
utils_1.AST_NODE_TYPES.ClassDeclaration,
]);
const FUNCTION_DECLARATION_MERGE_NODES = new Set([
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
]);

@@ -53,0 +53,0 @@ const ENUM_DECLARATION_MERGE_NODES = new Set([

@@ -102,7 +102,7 @@ "use strict";

utils_1.AST_NODE_TYPES.TSImportType,
utils_1.AST_NODE_TYPES.TSTypeReference,
utils_1.AST_NODE_TYPES.TSIndexedAccessType,
utils_1.AST_NODE_TYPES.TSLiteralType,
utils_1.AST_NODE_TYPES.TSTemplateLiteralType,
utils_1.AST_NODE_TYPES.TSTypeQuery,
utils_1.AST_NODE_TYPES.TSIndexedAccessType,
utils_1.AST_NODE_TYPES.TSTemplateLiteralType,
utils_1.AST_NODE_TYPES.TSTypeReference,
]);

@@ -109,0 +109,0 @@ /**

@@ -6,3 +6,3 @@ "use strict";

const util_1 = require("../util");
const UNNECESSARY_OPERATORS = new Set(['=', '&&=', '||=', '??=']);
const UNNECESSARY_OPERATORS = new Set(['??=', '&&=', '=', '||=']);
exports.default = (0, util_1.createRule)({

@@ -9,0 +9,0 @@ name: 'no-unnecessary-parameter-property-assignment',

@@ -136,6 +136,6 @@ "use strict";

'TSEnumDeclaration:exit': exitDeclaration,
'TSModuleDeclaration:exit': exitDeclaration,
'TSModuleDeclaration > TSModuleBlock'(node) {
enterDeclaration(node.parent);
},
'TSModuleDeclaration:exit': exitDeclaration,
TSQualifiedName(node) {

@@ -142,0 +142,0 @@ visitNamespaceAccess(node, node.left, node.right);

@@ -57,7 +57,3 @@ "use strict";

const variable = scope.set.get(esTypeParameter.name.name);
return variable != null &&
variable.isTypeVariable &&
!variable.isValueVariable
? variable
: undefined;
return variable?.isTypeVariable ? variable : undefined;
})(), "Type parameter should be present in scope's variables.");

@@ -64,0 +60,0 @@ // Quick path: if the type parameter is used multiple times in the AST,

@@ -159,2 +159,9 @@ "use strict";

},
'TSInterfaceDeclaration:exit'(node) {
if (!hasOneSupertype(node) && node.body.body.length === 1) {
checkMember(node.body.body[0], node, tsThisTypes);
}
// on exit check member and reset the array to nothing.
tsThisTypes = null;
},
'TSInterfaceDeclaration TSThisType'(node) {

@@ -168,9 +175,2 @@ // inside an interface keep track of all ThisType references.

},
'TSInterfaceDeclaration:exit'(node) {
if (!hasOneSupertype(node) && node.body.body.length === 1) {
checkMember(node.body.body[0], node, tsThisTypes);
}
// on exit check member and reset the array to nothing.
tsThisTypes = null;
},
// keep track of nested literals to avoid complaining about invalid `this` uses

@@ -177,0 +177,0 @@ 'TSInterfaceDeclaration TSTypeLiteral'() {

@@ -16,2 +16,3 @@ "use strict";

notLiteral: `Explicit enum value must only be a literal value (string or number).`,
notLiteralOrBitwiseExpression: `Explicit enum value must only be a literal value (string or number) or a bitwise expression.`,
},

@@ -109,3 +110,5 @@ schema: [

node: node.id,
messageId: 'notLiteral',
messageId: allowBitwiseExpressions
? 'notLiteralOrBitwiseExpression'
: 'notLiteral',
});

@@ -112,0 +115,0 @@ },

@@ -248,11 +248,10 @@ "use strict";

if (isAwait) {
// any/unknown could be thenable; do not auto-fix
const useAutoFix = !((0, util_1.isTypeAnyType)(type) || (0, util_1.isTypeUnknownType)(type));
// any/unknown could be thenable; do not enforce whether they are `await`ed.
if ((0, util_1.isTypeAnyType)(type) || (0, util_1.isTypeUnknownType)(type)) {
return;
}
context.report({
node,
messageId: 'nonPromiseAwait',
...fixOrSuggest(useAutoFix, {
messageId: 'nonPromiseAwait',
fix: fixer => removeAwait(fixer, node),
}),
fix: fixer => removeAwait(fixer, node),
});

@@ -259,0 +258,0 @@ }

@@ -289,7 +289,7 @@ "use strict";

const MERGABLE_TYPES = new Set([
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
]);

@@ -336,3 +336,3 @@ /**

}
const LOGICAL_ASSIGNMENT_OPERATORS = new Set(['&&=', '||=', '??=']);
const LOGICAL_ASSIGNMENT_OPERATORS = new Set(['??=', '&&=', '||=']);
/**

@@ -339,0 +339,0 @@ * Determines if the variable is used.

@@ -32,2 +32,3 @@ "use strict";

const ARRAY_PREDICATE_FUNCTIONS = new Set([
'every',
'filter',

@@ -39,3 +40,2 @@ 'find',

'some',
'every',
]);

@@ -42,0 +42,0 @@ function isArrayMethodCallWithPredicate(context, services, node) {

@@ -38,3 +38,3 @@ "use strict";

*/
const PUNCTUATORS = new Set([':', ';', '{', '=>', '++', '--']);
const PUNCTUATORS = new Set(['--', ';', ':', '{', '++', '=>']);
/*

@@ -41,0 +41,0 @@ * Statements that can contain an `ExpressionStatement` after a closing parenthesis.

{
"name": "@typescript-eslint/eslint-plugin",
"version": "8.8.2-alpha.2",
"version": "8.8.2-alpha.3",
"description": "TypeScript plugin for ESLint",

@@ -63,6 +63,6 @@ "files": [

"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.8.2-alpha.2",
"@typescript-eslint/type-utils": "8.8.2-alpha.2",
"@typescript-eslint/utils": "8.8.2-alpha.2",
"@typescript-eslint/visitor-keys": "8.8.2-alpha.2",
"@typescript-eslint/scope-manager": "8.8.2-alpha.3",
"@typescript-eslint/type-utils": "8.8.2-alpha.3",
"@typescript-eslint/utils": "8.8.2-alpha.3",
"@typescript-eslint/visitor-keys": "8.8.2-alpha.3",
"graphemer": "^1.4.0",

@@ -78,4 +78,4 @@ "ignore": "^5.3.1",

"@types/natural-compare": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "8.8.2-alpha.2",
"@typescript-eslint/rule-tester": "8.8.2-alpha.2",
"@typescript-eslint/rule-schema-to-typescript-types": "8.8.2-alpha.3",
"@typescript-eslint/rule-tester": "8.8.2-alpha.3",
"ajv": "^6.12.6",

@@ -82,0 +82,0 @@ "cross-env": "^7.0.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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