Socket
Socket
Sign inDemoInstall

@typescript-eslint/eslint-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3773
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 1.4.1 to 1.4.2-alpha.0

8

dist/index.js
"use strict";
/**
* @fileoverview TypeScript plugin for ESLint
* @author Nicholas C. Zakas
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -21,5 +17,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

configs: {
recommended: recommended_json_1.default
}
recommended: recommended_json_1.default,
},
};
//# sourceMappingURL=index.js.map
"use strict";
/**
* @fileoverview Enforces member overloads to be consecutive.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,8 +20,8 @@ if (mod && mod.__esModule) return mod;

tslintName: 'adjacent-overload-signatures',
recommended: 'error'
recommended: 'error',
},
schema: [],
messages: {
adjacentSignature: "All '{{name}}' signatures should be adjacent."
}
adjacentSignature: "All '{{name}}' signatures should be adjacent.",
},
},

@@ -101,3 +97,3 @@ defaultOptions: [],

name,
static: 'static' in member && !!member.static
static: 'static' in member && !!member.static,
};

@@ -110,4 +106,4 @@ const index = seenMethods.findIndex(seenMethod => isSameMethod(method, seenMethod));

data: {
name: (method.static ? 'static ' : '') + method.name
}
name: (method.static ? 'static ' : '') + method.name,
},
});

@@ -127,6 +123,6 @@ }

TSTypeLiteral: checkBodyForOverloadMethods,
TSInterfaceBody: checkBodyForOverloadMethods
TSInterfaceBody: checkBodyForOverloadMethods,
};
}
},
});
//# sourceMappingURL=adjacent-overload-signatures.js.map
"use strict";
/**
* @fileoverview Requires using either `T[]` or `Array<T>` for arrays.
* @author Mackie Underdown
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -87,3 +82,3 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},

@@ -95,9 +90,9 @@ fixable: 'code',

errorStringArray: "Array type using 'Array<{{type}}>' is forbidden. Use '{{type}}[]' instead.",
errorStringArraySimple: "Array type using 'Array<{{type}}>' is forbidden for simple types. Use '{{type}}[]' instead."
errorStringArraySimple: "Array type using 'Array<{{type}}>' is forbidden for simple types. Use '{{type}}[]' instead.",
},
schema: [
{
enum: ['array', 'generic', 'array-simple']
}
]
enum: ['array', 'generic', 'array-simple'],
},
],
},

@@ -148,3 +143,3 @@ defaultOptions: ['array'],

data: {
type: getMessageType(node.elementType)
type: getMessageType(node.elementType),
},

@@ -155,3 +150,3 @@ fix(fixer) {

fixer.replaceTextRange([node.range[1] - 2, node.range[1]], '>'),
fixer.insertTextBefore(node, `${startText ? ' ' : ''}Array<`)
fixer.insertTextBefore(node, `${startText ? ' ' : ''}Array<`),
];

@@ -168,3 +163,3 @@ if (node.elementType.type === typescript_estree_1.AST_NODE_TYPES.TSParenthesizedType) {

return toFix;
}
},
});

@@ -186,7 +181,7 @@ },

data: {
type: 'any'
type: 'any',
},
fix(fixer) {
return fixer.replaceText(node, 'any[]');
}
},
});

@@ -205,3 +200,3 @@ return;

data: {
type: getMessageType(type)
type: getMessageType(type),
},

@@ -211,10 +206,10 @@ fix(fixer) {

fixer.replaceTextRange([node.range[0], type.range[0]], parens ? '(' : ''),
fixer.replaceTextRange([type.range[1], node.range[1]], parens ? ')[]' : '[]')
fixer.replaceTextRange([type.range[1], node.range[1]], parens ? ')[]' : '[]'),
];
}
},
});
}
},
};
}
},
});
//# sourceMappingURL=array-type.js.map
"use strict";
/**
* @fileoverview Bans “// @ts-ignore” comments from being used.
* @author Ricky Lippmann <https://github.com/ldrick>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
schema: [],
messages: {
tsIgnoreComment: 'Do not use "// @ts-ignore" comments because they suppress compilation errors.'
}
tsIgnoreComment: 'Do not use "// @ts-ignore" comments because they suppress compilation errors.',
},
},

@@ -45,10 +41,10 @@ defaultOptions: [],

node: comment,
messageId: 'tsIgnoreComment'
messageId: 'tsIgnoreComment',
});
}
});
}
},
};
}
},
});
//# sourceMappingURL=ban-ts-ignore.js.map
"use strict";
/**
* @fileoverview Enforces that types will not to be used
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,7 +20,7 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
fixable: 'code',
messages: {
bannedTypeMessage: "Don't use '{{name}}' as a type.{{customMessage}}"
bannedTypeMessage: "Don't use '{{name}}' as a type.{{customMessage}}",
},

@@ -45,13 +41,13 @@ schema: [

message: { type: 'string' },
fixWith: { type: 'string' }
fixWith: { type: 'string' },
},
additionalProperties: false
}
]
}
}
additionalProperties: false,
},
],
},
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -63,22 +59,22 @@ defaultOptions: [

message: 'Use string instead',
fixWith: 'string'
fixWith: 'string',
},
Boolean: {
message: 'Use boolean instead',
fixWith: 'boolean'
fixWith: 'boolean',
},
Number: {
message: 'Use number instead',
fixWith: 'number'
fixWith: 'number',
},
Object: {
message: 'Use Record<string, any> instead',
fixWith: 'Record<string, any>'
fixWith: 'Record<string, any>',
},
Symbol: {
message: 'Use symbol instead',
fixWith: 'symbol'
}
}
}
fixWith: 'symbol',
},
},
},
],

@@ -111,12 +107,12 @@ create(context, [{ types: bannedTypes }]) {

name: node.name,
customMessage
customMessage,
},
fix
fix,
});
}
}
}
},
};
}
},
});
//# sourceMappingURL=ban-types.js.map
"use strict";
/**
* @fileoverview Rule to flag non-camelcased identifiers
* @author Patricio Trevino
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -27,6 +23,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
schema: camelcase_1.default.meta.schema,
messages: camelcase_1.default.meta.messages
messages: camelcase_1.default.meta.messages,
},

@@ -37,4 +33,4 @@ defaultOptions: [

ignoreDestructuring: false,
properties: 'never'
}
properties: 'never',
},
],

@@ -47,3 +43,3 @@ create(context, [options]) {

typescript_estree_1.AST_NODE_TYPES.TSParameterProperty,
typescript_estree_1.AST_NODE_TYPES.TSAbstractClassProperty
typescript_estree_1.AST_NODE_TYPES.TSAbstractClassProperty,
];

@@ -105,3 +101,3 @@ const properties = options.properties;

messageId: 'notCamelCase',
data: { name: node.name }
data: { name: node.name },
});

@@ -113,6 +109,6 @@ }

rules.Identifier(node);
}
},
};
}
},
});
//# sourceMappingURL=camelcase.js.map
"use strict";
/**
* @fileoverview Enforces PascalCased class and interface names.
* @author Jed Fox
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -25,8 +20,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
notPascalCased: "{{friendlyName}} '{{name}}' must be PascalCased."
notPascalCased: "{{friendlyName}} '{{name}}' must be PascalCased.",
},
schema: []
schema: [],
},

@@ -65,4 +60,4 @@ defaultOptions: [],

friendlyName,
name: id.name
}
name: id.name,
},
});

@@ -95,6 +90,6 @@ }

}
}
},
};
}
},
});
//# sourceMappingURL=class-name-casing.js.map
"use strict";
/**
* @fileoverview Enforces explicit return type for functions
* @author Scott O'Hara
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,6 +19,6 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'warn'
recommended: 'warn',
},
messages: {
missingReturnType: 'Missing return type on function.'
missingReturnType: 'Missing return type on function.',
},

@@ -34,13 +30,13 @@ schema: [

allowExpressions: {
type: 'boolean'
}
type: 'boolean',
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},
defaultOptions: [
{
allowExpressions: true
}
allowExpressions: true,
},
],

@@ -75,3 +71,3 @@ create(context, [options]) {

node,
messageId: 'missingReturnType'
messageId: 'missingReturnType',
});

@@ -96,6 +92,6 @@ }

FunctionDeclaration: checkFunctionReturnType,
FunctionExpression: checkFunctionExpressionReturnType
FunctionExpression: checkFunctionExpressionReturnType,
};
}
},
});
//# sourceMappingURL=explicit-function-return-type.js.map
"use strict";
/**
* @fileoverview Enforces explicit accessibility modifier for class members
* @author Danny Fritz
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
missingAccessibility: 'Missing accessibility modifier on {{type}} {{name}}.'
missingAccessibility: 'Missing accessibility modifier on {{type}} {{name}}.',
},
schema: []
schema: [],
},

@@ -45,4 +41,4 @@ defaultOptions: [],

type: 'method definition',
name: util.getNameFromPropertyName(methodDefinition.key)
}
name: util.getNameFromPropertyName(methodDefinition.key),
},
});

@@ -63,4 +59,4 @@ }

type: 'class property',
name: util.getNameFromPropertyName(classProperty.key)
}
name: util.getNameFromPropertyName(classProperty.key),
},
});

@@ -71,6 +67,6 @@ }

ClassProperty: checkPropertyAccessibilityModifier,
MethodDefinition: checkMethodAccessibilityModifier
MethodDefinition: checkMethodAccessibilityModifier,
};
}
},
});
//# sourceMappingURL=explicit-member-accessibility.js.map
"use strict";
/**
* @fileoverview Enforces naming of generic type variables.
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -21,16 +18,16 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: false
recommended: false,
},
messages: {
paramNotMatchRule: 'Type parameter {{name}} does not match rule {{rule}}.'
paramNotMatchRule: 'Type parameter {{name}} does not match rule {{rule}}.',
},
schema: [
{
type: 'string'
}
]
type: 'string',
},
],
},
defaultOptions: [
// Matches: T , TA , TAbc , TA1Bca , T1 , T2
'^T([A-Z0-9][a-zA-Z0-9]*){0,1}$'
'^T([A-Z0-9][a-zA-Z0-9]*){0,1}$',
],

@@ -48,10 +45,10 @@ create(context, [rule]) {

name,
rule
}
rule,
},
});
}
}
},
};
}
},
});
//# sourceMappingURL=generic-type-naming.js.map
"use strict";
/**
* @fileoverview Rule to flag non-camelcased identifiers
*
* Note this file is rather type-unsafe in its current state.

@@ -85,3 +83,3 @@ * This is due to some really funky type conversions between different node types.

typescript_estree_1.AST_NODE_TYPES.TSTypeReference,
typescript_estree_1.AST_NODE_TYPES.TSUnionType
typescript_estree_1.AST_NODE_TYPES.TSUnionType,
]);

@@ -96,7 +94,7 @@ exports.default = util.createRule({

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
fixable: 'whitespace',
schema: indent_1.default.meta.schema,
messages: indent_1.default.meta.messages
messages: indent_1.default.meta.messages,
},

@@ -111,4 +109,4 @@ defaultOptions: [

flatTernaryExpressions: false,
ignoredNodes: []
}
ignoredNodes: [],
},
],

@@ -122,4 +120,4 @@ create(context, optionsWithDefaults) {

configurable: false,
value: optionsWithDefaults
}
value: optionsWithDefaults,
},
});

@@ -147,3 +145,3 @@ const rules = indent_1.default.create(contextWithDefaults);

range: node.range,
loc: node.loc
loc: node.loc,
};

@@ -176,3 +174,3 @@ if (type === typescript_estree_1.AST_NODE_TYPES.Property) {

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -193,4 +191,4 @@ },

start: node.checkType.loc.start,
end: node.extendsType.loc.end
}
end: node.extendsType.loc.end,
},
},

@@ -202,3 +200,3 @@ consequent: node.trueType,

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -214,3 +212,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -231,3 +229,3 @@ },

start: id.loc.start,
end: moduleReference.loc.end
end: moduleReference.loc.end,
},

@@ -242,3 +240,3 @@ id: id,

moduleReference.range[0],
moduleReference.range[0] + 'require'.length
moduleReference.range[0] + 'require'.length,
],

@@ -249,5 +247,5 @@ loc: {

line: moduleReference.loc.end.line,
column: moduleReference.loc.start.line + 'require'.length
}
}
column: moduleReference.loc.start.line + 'require'.length,
},
},
},

@@ -259,5 +257,5 @@ arguments: 'expression' in moduleReference

range: moduleReference.range,
loc: moduleReference.loc
}
}
loc: moduleReference.loc,
},
},
],

@@ -267,3 +265,3 @@ // location data

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -280,3 +278,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -292,3 +290,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -307,3 +305,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -327,3 +325,3 @@ },

? node.typeAnnotation.range[1]
: squareBracketStart.range[0]
: squareBracketStart.range[0],
],

@@ -334,3 +332,3 @@ loc: {

? node.typeAnnotation.loc.end
: squareBracketStart.loc.end
: squareBracketStart.loc.end,
},

@@ -340,4 +338,4 @@ kind: 'init',

method: false,
shorthand: false
}
shorthand: false,
},
],

@@ -347,3 +345,3 @@ // location data

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -359,3 +357,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -371,3 +369,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -383,3 +381,3 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});

@@ -399,8 +397,8 @@ },

range: node.range,
loc: node.loc
loc: node.loc,
});
}
},
});
}
},
});
//# sourceMappingURL=indent.js.map
"use strict";
/**
* @fileoverview Enforces interface names are prefixed with "I".
* @author Danny Fritz
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,12 +19,12 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
messages: {
noPrefix: 'Interface name must not be prefixed with "I".'
noPrefix: 'Interface name must not be prefixed with "I".',
},
schema: [
{
enum: ['never', 'always']
}
]
enum: ['never', 'always'],
},
],
},

@@ -54,3 +50,3 @@ defaultOptions: ['never'],

node: node.id,
messageId: 'noPrefix'
messageId: 'noPrefix',
});

@@ -63,10 +59,10 @@ }

node: node.id,
messageId: 'noPrefix'
messageId: 'noPrefix',
});
}
}
}
},
};
}
},
});
//# sourceMappingURL=interface-name-prefix.js.map
"use strict";
/**
* @fileoverview Enforces a member delimiter style in interfaces and type literals.
* @author Patricio Trevino
* @author Brad Zacher
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,5 +19,5 @@ if (mod && mod.__esModule) return mod;

delimiter: { enum: ['none', 'semi', 'comma'] },
requireLast: { type: 'boolean' }
requireLast: { type: 'boolean' },
},
additionalProperties: false
additionalProperties: false,
},

@@ -34,8 +29,8 @@ singleline: {

delimiter: { enum: ['semi', 'comma'] },
requireLast: { type: 'boolean' }
requireLast: { type: 'boolean' },
},
additionalProperties: false
}
additionalProperties: false,
},
},
additionalProperties: false
additionalProperties: false,
};

@@ -49,3 +44,3 @@ exports.default = util.createRule({

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},

@@ -57,3 +52,3 @@ fixable: 'code',

expectedComma: 'Expected a comma.',
expectedSemi: 'Expected a semicolon.'
expectedSemi: 'Expected a semicolon.',
},

@@ -68,10 +63,10 @@ schema: [

interface: definition,
typeLiteral: definition
typeLiteral: definition,
},
additionalProperties: false
}
additionalProperties: false,
},
}),
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -82,9 +77,9 @@ defaultOptions: [

delimiter: 'semi',
requireLast: true
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false
}
}
requireLast: false,
},
},
],

@@ -119,3 +114,3 @@ create(context, [options]) {

const lastToken = sourceCode.getLastToken(member, {
includeComments: false
includeComments: false,
});

@@ -162,8 +157,8 @@ if (!lastToken) {

line: lastToken.loc.end.line,
column: lastToken.loc.end.column
column: lastToken.loc.end.column,
},
end: {
line: lastToken.loc.end.line,
column: lastToken.loc.end.column
}
column: lastToken.loc.end.column,
},
},

@@ -183,3 +178,3 @@ messageId,

return fixer.replaceText(lastToken, token);
}
},
});

@@ -205,6 +200,6 @@ }

TSInterfaceBody: checkMemberSeparatorStyle,
TSTypeLiteral: checkMemberSeparatorStyle
TSTypeLiteral: checkMemberSeparatorStyle,
};
}
},
});
//# sourceMappingURL=member-delimiter-style.js.map
"use strict";
/**
* @fileoverview Enforces naming conventions for class members by visibility.
* @author Ian MacLeod
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -22,6 +18,6 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: false
recommended: false,
},
messages: {
incorrectName: '{{accessibility}} property {{name}} should match {{convention}}.'
incorrectName: '{{accessibility}} property {{name}} should match {{convention}}.',
},

@@ -35,3 +31,3 @@ schema: [

minLength: 1,
format: 'regex'
format: 'regex',
},

@@ -41,3 +37,3 @@ protected: {

minLength: 1,
format: 'regex'
format: 'regex',
},

@@ -47,9 +43,9 @@ private: {

minLength: 1,
format: 'regex'
}
format: 'regex',
},
},
additionalProperties: false,
minProperties: 1
}
]
minProperties: 1,
},
],
},

@@ -78,3 +74,3 @@ defaultOptions: [{}],

messageId: 'incorrectName',
data: { accessibility, name, convention }
data: { accessibility, name, convention },
});

@@ -84,6 +80,6 @@ }

MethodDefinition: validateName,
ClassProperty: validateName
ClassProperty: validateName,
};
}
},
});
//# sourceMappingURL=member-naming.js.map
"use strict";
/**
* @fileoverview Enforces a standard member declaration order.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -39,6 +35,6 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: false
recommended: false,
},
messages: {
incorrectOrder: 'Member {{name}} should be declared before all {{rank}} definitions.'
incorrectOrder: 'Member {{name}} should be declared before all {{rank}} definitions.',
},

@@ -52,3 +48,3 @@ schema: [

{
enum: ['never']
enum: ['never'],
},

@@ -58,6 +54,6 @@ {

items: {
enum: schemaOptions
}
}
]
enum: schemaOptions,
},
},
],
},

@@ -67,3 +63,3 @@ classes: {

{
enum: ['never']
enum: ['never'],
},

@@ -73,6 +69,6 @@ {

items: {
enum: schemaOptions
}
}
]
enum: schemaOptions,
},
},
],
},

@@ -82,3 +78,3 @@ classExpressions: {

{
enum: ['never']
enum: ['never'],
},

@@ -88,6 +84,6 @@ {

items: {
enum: schemaOptions
}
}
]
enum: schemaOptions,
},
},
],
},

@@ -97,3 +93,3 @@ interfaces: {

{
enum: ['never']
enum: ['never'],
},

@@ -103,6 +99,6 @@ {

items: {
enum: ['field', 'method', 'constructor']
}
}
]
enum: ['field', 'method', 'constructor'],
},
},
],
},

@@ -112,3 +108,3 @@ typeLiterals: {

{
enum: ['never']
enum: ['never'],
},

@@ -118,11 +114,11 @@ {

items: {
enum: ['field', 'method', 'constructor']
}
}
]
}
enum: ['field', 'method', 'constructor'],
},
},
],
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -156,5 +152,5 @@ defaultOptions: [

'instance-method',
'method'
]
}
'method',
],
},
],

@@ -164,3 +160,3 @@ create(context, [options]) {

typescript_estree_1.AST_NODE_TYPES.FunctionExpression,
typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression
typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
];

@@ -173,2 +169,5 @@ /**

// TODO: add missing TSCallSignatureDeclaration
// TODO: add missing TSIndexSignature
// TODO: add missing TSAbstractClassProperty
// TODO: add missing TSAbstractMethodDefinition
switch (node.type) {

@@ -239,3 +238,3 @@ case typescript_estree_1.AST_NODE_TYPES.MethodDefinition:

// shouldn't happen but just in case, put it on the end
return Number.MAX_SAFE_INTEGER;
return order.length - 1;
}

@@ -303,4 +302,4 @@ const scope = 'static' in node && node.static ? 'static' : 'instance';

name: getMemberName(member),
rank: getLowestRank(previousRanks, rank, order)
}
rank: getLowestRank(previousRanks, rank, order),
},
});

@@ -327,6 +326,6 @@ }

validateMembers(node.members, options.typeLiterals || options.default, false);
}
},
};
}
},
});
//# sourceMappingURL=member-ordering.js.map
"use strict";
/**
* @fileoverview Enforces the use of `as Type` assertions instead of `<Type>` assertions.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
messages: {
preferAs: "Prefer 'as {{cast}}' instead of '<{{cast}}>' when doing type assertions."
preferAs: "Prefer 'as {{cast}}' instead of '<{{cast}}>' when doing type assertions.",
},
schema: []
schema: [],
},

@@ -40,9 +36,9 @@ defaultOptions: [],

data: {
cast: sourceCode.getText(node.typeAnnotation)
}
cast: sourceCode.getText(node.typeAnnotation),
},
});
}
},
};
}
},
});
//# sourceMappingURL=no-angle-bracket-type-assertion.js.map
"use strict";
/**
* @fileoverview Disallow generic `Array` constructors
* @author Jed Fox
* @author Matt DuVall <http://www.mattduvall.com/>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,9 +19,9 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
fixable: 'code',
messages: {
useLiteral: 'The array literal notation [] is preferrable.'
useLiteral: 'The array literal notation [] is preferrable.',
},
schema: []
schema: [],
},

@@ -54,3 +49,3 @@ defaultOptions: [],

return fixer.replaceText(node, `[${fullText.slice(preambleLength + 1, -1)}]`);
}
},
});

@@ -61,6 +56,6 @@ }

CallExpression: check,
NewExpression: check
NewExpression: check,
};
}
},
});
//# sourceMappingURL=no-array-constructor.js.map
"use strict";
/**
* @fileoverview Disallows the declaration of empty interfaces.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,7 +19,7 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
noEmpty: 'An empty interface is equivalent to `{}`.',
noEmptyWithSuper: 'An interface declaring no members is equivalent to its supertype.'
noEmptyWithSuper: 'An interface declaring no members is equivalent to its supertype.',
},

@@ -36,12 +32,12 @@ schema: [

allowSingleExtends: {
type: 'boolean'
}
}
}
]
type: 'boolean',
},
},
},
],
},
defaultOptions: [
{
allowSingleExtends: false
}
allowSingleExtends: false,
},
],

@@ -58,3 +54,3 @@ create(context, [{ allowSingleExtends }]) {

node: node.id,
messageId: 'noEmpty'
messageId: 'noEmpty',
});

@@ -70,10 +66,10 @@ }

node: node.id,
messageId: 'noEmptyWithSuper'
messageId: 'noEmptyWithSuper',
});
}
}
}
},
};
}
},
});
//# sourceMappingURL=no-empty-interface.js.map
"use strict";
/**
* @fileoverview Enforces the any type is not used.
* @author Danny Fritz
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'warn'
recommended: 'warn',
},
messages: {
unexpectedAny: 'Unexpected any. Specify a different type.'
unexpectedAny: 'Unexpected any. Specify a different type.',
},
schema: []
schema: [],
},

@@ -38,8 +33,8 @@ defaultOptions: [],

node,
messageId: 'unexpectedAny'
messageId: 'unexpectedAny',
});
}
},
};
}
},
});
//# sourceMappingURL=no-explicit-any.js.map
"use strict";
/**
* @fileoverview Forbids the use of classes as namespaces
* @author Jed Fox
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,3 +20,3 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: false
recommended: false,
},

@@ -33,12 +29,12 @@ schema: [

allowConstructorOnly: {
type: 'boolean'
type: 'boolean',
},
allowEmpty: {
type: 'boolean'
type: 'boolean',
},
allowStaticOnly: {
type: 'boolean'
}
}
}
type: 'boolean',
},
},
},
],

@@ -48,4 +44,4 @@ messages: {

onlyStatic: 'Unexpected class with only static properties.',
onlyConstructor: 'Unexpected class with only a constructor.'
}
onlyConstructor: 'Unexpected class with only a constructor.',
},
},

@@ -56,4 +52,4 @@ defaultOptions: [

allowEmpty: false,
allowStaticOnly: false
}
allowStaticOnly: false,
},
],

@@ -74,3 +70,3 @@ create(context, [{ allowConstructorOnly, allowEmpty, allowStaticOnly }]) {

node: reportNode,
messageId: 'empty'
messageId: 'empty',
});

@@ -101,3 +97,3 @@ return;

node: reportNode,
messageId: 'onlyConstructor'
messageId: 'onlyConstructor',
});

@@ -110,9 +106,9 @@ }

node: reportNode,
messageId: 'onlyStatic'
messageId: 'onlyStatic',
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-extraneous-class.js.map
"use strict";
/**
* @fileoverview Disallow iterating over an array with a for-in loop
* @author Benjamin Lichtman
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -26,9 +22,9 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

recommended: false,
tslintName: 'no-for-in-array'
tslintName: 'no-for-in-array',
},
messages: {
forInViolation: 'For-in loops over arrays are forbidden. Use for-of or array.forEach instead.'
forInViolation: 'For-in loops over arrays are forbidden. Use for-of or array.forEach instead.',
},
schema: [],
type: 'problem'
type: 'problem',
},

@@ -48,9 +44,9 @@ defaultOptions: [],

node,
messageId: 'forInViolation'
messageId: 'forInViolation',
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-for-in-array.js.map
"use strict";
/**
* @fileoverview Disallows explicit type declarations for inferrable types
* @author James Garbutt <https://github.com/43081j>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,7 +20,7 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
fixable: 'code',
messages: {
noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.'
noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.',
},

@@ -36,11 +32,11 @@ schema: [

ignoreParameters: {
type: 'boolean'
type: 'boolean',
},
ignoreProperties: {
type: 'boolean'
}
type: 'boolean',
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -50,4 +46,4 @@ defaultOptions: [

ignoreParameters: true,
ignoreProperties: true
}
ignoreProperties: true,
},
],

@@ -119,5 +115,5 @@ create(context, [{ ignoreParameters, ignoreProperties }]) {

data: {
type
type,
},
fix: fixer => fixer.remove(typeNode)
fix: fixer => fixer.remove(typeNode),
});

@@ -156,6 +152,6 @@ }

ArrowFunctionExpression: inferrableParameterVisitor,
ClassProperty: inferrablePropertyVisitor
ClassProperty: inferrablePropertyVisitor,
};
}
},
});
//# sourceMappingURL=no-inferrable-types.js.map
"use strict";
/**
* @fileoverview Enforce valid definition of `new` and `constructor`.
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,3 +20,3 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},

@@ -30,4 +26,4 @@ schema: [],

errorMessageInterface: 'Interfaces cannot be constructed, only classes.',
errorMessageClass: 'Class cannon have method named `new`.'
}
errorMessageClass: 'Class cannon have method named `new`.',
},
},

@@ -74,3 +70,3 @@ defaultOptions: [],

node,
messageId: 'errorMessageInterface'
messageId: 'errorMessageInterface',
});

@@ -82,3 +78,3 @@ }

node,
messageId: 'errorMessageInterface'
messageId: 'errorMessageInterface',
});

@@ -92,10 +88,10 @@ },

node,
messageId: 'errorMessageClass'
messageId: 'errorMessageClass',
});
}
}
}
},
};
}
},
});
//# sourceMappingURL=no-misused-new.js.map
"use strict";
/**
* @fileoverview Disallows the use of custom TypeScript modules and namespaces.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,6 +20,6 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
moduleSyntaxIsPreferred: 'ES2015 module syntax is preferred over custom TypeScript modules and namespaces.'
moduleSyntaxIsPreferred: 'ES2015 module syntax is preferred over custom TypeScript modules and namespaces.',
},

@@ -35,11 +31,11 @@ schema: [

allowDeclarations: {
type: 'boolean'
type: 'boolean',
},
allowDefinitionFiles: {
type: 'boolean'
}
type: 'boolean',
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -49,4 +45,4 @@ defaultOptions: [

allowDeclarations: false,
allowDefinitionFiles: true
}
allowDefinitionFiles: true,
},
],

@@ -65,8 +61,8 @@ create(context, [{ allowDeclarations, allowDefinitionFiles }]) {

node,
messageId: 'moduleSyntaxIsPreferred'
messageId: 'moduleSyntaxIsPreferred',
});
}
},
};
}
},
});
//# sourceMappingURL=no-namespace.js.map
"use strict";
/**
* @fileoverview Disallows non-null assertions using the `!` postfix operator.
* @author Macklin Underdown
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
messages: {
noNonNull: 'Forbidden non-null assertion.'
noNonNull: 'Forbidden non-null assertion.',
},
schema: []
schema: [],
},

@@ -37,8 +33,8 @@ defaultOptions: [],

node,
messageId: 'noNonNull'
messageId: 'noNonNull',
});
}
},
};
}
},
});
//# sourceMappingURL=no-non-null-assertion.js.map
"use strict";
/**
* @fileoverview Forbids an object literal to appear in a type assertion expression
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,6 +20,6 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
messages: {
unexpectedTypeAssertion: 'Type assertion on object literals is forbidden, use a type annotation instead.'
unexpectedTypeAssertion: 'Type assertion on object literals is forbidden, use a type annotation instead.',
},

@@ -36,12 +32,12 @@ schema: [

allowAsParameter: {
type: 'boolean'
}
}
}
]
type: 'boolean',
},
},
},
],
},
defaultOptions: [
{
allowAsParameter: false
}
allowAsParameter: false,
},
],

@@ -74,9 +70,9 @@ create(context, [{ allowAsParameter }]) {

node,
messageId: 'unexpectedTypeAssertion'
messageId: 'unexpectedTypeAssertion',
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-object-literal-type-assertion.js.map
"use strict";
/**
* @fileoverview Disallows parameter properties in class constructors.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,6 +20,6 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
messages: {
noParamProp: 'Property {{parameter}} cannot be declared in the constructor.'
noParamProp: 'Property {{parameter}} cannot be declared in the constructor.',
},

@@ -44,16 +40,16 @@ schema: [

'protected readonly',
'public readonly'
]
'public readonly',
],
},
minItems: 1
}
minItems: 1,
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},
defaultOptions: [
{
allows: []
}
allows: [],
},
],

@@ -92,10 +88,10 @@ create(context, [{ allows }]) {

data: {
parameter: name
}
parameter: name,
},
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-parameter-properties.js.map
"use strict";
/**
* @fileoverview Disallows invocation of `require()`.
* @author Kanitkorn Sujautra
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
schema: [],
messages: {
noRequireImports: 'A `require()` style import is forbidden.'
}
noRequireImports: 'A `require()` style import is forbidden.',
},
},

@@ -37,3 +33,3 @@ defaultOptions: [],

node: node.parent,
messageId: 'noRequireImports'
messageId: 'noRequireImports',
});

@@ -44,8 +40,8 @@ },

node,
messageId: 'noRequireImports'
messageId: 'noRequireImports',
});
}
},
};
}
},
});
//# sourceMappingURL=no-require-imports.js.map
"use strict";
/**
* @fileoverview Disallow aliasing `this`
* @author Jed Fox
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,3 +20,3 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: false
recommended: false,
},

@@ -33,3 +29,3 @@ schema: [

allowDestructuring: {
type: 'boolean'
type: 'boolean',
},

@@ -39,12 +35,12 @@ allowedNames: {

items: {
type: 'string'
}
}
}
}
type: 'string',
},
},
},
},
],
messages: {
thisAssignment: "Unexpected aliasing of 'this' to local variable.",
thisDestructure: "Unexpected aliasing of members of 'this' to local variables."
}
thisDestructure: "Unexpected aliasing of members of 'this' to local variables.",
},
},

@@ -54,4 +50,4 @@ defaultOptions: [

allowDestructuring: false,
allowedNames: []
}
allowedNames: [],
},
],

@@ -73,9 +69,9 @@ create(context, [{ allowDestructuring, allowedNames }]) {

? 'thisAssignment'
: 'thisDestructure'
: 'thisDestructure',
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-this-alias.js.map
"use strict";
/**
* @fileoverview Enforces triple slash references are not used.
* @author Danny Fritz
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,8 +19,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
schema: [],
messages: {
tripleSlashReference: 'Do not use a triple slash reference.'
}
tripleSlashReference: 'Do not use a triple slash reference.',
},
},

@@ -45,10 +41,10 @@ defaultOptions: [],

node: comment,
messageId: 'tripleSlashReference'
messageId: 'tripleSlashReference',
});
}
});
}
},
};
}
},
});
//# sourceMappingURL=no-triple-slash-reference.js.map
"use strict";
/**
* @fileoverview Disallows the use of type aliases.
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,7 +20,7 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: false
recommended: false,
},
messages: {
noTypeAlias: 'Type {{alias}} are not allowed.',
noCompositionAlias: '{{typeName}} in {{compositionType}} types are not allowed.'
noCompositionAlias: '{{typeName}} in {{compositionType}} types are not allowed.',
},

@@ -41,7 +37,7 @@ schema: [

'in-intersections',
'in-unions-and-intersections'
]
'in-unions-and-intersections',
],
},
allowCallbacks: {
enum: ['always', 'never']
enum: ['always', 'never'],
},

@@ -54,4 +50,4 @@ allowLiterals: {

'in-intersections',
'in-unions-and-intersections'
]
'in-unions-and-intersections',
],
},

@@ -64,9 +60,9 @@ allowMappedTypes: {

'in-intersections',
'in-unions-and-intersections'
]
}
'in-unions-and-intersections',
],
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -78,4 +74,4 @@ defaultOptions: [

allowLiterals: 'never',
allowMappedTypes: 'never'
}
allowMappedTypes: 'never',
},
],

@@ -87,3 +83,3 @@ create(context, [{ allowAliases, allowCallbacks, allowLiterals, allowMappedTypes }]) {

'in-intersections',
'in-unions-and-intersections'
'in-unions-and-intersections',
];

@@ -93,3 +89,3 @@ const compositions = [

'in-intersections',
'in-unions-and-intersections'
'in-unions-and-intersections',
];

@@ -99,3 +95,3 @@ const aliasTypes = [

typescript_estree_1.AST_NODE_TYPES.TSTypeReference,
typescript_estree_1.AST_NODE_TYPES.TSLiteralType
typescript_estree_1.AST_NODE_TYPES.TSLiteralType,
];

@@ -167,4 +163,4 @@ /**

data: {
alias: type || 'aliases'
}
alias: type || 'aliases',
},
};

@@ -179,4 +175,4 @@ }

: 'intersection',
typeName: util.upperCaseFirst(type)
}
typeName: util.upperCaseFirst(type),
},
};

@@ -240,6 +236,6 @@ }

}
}
},
};
}
},
});
//# sourceMappingURL=no-type-alias.js.map
"use strict";
/**
* @fileoverview Warns when a namespace qualifier is unnecessary.
* @author Benjamin Lichtman
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -20,5 +16,2 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const util = __importStar(require("../util"));
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
exports.default = util.createRule({

@@ -31,10 +24,10 @@ name: 'no-unnecessary-qualifier',

recommended: false,
tslintName: 'no-unnecessary-qualifier'
tslintName: 'no-unnecessary-qualifier',
},
fixable: 'code',
messages: {
unnecessaryQualifier: "Qualifier is unnecessary since '{{ name }}' is in scope."
unnecessaryQualifier: "Qualifier is unnecessary since '{{ name }}' is in scope.",
},
schema: [],
type: 'suggestion'
type: 'suggestion',
},

@@ -50,5 +43,2 @@ defaultOptions: [],

const sourceCode = context.getSourceCode();
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
function tryGetAliasedSymbol(symbol, checker) {

@@ -101,7 +91,7 @@ return tsutils.isSymbolFlagSet(symbol, typescript_1.default.SymbolFlags.Alias)

data: {
name: sourceCode.getText(name)
name: sourceCode.getText(name),
},
fix(fixer) {
return fixer.removeRange([qualifier.range[0], name.range[0]]);
}
},
});

@@ -129,5 +119,2 @@ }

}
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {

@@ -152,6 +139,6 @@ TSModuleDeclaration: enterDeclaration,

'TSQualifiedName:exit': resetCurrentNamespaceExpression,
'MemberExpression:exit': resetCurrentNamespaceExpression
'MemberExpression:exit': resetCurrentNamespaceExpression,
};
}
},
});
//# sourceMappingURL=no-unnecessary-qualifier.js.map
"use strict";
/**
* @fileoverview Rule to warn if a type assertion does not change the type of an expression
* @author Benjamin Lichtman
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -27,7 +23,7 @@ if (mod && mod.__esModule) return mod;

recommended: false,
tslintRuleName: 'no-unnecessary-type-assertion'
tslintRuleName: 'no-unnecessary-type-assertion',
},
fixable: 'code',
messages: {
unnecessaryAssertion: 'This assertion is unnecessary since it does not change the type of the expression.'
unnecessaryAssertion: 'This assertion is unnecessary since it does not change the type of the expression.',
},

@@ -41,9 +37,9 @@ schema: [

items: {
type: 'string'
}
}
}
}
type: 'string',
},
},
},
},
],
type: 'suggestion'
type: 'suggestion',
},

@@ -91,5 +87,5 @@ defaultOptions: [{}],

originalNode.expression.end,
originalNode.end
originalNode.end,
]);
}
},
});

@@ -123,9 +119,9 @@ }

originalNode.getStart(),
originalNode.expression.getStart()
originalNode.expression.getStart(),
])
: fixer.removeRange([
originalNode.expression.end,
originalNode.end
originalNode.end,
]);
}
},
});

@@ -144,6 +140,6 @@ }

verifyCast(node, checker);
}
},
};
}
},
});
//# sourceMappingURL=no-unnecessary-type-assertion.js.map
"use strict";
/**
* @fileoverview Prevent TypeScript-specific variables being falsely marked as unused
* @author James Henry
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -28,6 +24,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

category: 'Variables',
recommended: 'warn'
recommended: 'warn',
},
schema: no_unused_vars_1.default.meta.schema,
messages: no_unused_vars_1.default.meta.messages
messages: no_unused_vars_1.default.meta.messages,
},

@@ -85,6 +81,6 @@ defaultOptions: [],

}
}
},
});
}
},
});
//# sourceMappingURL=no-unused-vars.js.map
"use strict";
/**
* @fileoverview Rule to flag use of variables before they are defined
* @author Ilya Volodin
* @author Jed Fox
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -134,6 +129,6 @@ if (mod && mod.__esModule) return mod;

category: 'Variables',
recommended: 'error'
recommended: 'error',
},
messages: {
noUseBeforeDefine: "'{{name}}' was used before it was defined."
noUseBeforeDefine: "'{{name}}' was used before it was defined.",
},

@@ -144,3 +139,3 @@ schema: [

{
enum: ['nofunc']
enum: ['nofunc'],
},

@@ -153,9 +148,9 @@ {

variables: { type: 'boolean' },
typedefs: { type: 'boolean' }
typedefs: { type: 'boolean' },
},
additionalProperties: false
}
]
}
]
additionalProperties: false,
},
],
},
],
},

@@ -167,4 +162,4 @@ defaultOptions: [

variables: true,
typedefs: true
}
typedefs: true,
},
],

@@ -214,3 +209,3 @@ create(context, optionsWithDefault) {

messageId: 'noUseBeforeDefine',
data: reference.identifier
data: reference.identifier,
});

@@ -223,6 +218,6 @@ });

findVariablesInScope(context.getScope());
}
},
};
}
},
});
//# sourceMappingURL=no-use-before-define.js.map
"use strict";
/**
* @fileoverview Disallow unnecessary constructors
* @author Armano <https://github.com/armano2>
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -54,6 +50,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

category: 'Best Practices',
recommended: false
recommended: false,
},
schema: no_useless_constructor_1.default.meta.schema,
messages: no_useless_constructor_1.default.meta.messages
messages: no_useless_constructor_1.default.meta.messages,
},

@@ -71,6 +67,6 @@ defaultOptions: [],

}
}
},
};
}
},
});
//# sourceMappingURL=no-useless-constructor.js.map
"use strict";
/**
* @fileoverview Disallows the use of require statements except in import statements.
* @author Macklin Underdown
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,8 +20,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
noVarReqs: 'Require statement not part of import statement.'
noVarReqs: 'Require statement not part of import statement.',
},
schema: []
schema: [],
},

@@ -42,9 +38,9 @@ defaultOptions: [],

node,
messageId: 'noVarReqs'
messageId: 'noVarReqs',
});
}
}
},
};
}
},
});
//# sourceMappingURL=no-var-requires.js.map
"use strict";
/**
* @fileoverview Use function types instead of interfaces with call signatures
* @author Benjamin Lichtman
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,10 +19,10 @@ if (mod && mod.__esModule) return mod;

recommended: false,
tslintName: 'callable-types'
tslintName: 'callable-types',
},
fixable: 'code',
messages: {
functionTypeOverCallableType: "{{ type }} has only a call signature - use '{{ sigSuggestion }}' instead."
functionTypeOverCallableType: "{{ type }} has only a call signature - use '{{ sigSuggestion }}' instead.",
},
schema: [],
type: 'suggestion'
type: 'suggestion',
},

@@ -111,7 +107,7 @@ defaultOptions: [],

: 'Interface',
sigSuggestion: suggestion
sigSuggestion: suggestion,
},
fix(fixer) {
return fixer.replaceTextRange([fixStart, node.range[1]], suggestion);
}
},
});

@@ -128,6 +124,6 @@ }

checkMember(node.members[0], node);
}
},
};
}
},
});
//# sourceMappingURL=prefer-function-type.js.map
"use strict";
/**
* @fileoverview Prefer an interface declaration over a type literal (type T = { ... })
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,9 +19,9 @@ if (mod && mod.__esModule) return mod;

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},
fixable: 'code',
messages: {
interfaceOverType: 'Use an interface instead of a type literal.'
interfaceOverType: 'Use an interface instead of a type literal.',
},
schema: []
schema: [],
},

@@ -56,8 +52,8 @@ defaultOptions: [],

return fixes;
}
},
});
}
},
};
}
},
});
//# sourceMappingURL=prefer-interface.js.map
"use strict";
/**
* @fileoverview Enforces the use of the keyword `namespace` over `module` to declare custom TypeScript modules.
* @author Patricio Trevino
* @author Armano <https://github.com/armano2>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -25,9 +20,9 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
fixable: 'code',
messages: {
useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules."
useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.",
},
schema: []
schema: [],
},

@@ -53,9 +48,9 @@ defaultOptions: [],

return fixer.replaceText(moduleType, 'namespace');
}
},
});
}
}
},
};
}
},
});
//# sourceMappingURL=prefer-namespace-keyword.js.map
"use strict";
/**
* @fileoverview Requires any function or method that returns a Promise to be marked async
* @author Josh Goldberg <https://github.com/joshuakgoldberg>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -23,6 +19,6 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: 'error'
recommended: 'error',
},
messages: {
missingAsync: 'Functions that return promises must be async.'
missingAsync: 'Functions that return promises must be async.',
},

@@ -36,21 +32,21 @@ schema: [

items: {
type: 'string'
}
type: 'string',
},
},
checkArrowFunctions: {
type: 'boolean'
type: 'boolean',
},
checkFunctionDeclarations: {
type: 'boolean'
type: 'boolean',
},
checkFunctionExpressions: {
type: 'boolean'
type: 'boolean',
},
checkMethodDeclarations: {
type: 'boolean'
}
type: 'boolean',
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -63,9 +59,9 @@ defaultOptions: [

checkFunctionExpressions: true,
checkMethodDeclarations: true
}
checkMethodDeclarations: true,
},
],
create(context, [{ allowedPromiseNames, checkArrowFunctions, checkFunctionDeclarations, checkFunctionExpressions, checkMethodDeclarations }]) {
create(context, [{ allowedPromiseNames, checkArrowFunctions, checkFunctionDeclarations, checkFunctionExpressions, checkMethodDeclarations, },]) {
const allAllowedPromiseNames = new Set([
'Promise',
...allowedPromiseNames
...allowedPromiseNames,
]);

@@ -88,3 +84,3 @@ const parserServices = util.getParserServices(context);

messageId: 'missingAsync',
node
node,
});

@@ -114,6 +110,6 @@ }

}
}
},
};
}
},
});
//# sourceMappingURL=promise-function-async.js.map
"use strict";
/**
* @fileoverview Enforce giving `compare` argument to `Array#sort`
* @author Toru Nagashima <https://github.com/mysticatea>
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -24,8 +20,8 @@ if (mod && mod.__esModule) return mod;

category: 'Best Practices',
recommended: false
recommended: false,
},
messages: {
requireCompare: "Require 'compare' argument."
requireCompare: "Require 'compare' argument.",
},
schema: []
schema: [],
},

@@ -53,6 +49,6 @@ create(context) {

}
}
},
};
}
},
});
//# sourceMappingURL=require-array-sort-compare.js.map
"use strict";
/**
* @fileoverview When adding two variables, operands must both be of type number or of type string.
* @author James Henry
* @author Armano <https://github.com/armano2>
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {

@@ -15,2 +13,3 @@ if (mod && mod.__esModule) return mod;

Object.defineProperty(exports, "__esModule", { value: true });
const typescript_1 = __importDefault(require("typescript"));
const util = __importStar(require("../util"));

@@ -25,9 +24,10 @@ exports.default = util.createRule({

category: 'Best Practices',
recommended: false
recommended: false,
},
messages: {
notNumbers: "Operands of '+' operation must either be both strings or both numbers.",
notStrings: "Operands of '+' operation must either be both strings or both numbers. Consider using a template literal."
notStrings: "Operands of '+' operation must either be both strings or both numbers. Consider using a template literal.",
notBigInts: "Operands of '+' operation must be both bigints.",
},
schema: []
schema: [],
},

@@ -50,2 +50,6 @@ defaultOptions: [],

}
// is BigIntLiteral
if (type.flags & typescript_1.default.TypeFlags.BigIntLiteral) {
return 'bigint';
}
if (type.isUnion()) {

@@ -80,16 +84,22 @@ const types = type.types.map(getBaseTypeOfLiteralType);

node,
messageId: 'notStrings'
messageId: 'notStrings',
});
}
else if (leftType === 'bigint' || rightType === 'bigint') {
context.report({
node,
messageId: 'notBigInts',
});
}
else {
context.report({
node,
messageId: 'notNumbers'
messageId: 'notNumbers',
});
}
}
}
},
};
}
},
});
//# sourceMappingURL=restrict-plus-operands.js.map
"use strict";
/**
* @fileoverview Enforces spacing around type annotations.
* @author Nicholas C. Zakas
* @author Patricio Trevino
*/
var __importStar = (this && this.__importStar) || function (mod) {

@@ -20,5 +15,5 @@ if (mod && mod.__esModule) return mod;

before: { type: 'boolean' },
after: { type: 'boolean' }
after: { type: 'boolean' },
},
additionalProperties: false
additionalProperties: false,
};

