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

Skip to content

fix(eslint-plugin): update new rules from master #3840

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

Merged
merged 1 commit into from
Sep 5, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default util.createRule<
requiresTypeChecking: true,
},
fixable: 'code',
hasSuggestions: true,
messages: {
meaninglessVoidOperator:
"void operator shouldn't be used on {{type}}; it should convey that a return value is being ignored",
Expand Down
33 changes: 17 additions & 16 deletions packages/eslint-plugin/src/rules/padding-line-between-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function newNodeTypeTester(type: AST_NODE_TYPES): NodeTestObject {

/**
* Skips a chain expression node
* @paramnode The node to test
* @param node The node to test
* @returnsA non-chain expression
* @private
*/
Expand All @@ -119,7 +119,7 @@ function skipChainExpression(node: TSESTree.Node): TSESTree.Node {

/**
* Checks the given node is an expression statement of IIFE.
* @paramnode The node to check.
* @param node The node to check.
* @returns `true` if the node is an expression statement of IIFE.
* @private
*/
Expand All @@ -142,7 +142,7 @@ function isIIFEStatement(node: TSESTree.Node): boolean {

/**
* Checks the given node is a CommonJS require statement
* @paramnode The node to check.
* @param node The node to check.
* @returns `true` if the node is a CommonJS require statement.
* @private
*/
Expand All @@ -169,7 +169,7 @@ function isCJSRequire(node: TSESTree.Node): boolean {
* Checks whether the given node is a block-like statement.
* This checks the last token of the node is the closing brace of a block.
* @param sourceCode The source code to get tokens.
* @paramnode The node to check.
* @param node The node to check.
* @returns `true` if the node is a block-like statement.
* @private
*/
Expand Down Expand Up @@ -209,7 +209,7 @@ function isBlockLikeStatement(

/**
* Check whether the given node is a directive or not.
* @paramnode The node to check.
* @param node The node to check.
* @param sourceCode The source code object to get tokens.
* @returns `true` if the node is a directive.
*/
Expand All @@ -230,7 +230,7 @@ function isDirective(

/**
* Check whether the given node is a part of directive prologue or not.
* @paramnode The node to check.
* @param node The node to check.
* @param sourceCode The source code object to get tokens.
* @returns `true` if the node is a part of directive prologue.
*/
Expand Down Expand Up @@ -259,7 +259,7 @@ function isDirectivePrologue(

/**
* Checks the given node is a CommonJS export statement
* @paramnode The node to check.
* @param node The node to check.
* @returns `true` if the node is a CommonJS export statement.
* @private
*/
Expand Down Expand Up @@ -287,7 +287,7 @@ function isCJSExport(node: TSESTree.Node): boolean {

/**
* Check whether the given node is an expression
* @paramnode The node to check.
* @param node The node to check.
* @param sourceCode The source code object to get tokens.
* @returns `true` if the node is an expression
*/
Expand All @@ -310,7 +310,7 @@ function isExpression(
* foo()
* ;[1, 2, 3].forEach(bar)
* @param sourceCode The source code to get tokens.
* @paramnode The node to get.
* @param node The node to get.
* @returns The actual last token.
* @private
*/
Expand Down Expand Up @@ -364,8 +364,8 @@ function verifyForAny(): void {
* However, if comments exist between 2 blank lines, it does not remove those
* blank lines automatically.
* @param context The rule context to report.
* @param_ Unused. The previous node to check.
* @paramnextNode The next node to check.
* @param _ Unused. The previous node to check.
* @param nextNode The next node to check.
* @param paddingLines The array of token pairs that blank
* lines exist between the pair.
*
Expand Down Expand Up @@ -409,8 +409,8 @@ function verifyForNever(
* If the `prevNode` has trailing comments, it inserts a blank line after the
* trailing comments.
* @param context The rule context to report.
* @paramprevNode The previous node to check.
* @paramnextNode The next node to check.
* @param prevNode The previous node to check.
* @param nextNode The next node to check.
* @param paddingLines The array of token pairs that blank
* lines exist between the pair.
*
Expand Down Expand Up @@ -565,6 +565,7 @@ export default util.createRule<Options, MessageIds>({
extendsBaseRule: true,
},
fixable: 'whitespace',
hasSuggestions: true,
schema: {
definitions: {
paddingType: {
Expand Down Expand Up @@ -639,7 +640,7 @@ export default util.createRule<Options, MessageIds>({

/**
* Checks whether the given node matches the given type.
* @paramnode The statement node to check.
* @param node The statement node to check.
* @param type The statement type to check.
* @returns `true` if the statement node matched the type.
* @private
Expand Down Expand Up @@ -714,7 +715,7 @@ export default util.createRule<Options, MessageIds>({

/**
* Verify padding lines between the given node and the previous node.
* @paramnode The node to verify.
* @param node The node to verify.
*
* @private
*/
Expand Down Expand Up @@ -748,7 +749,7 @@ export default util.createRule<Options, MessageIds>({
/**
* Verify padding lines between the given node and the previous node.
* Then process to enter to new scope.
* @paramnode The node to verify.
* @param node The node to verify.
*
* @private
*/
Expand Down