Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(no-expression-statements): arrow functions cannot be self returning #847

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(no-expression-statements): arrow functions cannot be self returni…
…ng (#847)
RebeccaStevens committed Jul 11, 2024

Verified

This commit was signed with the committer’s verified signature.
RebeccaStevens Rebecca Stevens
commit 7217fa4130c7375de46cc261d404acf783bcba03
1 change: 1 addition & 0 deletions src/rules/no-expression-statements.ts
Original file line number Diff line number Diff line change
@@ -150,6 +150,7 @@ function checkExpressionStatement(
typescript !== undefined &&
declaration !== undefined &&
typescript.isFunctionLike(declaration) &&
!typescript.isArrowFunction(declaration) &&
"body" in declaration &&
declaration.body !== undefined &&
typescript.isBlock(declaration.body)

Unchanged files with check annotations Beta

issues?: string;
}>;
type CZ = any;

Check warning on line 19 in cz-adapter/engine.ts

GitHub Actions / lint_js

Unexpected any. Specify a different type
/**
* The engine.
],
] as const
).filter(([sel, fn]) => fn !== undefined),
) as Record<string, any>;

Check warning on line 184 in src/rules/no-mixed-types.ts

GitHub Actions / lint_js

Unexpected any. Specify a different type
});
},
fix,
suggest:
suggestionFixers?.map(({ fix, message }) => ({

Check warning on line 598 in src/rules/prefer-immutable-types.ts

GitHub Actions / lint_js

'fix' is already declared in the upper scope on line 579 column 15
messageId: "userDefined",
data: {
message,
},
fix,
suggest:
suggestionFixers?.map(({ fix, message }) => ({

Check warning on line 692 in src/rules/prefer-immutable-types.ts

GitHub Actions / lint_js

'fix' is already declared in the upper scope on line 675 column 13
messageId: "userDefined",
data: {
message,
},
fix,
suggest:
suggestionFixers?.map(({ fix, message }) => ({

Check warning on line 746 in src/rules/prefer-immutable-types.ts

GitHub Actions / lint_js

'fix' is already declared in the upper scope on line 726 column 11
messageId: "userDefined",
data: {
message,
data,
fix,
suggest:
suggestionFixers?.map(({ fix, message }) => ({

Check warning on line 933 in src/rules/prefer-immutable-types.ts

GitHub Actions / lint_js

'fix' is already declared in the upper scope on line 921 column 38
messageId: "userDefined",
data: {
message,
*/
export type BaseOptions = ReadonlyArray<unknown>;
export type RuleDefinition<

Check warning on line 53 in src/utils/rule.ts

GitHub Actions / lint_js

Missing JSDoc comment
MessageIds extends string,
Options extends BaseOptions,
> = {
name: string,
meta: NamedCreateRuleCustomMeta<MessageIds, Options>,
defaultOptions: Options,
ruleFunctionsMap: RuleFunctionsMap<any, MessageIds, Options>,

Check warning on line 132 in src/utils/rule.ts

GitHub Actions / lint_js

Unexpected any. Specify a different type
) {
return createRuleUsingFunction(
name,
createFunction: (
context: Readonly<RuleContext<MessageIds, Options>>,
options: Readonly<Options>,
) => RuleFunctionsMap<any, MessageIds, Options>,

Check warning on line 155 in src/utils/rule.ts

GitHub Actions / lint_js

Unexpected any. Specify a different type
) {
const ruleCreator = RuleCreator(
(ruleName) =>
return ruleCreator<Options, MessageIds>({
name,
meta: meta as any,

Check warning on line 164 in src/utils/rule.ts

GitHub Actions / lint_js

Unsafe assignment of an `any` value
defaultOptions,
create: (context, options) => {
const ruleFunctionsMap = createFunction(context, options);