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

DEMO: Github action to catch linting & formating issues #2422

Conversation

robyngit
Copy link
Member

This PR demonstrates new Github Actions introduced in PR #2412. It's just a demonstration and should no be merged. The PR introduced a new function that has linting and formatting errors. The github action will catch these errors and make comments on the PR with specific issues and suggested fixes.

Comment on lines +473 to +474
/**
* a method without sufficient documentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <jsdoc/require-param> reported by reviewdog 🐶
Missing JSDoc @param "x" declaration.

Suggested change
/**
* a method without sufficient documentation
/**
* a method without sufficient documentation
* @param x
* @param y

Comment on lines +473 to +474
/**
* a method without sufficient documentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <jsdoc/require-param> reported by reviewdog 🐶
Missing JSDoc @param "y" declaration.

Suggested change
/**
* a method without sufficient documentation
/**
* a method without sufficient documentation
* @param x
* @param y
* @param x
* @param y

Comment on lines +473 to +475
/**
* a method without sufficient documentation
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <jsdoc/require-returns> reported by reviewdog 🐶
Missing JSDoc @returns declaration.

/**
* a method without sufficient documentation
*/
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <func-names> reported by reviewdog 🐶
Unexpected unnamed method 'aNewMethodWithLintingAndFormattingErrors'.

/**
* a method without sufficient documentation
*/
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected method shorthand.

Suggested change
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
aNewMethodWithLintingAndFormattingErrors (x, y) {

/**
* a method without sufficient documentation
*/
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'y' is defined but never used.

*/
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
const a = 1;
a = 999;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <no-const-assign> reported by reviewdog 🐶
'a' is constant.

aNewMethodWithLintingAndFormattingErrors: function (x, y) {
const a = 1;
a = 999;
var b=2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <vars-on-top> reported by reviewdog 🐶
All 'var' declarations must be at the top of the function scope.

aNewMethodWithLintingAndFormattingErrors: function (x, y) {
const a = 1;
a = 999;
var b=2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <no-var> reported by reviewdog 🐶
Unexpected var, use let or const instead.

Suggested change
var b=2;
let b=2;

const a = 1;
a = 999;
var b=2;
console.log("this is just a test of the new linter and formatter")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.

@@ -468,6 +468,18 @@ define([
$("body").off("activate");
$(window).off("resize");
},


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change

* a method without sufficient documentation
*/
aNewMethodWithLintingAndFormattingErrors: function (x, y) {
const a = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
const a = 1;
const a = 1;

Comment on lines +479 to +481
var b=2;
console.log("this is just a test of the new linter and formatter")
return a + b;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
var b=2;
console.log("this is just a test of the new linter and formatter")
return a + b;
var b = 2;
console.log("this is just a test of the new linter and formatter");
return a + b;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant