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

chore: Add lint-staged #565

Merged
merged 6 commits into from Mar 18, 2023
Merged

Conversation

coderaiser
Copy link
Contributor

According to #562 (comment).

  • Added husky to run precommit hook;
  • Added lint-staged to lint *.js files;
  • Build with rollup before lint, since it can produce an error:

image

  • Instead of npm run fixlint, npm run build used expanded commands to speed things up;
  • Run eslint with a --fix flag, since ESLint fixes most issues;

@eslint-github-bot
Copy link

Hi @coderaiser!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by running git commit --amend, editing your commit message, and then running git push -f to update this pull request.

Read more about contributing to ESLint here

.husky/pre-commit Outdated Show resolved Hide resolved
Co-authored-by: Nitin Kumar <[email protected]>
@eslint-github-bot
Copy link

Hi @coderaiser!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@mdjermanovic mdjermanovic changed the title Add lint-staged chore: Add lint-staged Mar 13, 2023
package.json Outdated Show resolved Hide resolved
.lintstagedrc.json Outdated Show resolved Hide resolved
@nzakas
Copy link
Member

nzakas commented Mar 13, 2023

Thanks so much for taking a look at this! As mentioned, we already have a setup for this in the eslint repo, so it would be best to duplicate that rather than starting from scratch.

package.json Outdated Show resolved Hide resolved
package.json Outdated
@@ -77,6 +82,7 @@
"generate-alpharelease": "eslint-generate-prerelease alpha",
"generate-betarelease": "eslint-generate-prerelease beta",
"generate-rcrelease": "eslint-generate-prerelease rc",
"publish-release": "eslint-publish-release"
"publish-release": "eslint-publish-release",
"prepare": "node node_modules/yorkie/bin/install.js"
Copy link
Member

Choose a reason for hiding this comment

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

Adding a prepare script doesn't seem necessary because yorkie already runs its bin/install.js on install.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, just removed it

.lintstagedrc.json Outdated Show resolved Hide resolved
coderaiser and others added 3 commits March 15, 2023 17:38
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Leaving open for others to review.

@snitin315 snitin315 merged commit 5c85ea8 into eslint:main Mar 18, 2023
@coderaiser coderaiser deleted the feature/add-lint-staged branch March 18, 2023 18:26
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.

None yet

4 participants