Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de29366

Browse files
authored
chore: bump prettier from 2.1.1 to 2.2.1 (typescript-eslint#3034)
* chore: bump prettier from 2.1.1 to 2.2.1 * test(eslint-plugin): disable formatting some of tests
1 parent 97a2e36 commit de29366

File tree

9 files changed

+35
-56
lines changed

9 files changed

+35
-56
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"lint-staged": "^10.2.13",
102102
"make-dir": "^3.1.0",
103103
"markdownlint-cli": "^0.23.2",
104-
"prettier": "^2.1.1",
104+
"prettier": "^2.2.1",
105105
"rimraf": "^3.0.2",
106106
"ts-jest": "^26.3.0",
107107
"ts-node": "^9.0.0",

packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
15701570
* 2. Don't set any offsets against the first token of the node.
15711571
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
15721572
*/
1573-
const offsetListeners = Object.keys(baseOffsetListeners).reduce<
1574-
TSESLint.RuleListener
1575-
>(
1573+
const offsetListeners = Object.keys(
1574+
baseOffsetListeners,
1575+
).reduce<TSESLint.RuleListener>(
15761576
/*
15771577
* Offset listener calls are deferred until traversal is finished, and are called as
15781578
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
15901590
* ignored nodes are known.
15911591
*/
15921592
(acc, key) => {
1593-
const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
1594-
TSESTree.Node
1595-
>;
1593+
const listener = baseOffsetListeners[
1594+
key
1595+
] as TSESLint.RuleFunction<TSESTree.Node>;
15961596
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
15971597
acc[key] = node => listenerCallQueue.push({ listener, node });
15981598

packages/eslint-plugin/src/rules/naming-convention-utils/format.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
9696
return !wasUnderscore;
9797
}
9898

99-
const PredefinedFormatToCheckFunction: Readonly<Record<
100-
PredefinedFormats,
101-
(name: string) => boolean
102-
>> = {
99+
const PredefinedFormatToCheckFunction: Readonly<
100+
Record<PredefinedFormats, (name: string) => boolean>
101+
> = {
103102
[PredefinedFormats.PascalCase]: isPascalCase,
104103
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
105104
[PredefinedFormats.camelCase]: isCamelCase,

packages/eslint-plugin/src/rules/semi.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export default util.createRule<Options, MessageIds>({
3636
],
3737
create(context) {
3838
const rules = baseRule.create(context);
39-
const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
40-
TSESTree.Node
41-
>;
39+
const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
4240

4341
/*
4442
The following nodes are handled by the member-delimiter-style rule

packages/eslint-plugin/src/util/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const {
1818
isObjectNotArray,
1919
getParserServices,
2020
} = ESLintUtils;
21-
type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
21+
type InferMessageIdsTypeFromRule<
2222
T
23-
>;
23+
> = ESLintUtils.InferMessageIdsTypeFromRule<T>;
2424
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
2525

2626
export {

packages/eslint-plugin/tests/rules/naming-convention.test.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ const parserOptions = {
1818
project: './tsconfig.json',
1919
};
2020

21-
const formatTestNames: Readonly<Record<
22-
PredefinedFormatsString,
23-
Record<'valid' | 'invalid', string[]>
24-
>> = {
21+
const formatTestNames: Readonly<
22+
Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>
23+
> = {
2524
camelCase: {
2625
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
2726
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
@@ -1132,13 +1131,11 @@ ruleTester.run('naming-convention', rule, {
11321131
{
11331132
const camelCaseVar = 1;
11341133
function camelCaseFunction() {}
1135-
declare function camelCaseDeclaredFunction() {
1136-
};
1134+
declare function camelCaseDeclaredFunction() {};
11371135
}
11381136
const PascalCaseVar = 1;
11391137
function PascalCaseFunction() {}
1140-
declare function PascalCaseDeclaredFunction() {
1141-
};
1138+
declare function PascalCaseDeclaredFunction() {};
11421139
`,
11431140
options: [
11441141
{ selector: 'default', format: ['camelCase'] },
@@ -1991,8 +1988,7 @@ ruleTester.run('naming-convention', rule, {
19911988
code: `
19921989
const PascalCaseVar = 1;
19931990
function PascalCaseFunction() {}
1994-
declare function PascalCaseDeclaredFunction() {
1995-
};
1991+
declare function PascalCaseDeclaredFunction() {};
19961992
`,
19971993
options: [
19981994
{ selector: 'default', format: ['snake_case'] },

packages/eslint-plugin/tests/rules/no-empty-function.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import rule from '../../src/rules/no-empty-function';
2-
import { RuleTester } from '../RuleTester';
2+
import { noFormat, RuleTester } from '../RuleTester';
33

44
const ruleTester = new RuleTester({
55
parser: '@typescript-eslint/parser',
@@ -159,7 +159,7 @@ function foo() {}
159159
],
160160
},
161161
{
162-
code: `
162+
code: noFormat`
163163
@decorator()
164164
function foo() {}
165165
`,

packages/experimental-utils/src/ts-eslint/Rule.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ interface RuleFixer {
115115
type ReportFixFunction = (
116116
fixer: RuleFixer,
117117
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
118-
type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
119-
TMessageIds
120-
>[];
118+
type ReportSuggestionArray<
119+
TMessageIds extends string
120+
> = ReportDescriptorBase<TMessageIds>[];
121121

122122
interface ReportDescriptorBase<TMessageIds extends string> {
123123
/**
@@ -328,29 +328,21 @@ interface RuleListener {
328328
TryStatement?: RuleFunction<TSESTree.TryStatement>;
329329
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
330330
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
331-
TSAbstractMethodDefinition?: RuleFunction<
332-
TSESTree.TSAbstractMethodDefinition
333-
>;
331+
TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
334332
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
335333
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
336334
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
337335
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
338336
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
339337
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
340-
TSCallSignatureDeclaration?: RuleFunction<
341-
TSESTree.TSCallSignatureDeclaration
342-
>;
338+
TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
343339
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
344340
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
345341
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
346-
TSConstructSignatureDeclaration?: RuleFunction<
347-
TSESTree.TSConstructSignatureDeclaration
348-
>;
342+
TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
349343
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
350344
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
351-
TSEmptyBodyFunctionExpression?: RuleFunction<
352-
TSESTree.TSEmptyBodyFunctionExpression
353-
>;
345+
TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
354346
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
355347
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
356348
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +363,7 @@ interface RuleListener {
371363
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
372364
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
373365
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
374-
TSNamespaceExportDeclaration?: RuleFunction<
375-
TSESTree.TSNamespaceExportDeclaration
376-
>;
366+
TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
377367
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
378368
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
379369
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +390,8 @@ interface RuleListener {
400390
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
401391
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
402392
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
403-
TSTypeParameterDeclaration?: RuleFunction<
404-
TSESTree.TSTypeParameterDeclaration
405-
>;
406-
TSTypeParameterInstantiation?: RuleFunction<
407-
TSESTree.TSTypeParameterInstantiation
408-
>;
393+
TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
394+
TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
409395
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
410396
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
411397
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7157,10 +7157,10 @@ prelude-ls@~1.1.2:
71577157
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
71587158
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
71597159

7160-
prettier@*, prettier@^2.1.1:
7161-
version "2.1.1"
7162-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6"
7163-
integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==
7160+
prettier@*, prettier@^2.2.1:
7161+
version "2.2.1"
7162+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
7163+
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
71647164

71657165
pretty-format@^25.2.1, pretty-format@^25.5.0:
71667166
version "25.5.0"

0 commit comments

Comments
 (0)