@@ -33,3 +28,3 @@ exports.default = util.createRule({

category: 'Stylistic Issues',
recommended: 'error'
recommended: 'error',
},

@@ -41,3 +36,3 @@ fixable: 'whitespace',

unexpectedSpaceAfter: "Unexpected a space after the '{{type}}'.",
unexpectedSpaceBefore: "Unexpected a space before the '{{type}}'."
unexpectedSpaceBefore: "Unexpected a space before the '{{type}}'.",
},

@@ -54,10 +49,10 @@ schema: [

colon: definition,
arrow: definition
arrow: definition,
},
additionalProperties: false
}
additionalProperties: false,
},
},
additionalProperties: false
}
]
additionalProperties: false,
},
],
},

@@ -67,3 +62,3 @@ defaultOptions: [

// that if we apply them here, it will break the no override case.
{}
{},
],

@@ -110,7 +105,7 @@ create(context, [options]) {

data: {
type
type,
},
fix(fixer) {
return fixer.insertTextAfter(punctuatorTokenEnd, ' ');
}
},
});

@@ -123,3 +118,3 @@ }

data: {
type
type,
},

@@ -129,5 +124,5 @@ fix(fixer) {

punctuatorTokenEnd.range[1],
nextToken.range[0]
nextToken.range[0],
]);
}
},
});

