Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

feat!: enforce blank line before return statements #143

Merged
merged 1 commit into from
Feb 10, 2020
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
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const config = {
'no-unused-expressions': 'error',
'no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
'object-shorthand': 'error',
'padding-line-between-statements': [
'error',
{blankLine: 'always', next: 'return', prev: '*'},
],
'prefer-arrow-callback': ['error', {allowNamedFunctions: true}],
'prefer-const': 'error',
'prefer-object-spread': 'error',
Expand Down
1 change: 1 addition & 0 deletions plugins/eslint-plugin-liferay/lib/rules/group-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {

between.replace(/(?:\r\n|\n)[ \t]*/g, match => {
newlines.push(match);

return match;
});

Expand Down
2 changes: 2 additions & 0 deletions plugins/eslint-plugin-liferay/lib/rules/padded-test-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const CALL_EXPRESSIONS = [
return match(node.tag, parts.slice(0, -1));
}
}

return false;
};

Expand Down Expand Up @@ -126,6 +127,7 @@ module.exports = {
/(\r\n|\n)([ \t]*)/g,
(_match, newline, indent) => {
newlines++;

return newline + newline + indent;
}
);
Expand Down
1 change: 1 addition & 0 deletions plugins/eslint-plugin-liferay/lib/rules/sort-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ module.exports = {
}
last = i;
}

return [first, last];
},
[-1, -1]
Expand Down