Skip to content

Commit

Permalink
chore: update dependencies (#3467)
Browse files Browse the repository at this point in the history
* chore: update dependencies

I bumped all of the version numbers to the latest, and unbroke the build due to prettier changes.

* chore: deduplicate packages

* chore: fix lint
  • Loading branch information
bradzacher committed May 30, 2021
1 parent 258116b commit b1d4449
Show file tree
Hide file tree
Showing 81 changed files with 2,476 additions and 2,488 deletions.
45 changes: 26 additions & 19 deletions package.json
Expand Up @@ -71,51 +71,58 @@
"node": "^10.12.0 || >=12.0.0"
},
"devDependencies": {
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@commitlint/config-lerna-scopes": "^12.0.1",
"@babel/code-frame": "^7.12.13",
"@babel/parser": "^7.14.4",
"@babel/types": "^7.14.4",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/config-lerna-scopes": "^12.1.4",
"@types/babel__code-frame": "^7.0.2",
"@types/debug": "^4.1.5",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/glob": "^7.1.3",
"@types/is-glob": "^4.0.1",
"@types/jest": "^26.0.20",
"@types/jest": "^26.0.23",
"@types/jest-specific-snapshot": "^0.5.5",
"@types/lodash": "^4.14.149",
"@types/marked": "^2.0.0",
"@types/node": "^15.0.2",
"@types/lodash": "^4.14.170",
"@types/marked": "^2.0.3",
"@types/node": "^15.6.1",
"@types/node-fetch": "^2.5.10",
"@types/prettier": "^2.2.1",
"@types/prettier": "^2.2.3",
"@types/rimraf": "^3.0.0",
"@types/semver": "^7.3.4",
"@types/semver": "^7.3.6",
"@types/tmp": "^0.2.0",
"all-contributors-cli": "^6.20.0",
"cspell": "^5.2.4",
"cspell": "^5.5.2",
"cz-conventional-changelog": "^3.3.0",
"downlevel-dts": "^0.7.0",
"eslint": "^7.20.0",
"eslint": "^7.27.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^3.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-eslint-plugin": "^3.0.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-simple-import-sort": "^7.0.0",
"glob": "^7.1.6",
"glob": "^7.1.7",
"husky": "^5.0.9",
"jest": "^26.6.3",
"jest-specific-snapshot": "^4.0.0",
"jest": "^27.0.3",
"jest-specific-snapshot": "^5.0.0",
"lerna": "^3.22.1",
"lint-staged": "^11.0.0",
"make-dir": "^3.1.0",
"markdownlint-cli": "^0.27.1",
"node-fetch": "^2.6.1",
"prettier": "^2.2.1",
"prettier": "^2.3.0",
"pretty-format": "^27.0.2",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.1",
"ts-jest": "^27.0.1",
"ts-node": "^10.0.0",
"tslint": "^6.1.3",
"typescript": ">=3.3.1 <4.4.0"
},
"resolutions": {
"@types/node": "^15.6.1",
"jest-diff": "^27.0.0",
"pretty-format": "^27.0.0",
"typescript": "4.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/ast-spec/package.json
Expand Up @@ -41,6 +41,6 @@
"url": "https://opencollective.com/typescript-eslint"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.13.2"
"@microsoft/api-extractor": "^7.15.2"
}
}
Expand Up @@ -53,9 +53,8 @@ export default createRule({
},
defaultOptions: [],
create(context) {
const { program, esTreeNodeToTSNodeMap } = ESLintUtils.getParserServices(
context,
);
const { program, esTreeNodeToTSNodeMap } =
ESLintUtils.getParserServices(context);
const checker = program.getTypeChecker();

return {
Expand Down
Expand Up @@ -490,7 +490,8 @@ export default createRule<Options, MessageIds>({

return {
// valid
'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest,
'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression':
checkValidTest,
// invalid - errors
[invalidTestsSelectorPath.join(' > ')]: checkInvalidTest,
// invalid - suggestions
Expand All @@ -504,7 +505,8 @@ export default createRule<Options, MessageIds>({
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
// special case for our batchedSingleLineTests utility
'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest,
'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
checkInvalidTest,
};
},
});
2 changes: 1 addition & 1 deletion packages/eslint-plugin-tslint/package.json
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@typescript-eslint/experimental-utils": "4.25.0",
"lodash": "^4.17.15"
"lodash": "^4.17.21"
},
"peerDependencies": {
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/eslint-plugin/package.json
Expand Up @@ -46,19 +46,19 @@
"dependencies": {
"@typescript-eslint/experimental-utils": "4.25.0",
"@typescript-eslint/scope-manager": "4.25.0",
"debug": "^4.1.1",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"lodash": "^4.17.15",
"regexpp": "^3.0.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
"lodash": "^4.17.21",
"regexpp": "^3.1.0",
"semver": "^7.3.5",
"tsutils": "^3.21.0"
},
"devDependencies": {
"@types/debug": "*",
"@types/marked": "*",
"@types/prettier": "*",
"chalk": "^4.0.0",
"marked": "^2.0.0",
"chalk": "^4.1.1",
"marked": "^2.0.6",
"prettier": "*",
"typescript": "*"
},
Expand Down
6 changes: 4 additions & 2 deletions packages/eslint-plugin/src/rules/ban-ts-comment.ts
Expand Up @@ -102,8 +102,10 @@ export default util.createRule<[Options], MessageIds>({
The regex used are taken from the ones used in the official TypeScript repo -
https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L281-L289
*/
const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const commentDirectiveRegExSingleLine =
/^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const commentDirectiveRegExMultiLine =
/^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const sourceCode = context.getSourceCode();

return {
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin/src/rules/ban-tslint-comment.ts
Expand Up @@ -3,7 +3,8 @@ import * as util from '../util';

// tslint regex
// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32
const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
const ENABLE_DISABLE_REGEX =
/^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;

const toText = (
text: string,
Expand Down
21 changes: 8 additions & 13 deletions packages/eslint-plugin/src/rules/brace-style.ts
Expand Up @@ -26,10 +26,8 @@ export default createRule<Options, MessageIds>({
},
defaultOptions: ['1tbs'],
create(context) {
const [
style,
{ allowSingleLine } = { allowSingleLine: false },
] = context.options;
const [style, { allowSingleLine } = { allowSingleLine: false }] =
context.options;

const isAllmanStyle = style === 'allman';
const sourceCode = context.getSourceCode();
Expand All @@ -49,15 +47,12 @@ export default createRule<Options, MessageIds>({
return;
}

const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(
openingCurlyToken,
)!;
const tokenBeforeClosingCurly = sourceCode.getTokenBefore(
closingCurlyToken,
)!;
const tokenAfterOpeningCurly = sourceCode.getTokenAfter(
openingCurlyToken,
)!;
const tokenBeforeOpeningCurly =
sourceCode.getTokenBefore(openingCurlyToken)!;
const tokenBeforeClosingCurly =
sourceCode.getTokenBefore(closingCurlyToken)!;
const tokenAfterOpeningCurly =
sourceCode.getTokenAfter(openingCurlyToken)!;

if (
!isAllmanStyle &&
Expand Down
34 changes: 14 additions & 20 deletions packages/eslint-plugin/src/rules/consistent-type-imports.ts
Expand Up @@ -254,9 +254,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';

// we have a mixed type/value import, so we need to split them out into multiple exports
const importNames = (isTypeImport
? report.valueSpecifiers
: report.typeSpecifiers
const importNames = (
isTypeImport
? report.valueSpecifiers
: report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);

const message = ((): {
Expand Down Expand Up @@ -342,9 +343,7 @@ export default util.createRule<Options, MessageIds>({
: {}),
};

function classifySpecifier(
node: TSESTree.ImportDeclaration,
): {
function classifySpecifier(node: TSESTree.ImportDeclaration): {
defaultSpecifier: TSESTree.ImportDefaultSpecifier | null;
namespaceSpecifier: TSESTree.ImportNamespaceSpecifier | null;
namedSpecifiers: TSESTree.ImportSpecifier[];
Expand All @@ -358,10 +357,11 @@ export default util.createRule<Options, MessageIds>({
(specifier): specifier is TSESTree.ImportNamespaceSpecifier =>
specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,
) ?? null;
const namedSpecifiers: TSESTree.ImportSpecifier[] = node.specifiers.filter(
(specifier): specifier is TSESTree.ImportSpecifier =>
specifier.type === AST_NODE_TYPES.ImportSpecifier,
);
const namedSpecifiers: TSESTree.ImportSpecifier[] =
node.specifiers.filter(
(specifier): specifier is TSESTree.ImportSpecifier =>
specifier.type === AST_NODE_TYPES.ImportSpecifier,
);
return {
defaultSpecifier,
namespaceSpecifier,
Expand Down Expand Up @@ -526,11 +526,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;

const {
defaultSpecifier,
namespaceSpecifier,
namedSpecifiers,
} = classifySpecifier(node);
const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
classifySpecifier(node);

if (namespaceSpecifier && !defaultSpecifier) {
// e.g.
Expand Down Expand Up @@ -737,11 +734,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;

const {
defaultSpecifier,
namespaceSpecifier,
namedSpecifiers,
} = classifySpecifier(node);
const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
classifySpecifier(node);

if (namespaceSpecifier) {
// e.g.
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/dot-notation.ts
Expand Up @@ -93,8 +93,8 @@ export default createRule<Options, MessageIds>({
const propertySymbol = typeChecker.getSymbolAtLocation(
esTreeNodeToTSNodeMap.get(node.property),
);
const modifierKind = propertySymbol?.getDeclarations()?.[0]
?.modifiers?.[0].kind;
const modifierKind =
propertySymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind;
if (
(allowPrivateClassPropertyAccess &&
modifierKind == ts.SyntaxKind.PrivateKeyword) ||
Expand Down
Expand Up @@ -175,9 +175,8 @@ export default util.createRule<Options, MessageIds>({
token.type === AST_TOKEN_TYPES.Keyword &&
token.value === 'public'
) {
const commensAfterPublicKeyword = sourceCode.getCommentsAfter(
token,
);
const commensAfterPublicKeyword =
sourceCode.getCommentsAfter(token);
if (commensAfterPublicKeyword.length) {
// public /* Hi there! */ static foo()
// ^^^^^^^
Expand Down
15 changes: 6 additions & 9 deletions packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
Expand Up @@ -1015,9 +1015,8 @@ export default createRule<Options, MessageIds>({
token.type === AST_TOKEN_TYPES.Punctuator && token.value === ':',
)!;

const firstConsequentToken = sourceCode.getTokenAfter(
questionMarkToken,
)!;
const firstConsequentToken =
sourceCode.getTokenAfter(questionMarkToken)!;
const lastConsequentToken = sourceCode.getTokenBefore(colonToken)!;
const firstAlternateToken = sourceCode.getTokenAfter(colonToken)!;

Expand Down Expand Up @@ -1207,9 +1206,8 @@ export default createRule<Options, MessageIds>({
node.property,
isNotClosingParenToken,
)!;
const secondNonObjectToken = sourceCode.getTokenAfter(
firstNonObjectToken,
)!;
const secondNonObjectToken =
sourceCode.getTokenAfter(firstNonObjectToken)!;

const objectParenCount = sourceCode.getTokensBetween(
object,
Expand Down Expand Up @@ -1677,9 +1675,8 @@ export default createRule<Options, MessageIds>({
return;
}

const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(
lineNumber,
)!;
const firstTokenOfLine =
tokenInfo.firstTokensByLineNumber.get(lineNumber)!;

if (firstTokenOfLine.loc.start.line !== lineNumber) {
// Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice.
Expand Down
7 changes: 3 additions & 4 deletions packages/eslint-plugin/src/rules/indent.ts
Expand Up @@ -241,10 +241,9 @@ export default util.createRule<Options, MessageIds>({
// transform it to an ObjectExpression
return rules['ObjectExpression, ObjectPattern']({
type: AST_NODE_TYPES.ObjectExpression,
properties: (node.members as (
| TSESTree.TSEnumMember
| TSESTree.TypeElement
)[]).map(
properties: (
node.members as (TSESTree.TSEnumMember | TSESTree.TypeElement)[]
).map(
member =>
TSPropertySignatureToProperty(member) as TSESTree.Property,
),
Expand Down
13 changes: 7 additions & 6 deletions packages/eslint-plugin/src/rules/method-signature-style.ts
Expand Up @@ -130,12 +130,13 @@ export default util.createRule<Options, MessageIds>({
? parent.members
: [];

const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter(
(element): element is TSESTree.TSMethodSignature =>
element.type === AST_NODE_TYPES.TSMethodSignature &&
element !== methodNode &&
getMethodKey(element) === getMethodKey(methodNode),
);
const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] =
members.filter(
(element): element is TSESTree.TSMethodSignature =>
element.type === AST_NODE_TYPES.TSMethodSignature &&
element !== methodNode &&
getMethodKey(element) === getMethodKey(methodNode),
);
const isParentModule = isNodeParentModuleDeclaration(methodNode);

if (duplicatedKeyMethodNodes.length > 0) {
Expand Down
Expand Up @@ -32,8 +32,10 @@ export default util.createRule({

return {
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
'MemberExpression[optional = true] > TSNonNullExpression.object':
checkExtraNonNullAssertion,
'CallExpression[optional = true] > TSNonNullExpression.callee':
checkExtraNonNullAssertion,
};
},
});

0 comments on commit b1d4449

Please sign in to comment.