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

#187454781 Configure eslint and git pre-commit #9

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

GarrixA
Copy link
Collaborator

@GarrixA GarrixA commented Apr 18, 2024

What I did is:

  • setting up eslint code format
  • git pre-commit

What does this do

  • The eslint sets up rules for formatting our code in the development so that every one must follow it.
  • Git pre-commit ensures that before we commit any changes, our codes follows eslint rules

Here is how you can check it

  • Run npm install to install all the packages

  • Run npm run check to format your codes

  • Run npm run lint to check linting errors

  • After knowing how it works you can add commit

Pivotracker ID
#187454781

@GarrixA GarrixA self-assigned this Apr 18, 2024
@GarrixA GarrixA force-pushed the feat-eslint-precommit-hook-187419039 branch from 1303b99 to b26977a Compare April 18, 2024 09:26
@GarrixA GarrixA force-pushed the feat-eslint-precommit-hook-187419039 branch 3 times, most recently from 9f79022 to 36c9fd1 Compare April 19, 2024 14:45
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
},
Copy link

Choose a reason for hiding this comment

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

Unexpected '}'.

},
{
files: ["*.ts", "*.js"],
...tseslint.configs.disableTypeChecked,
Copy link

Choose a reason for hiding this comment

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

Expected ')' and instead saw 'tseslint'.
Expected '}' to match '{' from line 18 and instead saw '...'.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
Unrecoverable syntax error. (38% scanned).

ignores: ["**/__test__", "**/*.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
Copy link

Choose a reason for hiding this comment

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

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
Copy link

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,51 @@
const eslint = require("@eslint/js");
Copy link

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@GarrixA GarrixA force-pushed the feat-eslint-precommit-hook-187419039 branch from 36c9fd1 to f9dbcb8 Compare April 19, 2024 15:23
@GarrixA GarrixA force-pushed the feat-eslint-precommit-hook-187419039 branch from f9dbcb8 to 630f573 Compare April 21, 2024 22:01
package.json Show resolved Hide resolved
});
},
async up(queryInterface, Sequelize) {
await queryInterface.createTable("users", {
Copy link

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

});
},
async up(queryInterface, Sequelize) {
await queryInterface.createTable("users", {
Copy link

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

@GarrixA GarrixA force-pushed the feat-eslint-precommit-hook-187419039 branch from 10bb473 to 74adf58 Compare April 22, 2024 09:02
allowNull: false,
type: Sequelize.DATE,
},
});
Copy link

Choose a reason for hiding this comment

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

Unrecoverable syntax error. (88% scanned).

},
});
},
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

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

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 5 and instead saw '{'.
Missing semicolon.

allowNull: false,
type: Sequelize.DATE,
},
});
Copy link

Choose a reason for hiding this comment

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

Unrecoverable syntax error. (88% scanned).

},
});
},
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

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

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 5 and instead saw '{'.
Missing semicolon.

},
],
{},
);
Copy link

Choose a reason for hiding this comment

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

Expected ')' and instead saw ';'.
Expected an identifier and instead saw ')'.
Missing semicolon.
Unexpected ')'.
Unrecoverable syntax error. (78% scanned).

async down(queryInterface, Sequelize) {
await queryInterface.bulkDelete("users", null, {});
},
async up(queryInterface, Sequelize) {
Copy link

Choose a reason for hiding this comment

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

Expected ':' and instead saw 'up'.
Expected '}' to match '{' from line 3 and instead saw '{'.
Missing semicolon.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 19755 lines exceeds the maximum allowed for the inline comments feature.

Copy link

codeclimate bot commented Apr 22, 2024

Code Climate has analyzed commit 74adf58 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

The test coverage on the diff in this pull request is 30.7% (60% is the threshold).

This pull request will bring the total coverage in the repository to 52.5% (0.0% change).

View more on Code Climate.

@GarrixA GarrixA requested a review from cyusasnave April 22, 2024 09:05
Copy link
Collaborator

@YvetteNyibuka YvetteNyibuka left a comment

Choose a reason for hiding this comment

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

Good Job @GarrixA !

@leandreAlly leandreAlly merged commit 22a9f66 into develop Apr 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants