Skip to content

Commit 01fb60a

Browse files
committed
update deps
1 parent 39dbe88 commit 01fb60a

16 files changed

+1035
-542
lines changed

package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,37 @@
77
"author": "Daniel Nixon <[email protected]>",
88
"license": "MIT",
99
"devDependencies": {
10-
"@stryker-mutator/core": "6.4.2",
11-
"@stryker-mutator/jest-runner": "6.4.2",
12-
"@stryker-mutator/typescript-checker": "6.4.2",
10+
"@stryker-mutator/core": "7.1.1",
11+
"@stryker-mutator/jest-runner": "7.1.1",
12+
"@stryker-mutator/typescript-checker": "7.1.1",
1313
"@types/eslint": "8.44.2",
1414
"@types/jest": "29.5.4",
1515
"codecov": "3.8.3",
1616
"eslint": "8.48.0",
17-
"eslint-config-prettier": "8.10.0",
18-
"eslint-config-typed-fp": "5.1.0",
19-
"eslint-plugin-functional": "5.0.8",
17+
"eslint-config-prettier": "9.0.0",
18+
"eslint-config-typed-fp": "5.2.1",
19+
"eslint-plugin-functional": "6.0.0",
2020
"eslint-plugin-jest": "27.2.3",
21-
"eslint-plugin-prettier": "4.2.1",
22-
"eslint-plugin-sonarjs": "0.19.0",
21+
"eslint-plugin-prettier": "5.0.0",
22+
"eslint-plugin-sonarjs": "0.21.0",
2323
"eslint-plugin-total-functions": "7.0.7",
2424
"jest": "29.6.4",
25-
"patch-package": "6.5.1",
26-
"prettier": "2.8.8",
25+
"prettier": "3.0.3",
2726
"ts-jest": "29.1.1",
2827
"type-coverage": "2.26.2",
2928
"typescript": "5.2.2"
3029
},
3130
"dependencies": {
32-
"@typescript-eslint/eslint-plugin": "^5.56.0",
33-
"@typescript-eslint/parser": "^5.56.0",
34-
"@typescript-eslint/type-utils": "^5.56.0",
35-
"@typescript-eslint/utils": "^5.56.0",
31+
"@typescript-eslint/eslint-plugin": "^5.62.0",
32+
"@typescript-eslint/parser": "^5.62.0",
33+
"@typescript-eslint/type-utils": "^5.62.0",
34+
"@typescript-eslint/utils": "^5.62.0",
3635
"is-immutable-type": "^1.2.9",
3736
"tsutils": "^3.21.0"
3837
},
3938
"peerDependencies": {
40-
"eslint": "^8.36.0",
41-
"typescript": "^5.0.2"
39+
"eslint": "^8.48.0",
40+
"typescript": "^5.2.2"
4241
},
4342
"scripts": {
4443
"build": "tsc",

src/rules/common.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Type, TypeChecker } from "typescript";
99

1010
export const createRule = ESLintUtils.RuleCreator(
1111
// eslint-disable-next-line functional/functional-parameters
12-
() => "https://github.com/danielnixon/eslint-plugin-total-functions"
12+
() => "https://github.com/danielnixon/eslint-plugin-total-functions",
1313
);
1414

1515
export const typeSymbolName = (type: Type): string | undefined => {
@@ -37,7 +37,7 @@ export type TypePair = {
3737
export const assignableTypePairs = (
3838
rawDestinationType: Type,
3939
rawSourceType: Type,
40-
checker: TypeChecker
40+
checker: TypeChecker,
4141
): readonly TypePair[] => {
4242
const destinationTypeParts = unionTypeParts(rawDestinationType);
4343

@@ -46,15 +46,15 @@ export const assignableTypePairs = (
4646
return sourceTypeParts.flatMap((sourceTypePart) =>
4747
destinationTypeParts
4848
.filter((destinationTypePart) =>
49-
checker.isTypeAssignableTo(sourceTypePart, destinationTypePart)
49+
checker.isTypeAssignableTo(sourceTypePart, destinationTypePart),
5050
)
5151
.map(
5252
(destinationTypePart) =>
5353
({
5454
sourceType: sourceTypePart,
5555
destinationType: destinationTypePart,
56-
} as const)
57-
)
56+
}) as const,
57+
),
5858
);
5959
};
6060

