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

feat: check header and ci lint #88

Merged
merged 10 commits into from
Jan 20, 2025
Merged

feat: check header and ci lint #88

merged 10 commits into from
Jan 20, 2025

Conversation

Debbl
Copy link
Contributor

@Debbl Debbl commented Jan 18, 2025

fix #66

  • 因为需要使用 ESLint,所以是基于 test 分支提交的
  • 使用 robmisasi/eslint-plugin-headers 自动在文件添加信息
  • 为了保证在在 ci 环境依赖一致,gitignore 取消了 pnpm-lock.yaml 的忽略

Copy link

vercel bot commented Jan 18, 2025

@Debbl is attempting to deploy a commit to the OpenBuild Team on Vercel.

A member of the Team first needs to authorize it.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
"headers/header-format": [
"error",
{
"source": "string",
Copy link
Member

Choose a reason for hiding this comment

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

使用文件的方式,把 license.js 文件中的那部分弄到单独的文件里,也读取文件拿,保证两个地方是同一个数据源。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实我推荐完全使用 ESLint 来做添加 license,在 lint-stage 执行 lint 就可以自动格式化

如果要保留 license.js 并且统一与 ESLint 的内容,目前的配置文件好像无法做到,可以考虑升级到 ESLint v9 #89 并使用 eslint.config.js 配置文件

Copy link
Member

Choose a reason for hiding this comment

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

需要加 header 的还有 CSS/SCSS 文件

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ESLint 默认好像不支持格式化 CSS 文件,这个插件好像也不支持,是否考虑可以把这个项目变成一个 monorepo 的项目,我可以自己写一个类似功能的插件

Copy link
Member

Choose a reason for hiding this comment

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

现在不考虑 monorepo。npm run license 已经支持给 CSS、SCSS 文件加头。

@ourai ourai self-assigned this Jan 18, 2025
@ourai ourai added this to the 2025W03 milestone Jan 18, 2025
@Debbl
Copy link
Contributor Author

Debbl commented Jan 19, 2025

不清楚为什么,在 ci 环境会多出一个文件

image

@ourai
Copy link
Member

ourai commented Jan 19, 2025

不清楚为什么,在 ci 环境会多出一个文件

image

@Debbl 那是 test 分支最新代码里的。

@Debbl Debbl deleted the branch openbuildxyz:test January 19, 2025 07:54
@Debbl Debbl closed this Jan 19, 2025
@Debbl Debbl deleted the test branch January 19, 2025 07:54
@Debbl Debbl restored the test branch January 19, 2025 07:55
@Debbl Debbl reopened this Jan 19, 2025
@ourai ourai modified the milestones: 2025W03, 2025W04 Jan 19, 2025
@ourai ourai mentioned this pull request Jan 20, 2025
2 tasks
@ourai ourai merged commit e34048b into openbuildxyz:test Jan 20, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

PR 自动校验必备信息
2 participants