@@ -140,7 +135,7 @@ }

data: {
type
type,
},
fix(fixer) {
return fixer.insertTextAfter(previousToken, ' ');
}
},
});

@@ -153,3 +148,3 @@ }

data: {
type
type,
},

@@ -159,5 +154,5 @@ fix(fixer) {

previousToken.range[1],
punctuatorTokenStart.range[0]
punctuatorTokenStart.range[0],
]);
}
},
});

@@ -174,6 +169,6 @@ }

checkTypeAnnotationSpacing(node.typeAnnotation);
}
},
};
}
},
});
//# sourceMappingURL=type-annotation-spacing.js.map

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

// TODO - when the above rule lands; add type checking for the context.report `data` property
function createRule({ name, meta, defaultOptions, create }) {
function createRule({ name, meta, defaultOptions, create, }) {
return {
meta: Object.assign({}, meta, { docs: Object.assign({}, meta.docs, { url: `https://github.com/typescript-eslint/typescript-eslint/blob/${version}/packages/eslint-plugin/docs/rules/${name}.md`, extraDescription: meta.docs.tslintName
meta: Object.assign({}, meta, { docs: Object.assign({}, meta.docs, { url: `https://github.com/typescript-eslint/typescript-eslint/blob/v${version}/packages/eslint-plugin/docs/rules/${name}.md`, extraDescription: meta.docs.tslintName
? [`\`${meta.docs.tslintName}\` from TSLint`]

@@ -17,3 +17,3 @@ : undefined }) }),

return create(context, optionsWithDefault);
}
},
};

@@ -20,0 +20,0 @@ }

{
"name": "@typescript-eslint/eslint-plugin",
"version": "1.4.1",
"version": "1.4.2-alpha.0+d362c4a",
"description": "TypeScript plugin for ESLint",

@@ -38,4 +38,4 @@ "keywords": [

"dependencies": {
"@typescript-eslint/parser": "1.4.1",
"@typescript-eslint/typescript-estree": "1.4.1",
"@typescript-eslint/parser": "1.4.2-alpha.0+d362c4a",
"@typescript-eslint/typescript-estree": "1.4.2-alpha.0+d362c4a",
"requireindex": "^1.2.0",

@@ -42,0 +42,0 @@ "tsutils": "^3.7.0"

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

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

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

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