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

Add XO linter #10643

Merged
merged 1 commit into from Mar 24, 2024
Merged

Add XO linter #10643

merged 1 commit into from Mar 24, 2024

Conversation

LitoMore
Copy link
Member

@LitoMore LitoMore commented Mar 14, 2024

I intentionally didn't fix those errors on the commit 64fefbd (#10643), so you can play XO.

Changes

  • Apply most of the XO fixes. For some minor errors, I used eslint-ignore.
  • Move the .svglintrc.mjs code body to scripts/svglint-config.mjs. It's related to XO not linting files starts with dot xojs/xo#673.
  • Remove prettier dependency, XO has a built-in prettier
  • Limit the prettier --fix command to only format markdown and JSON files
  • Remove the incorrect engines field from package.json

Features

It has a friendly error prompt, and you can simply the link on the prompt to see the reason:

image

It has tons of rules and good practices built in.

Let me know if you have any questions.

Editor configuration

VS Code .vscode/settings.json

Some options can be omitted. It's up to your global configuration.

{
  "prettier.enable": true,
  "eslint.enable": false,
  "xo.enable": true,
  "xo.format.enable": true,
  "editor.formatOnSave": true,
  "[javascript]": {
    "editor.defaultFormatter": "samverschueren.linter-xo"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

For other editors, please refer to https://github.com/xojs/xo?tab=readme-ov-file#editor-plugins.

@mondeja mondeja linked an issue Mar 14, 2024 that may be closed by this pull request
@mondeja mondeja added the meta Issues or pull requests regarding the project or repository itself label Mar 14, 2024
package.json Outdated Show resolved Hide resolved
@mondeja
Copy link
Member

mondeja commented Mar 15, 2024

Really great, you're right about XO 🥇

@LitoMore LitoMore marked this pull request as ready for review March 18, 2024 17:08
@LitoMore LitoMore requested a review from mondeja March 18, 2024 17:08
.xo-config.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
.xo-config.json Outdated Show resolved Hide resolved
scripts/build/package.js Outdated Show resolved Hide resolved
scripts/get-filename.js Outdated Show resolved Hide resolved
sdk.mjs Show resolved Hide resolved
types.d.ts Show resolved Hide resolved
.xo-config.json Outdated Show resolved Hide resolved
sdk.mjs Show resolved Hide resolved
scripts/add-icon-data.js Outdated Show resolved Hide resolved
mondeja

This comment was marked as resolved.

.github/ISSUE_TEMPLATE/icon_removal.yml Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Copy link
Member

@mondeja mondeja left a comment

Choose a reason for hiding this comment

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

It's almost there, just one more small change...

package.json Outdated Show resolved Hide resolved
@LitoMore LitoMore requested a review from mondeja March 24, 2024 16:30
Copy link
Member

@mondeja mondeja left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks for this great work @LitoMore! 🥇

@mondeja mondeja merged commit bf69b6d into simple-icons:develop Mar 24, 2024
4 checks passed
@LitoMore LitoMore deleted the xo branch March 24, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues or pull requests regarding the project or repository itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add linting to the project
3 participants