src/rules/fp-ts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type FpTsEffectType = {
2727

2828
const fpTsEffectTypeParameter = (
2929
effectName: string,
30-
effectType: Type
30+
effectType: Type,
3131
): Type | undefined => {
3232
// eslint-disable-next-line functional/no-conditional-statements
3333
if (effectName === "IO") {

src/rules/no-hidden-type-assertions.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const noHiddenTypeAssertions = createRule({
5050
const checker = parserServices.program.getTypeChecker();
5151

5252
const hasTypeNode = (
53-
typeElement: TypeElement
53+
typeElement: TypeElement,
5454
): typeElement is TypeElement & { readonly type: TypeNode } => {
5555
// eslint-disable-next-line functional/no-try-statements
5656
try {
@@ -65,7 +65,7 @@ const noHiddenTypeAssertions = createRule({
6565

6666
const explodeTypeNode = (
6767
type: TypeNode,
68-
depth: number
68+
depth: number,
6969
// eslint-disable-next-line sonarjs/cognitive-complexity
7070
): readonly TypeNode[] => {
7171
// TODO write a test that exercises this
@@ -103,11 +103,11 @@ const noHiddenTypeAssertions = createRule({
103103

104104
const parametersToTypeNodes = (
105105
parameters: NodeArray<ParameterDeclaration>,
106-
depth: number
106+
depth: number,
107107
): readonly TypeNode[] => {
108108
return parameters
109109
.flatMap((parameter) =>
110-
parameter.type !== undefined ? [parameter.type] : []
110+
parameter.type !== undefined ? [parameter.type] : [],
111111
)
112112
.flatMap((parameter) => explodeTypeNode(parameter, depth));
113113
};
@@ -135,7 +135,7 @@ const noHiddenTypeAssertions = createRule({
135135
const typeParameters = callSignature.declaration.typeParameters;
136136
const parameters = parametersToTypeNodes(
137137
callSignature.declaration.parameters,
138-
0
138+
0,
139139
);
140140

141141
const returnType = callSignature.declaration.type;
@@ -162,8 +162,8 @@ const noHiddenTypeAssertions = createRule({
162162
isTypeReferenceNode(returnType) &&
163163
returnType.typeName.kind === SyntaxKind.Identifier &&
164164
returnType.typeName.text ===
165-
typeParameter.typeParameter.name.text
166-
)
165+
typeParameter.typeParameter.name.text,
166+
),
167167
);
168168

169169
// Of all the type parameters that appear in the return type,

src/rules/no-nested-fp-ts-effects.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const noNestedFpTsEffects = createRule({
4545
effectType.effectTypeParameter !== undefined
4646
) {
4747
const effectTypeParameterName = typeSymbolName(
48-
effectType.effectTypeParameter
48+
effectType.effectTypeParameter,
4949
);
5050
// eslint-disable-next-line functional/no-conditional-statements
5151
if (effectTypeParameterName === undefined) {
@@ -56,7 +56,7 @@ const noNestedFpTsEffects = createRule({
5656
const isNestedPromise = isThenableType(
5757
checker,
5858
tsNode,
59-
effectType.effectTypeParameter
59+
effectType.effectTypeParameter,
6060
);
6161

6262
// eslint-disable-next-line functional/no-conditional-statements

src/rules/no-partial-array-reduce.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const noPartialArrayReduce = createRule({
5151
}
5252

5353
const objectType = checker.getTypeAtLocation(
54-
parserServices.esTreeNodeToTSNodeMap.get(node.callee.object)
54+
parserServices.esTreeNodeToTSNodeMap.get(node.callee.object),
5555
);
5656

5757
const typeParts = unionTypeParts(objectType);
@@ -63,7 +63,7 @@ const noPartialArrayReduce = createRule({
6363
(t) =>
6464
checker.isArrayType(t) ||
6565
isTupleType(t) ||
66-
isTupleTypeReference(t)
66+
isTupleTypeReference(t),
6767
)
6868
) {
6969
return;
@@ -111,11 +111,11 @@ const noPartialArrayReduce = createRule({
111111
node.callee.computed &&
112112
unionTypeParts(
113113
checker.getTypeAtLocation(
114-
parserServices.esTreeNodeToTSNodeMap.get(node.callee.property)
115-
)
114+
parserServices.esTreeNodeToTSNodeMap.get(node.callee.property),
115+
),
116116
).some(
117117
(type) =>
118-
type.isStringLiteral() && unsafeMethods.includes(type.value)
118+
type.isStringLiteral() && unsafeMethods.includes(type.value),
119119
));
120120

121121
// eslint-disable-next-line functional/no-conditional-statements

src/rules/no-partial-division.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const noPartialDivision = createRule({
5151
// eslint-disable-next-line functional/no-conditional-statements
5252
if (type.isIntersection()) {
5353
const numberLiteralParts = intersectionTypeParts(type).filter(
54-
(t) => isBigIntLiteral(t) || t.isNumberLiteral()
54+
(t) => isBigIntLiteral(t) || t.isNumberLiteral(),
5555
);
5656
return (
5757
numberLiteralParts.length > 0 &&
@@ -92,7 +92,7 @@ const noPartialDivision = createRule({
9292
// eslint-disable-next-line functional/no-conditional-statements
9393
if (node.right.type === AST_NODE_TYPES.Identifier) {
9494
const denominatorNode = parserServices.esTreeNodeToTSNodeMap.get(
95-
node.right
95+
node.right,
9696
);
9797
const denominatorNodeType =
9898
checker.getTypeAtLocation(denominatorNode);

src/rules/no-partial-string-normalize.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const noPartialStringNormalize = createRule({
4040
}
4141

4242
const objectType = checker.getTypeAtLocation(
43-
parserServices.esTreeNodeToTSNodeMap.get(node.callee.object)
43+
parserServices.esTreeNodeToTSNodeMap.get(node.callee.object),
4444
);
4545

4646
// We only care if this call is on a string object.
@@ -73,10 +73,10 @@ const noPartialStringNormalize = createRule({
7373
node.callee.computed &&
7474
unionTypeParts(
7575
checker.getTypeAtLocation(
76-
parserServices.esTreeNodeToTSNodeMap.get(node.callee.property)
77-
)
76+
parserServices.esTreeNodeToTSNodeMap.get(node.callee.property),
77+
),
7878
).some(
79-
(type) => type.isStringLiteral() && type.value === "normalize"
79+
(type) => type.isStringLiteral() && type.value === "normalize",
8080
));
8181

8282
// We only care if this call is to the normalize method.
@@ -118,12 +118,12 @@ const noPartialStringNormalize = createRule({
118118
argument.type === AST_NODE_TYPES.Identifier &&
119119
unionTypeParts(
120120
checker.getTypeAtLocation(
121-
parserServices.esTreeNodeToTSNodeMap.get(argument)
122-
)
121+
parserServices.esTreeNodeToTSNodeMap.get(argument),
122+
),
123123
).every(
124124
(type) =>
125125
(type.isStringLiteral() && safeValues.includes(type.value)) ||
126-
isTypeFlagSet(type, TypeFlags.Undefined)
126+
isTypeFlagSet(type, TypeFlags.Undefined),
127127
)
128128
) {
129129
return;

src/rules/no-partial-url-constructor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const noPartialUrlConstructor = createRule({
4747
}
4848

4949
const objectNode = parserServices.esTreeNodeToTSNodeMap.get(
50-
node.callee
50+
node.callee,
5151
);
5252
const objectType = checker.getTypeAtLocation(objectNode);
5353

src/rules/no-premature-fp-ts-effects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const noPrematureFpTsEffects = createRule({
3434
}
3535

3636
const calleeNode = parserServices.esTreeNodeToTSNodeMap.get(
37-
node.callee
37+
node.callee,
3838
);
3939
const calleeType = checker.getTypeAtLocation(calleeNode);
4040

src/rules/no-unsafe-mutable-readonly-assignment.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const noUnsafeMutableReadonlyAssignment = createRule({
3737
checker: TypeChecker,
3838
rawDestinationType: Type,
3939
rawSourceType: Type,
40-
sourceNode: TSESTree.Expression | undefined
40+
sourceNode: TSESTree.Expression | undefined,
4141
) => {
4242
// eslint-disable-next-line functional/no-conditional-statements
4343
if (isLiteral(sourceNode)) {
@@ -47,7 +47,7 @@ const noUnsafeMutableReadonlyAssignment = createRule({
4747
const typePairs = assignableTypePairs(
4848
rawDestinationType,
4949
rawSourceType,
50-
checker
50+
checker,
5151
);
5252

5353
// TODO support config
@@ -84,12 +84,12 @@ const noUnsafeMutableReadonlyAssignment = createRule({
8484
const destinationImmutability = getTypeImmutability(
8585
checker,
8686
destinationType,
87-
overrides
87+
overrides,
8888
);
8989
const sourceImmutability = getTypeImmutability(
9090
checker,
9191
sourceType,
92-
overrides
92+
overrides,
9393
);
9494

9595
const isUnsafe =
@@ -102,7 +102,7 @@ const noUnsafeMutableReadonlyAssignment = createRule({
102102
});
103103

104104
return allSafe ? "safe" : "unsafe";
105-
}
105+
},
106106
),
107107
defaultOptions: [],
108108
} as const);

src/rules/no-unsafe-readonly-mutable-assignment.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const noUnsafeReadonlyMutableAssignment = createRule({
3737
checker: TypeChecker,
3838
rawDestinationType: Type,
3939
rawSourceType: Type,
40-
sourceNode: TSESTree.Expression | undefined
40+
sourceNode: TSESTree.Expression | undefined,
4141
) => {
4242
// eslint-disable-next-line functional/no-conditional-statements
4343
if (isLiteral(sourceNode)) {
@@ -47,7 +47,7 @@ const noUnsafeReadonlyMutableAssignment = createRule({
4747
const typePairs = assignableTypePairs(
4848
rawDestinationType,
4949
rawSourceType,
50-
checker
50+
checker,
5151
);
5252

5353
// TODO support config
@@ -84,12 +84,12 @@ const noUnsafeReadonlyMutableAssignment = createRule({
8484
const destinationImmutability = getTypeImmutability(
8585
checker,
8686
destinationType,
87-
overrides
87+
overrides,
8888
);
8989
const sourceImmutability = getTypeImmutability(
9090
checker,
9191
sourceType,
92-
overrides
92+
overrides,
9393
);
9494

9595
const isUnsafe =
@@ -102,7 +102,7 @@ const noUnsafeReadonlyMutableAssignment = createRule({
102102
});
103103

104104
return allSafe ? "safe" : "unsafe";
105-
}
105+
},
106106
),
107107
defaultOptions: [],
108108
} as const);

src/rules/no-unsafe-type-assertion.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const noUnsafeTypeAssertion = createRule({
2727

2828
const isUnsafe = (
2929
rawDestinationType: ts.Type,
30-
rawSourceType: ts.Type
30+
rawSourceType: ts.Type,
3131
): boolean => {
3232
// eslint-disable-next-line functional/no-conditional-statements
3333
if (
@@ -42,7 +42,7 @@ const noUnsafeTypeAssertion = createRule({
4242
};
4343

4444
const reportUnsafe = (
45-
node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression
45+
node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression,
4646
// eslint-disable-next-line functional/no-return-void
4747
): void => {
4848
// The right hand side of the "as".

0 commit comments

Comments
 (0)