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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: migrate to eslint flat config format #1955

Merged
merged 4 commits into from May 12, 2024

Conversation

ollien
Copy link
Collaborator

@ollien ollien commented May 12, 2024

Modern versions of eslint have migrated to the "flat" configuration style, deprecating .eslintrc.js. I've gone ahead and migrated the project to the new format, which will allow us to safely upgrade to newer versions of eslint. I believe I've preserved all existing rules, but it's a bit hard to prove a negative 馃槄

The globals dependency is needed due to a change in how the new configuration format handles known globals. See: https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options

@xiyaowong
Copy link
Collaborator

xiyaowong commented May 12, 2024

Nice. I've been wanting to do this for a long time.

Also need to turn on "eslint.experimental.useFlatConfig"

"eslint.experimental.useFlatConfig": false,

And .eslintignore is no longer supported in Flat config. Just delete it.

eslint.config.cjs Outdated Show resolved Hide resolved
@xiyaowong
Copy link
Collaborator

I don't understand why it's not "chore" but "build".

@ollien
Copy link
Collaborator Author

ollien commented May 12, 2024

I can change the title if you want. I know there were discussions of not using chore so I picked the next best thing. I have no strong opinions one way or the other

@xiyaowong
Copy link
Collaborator

馃樀

@ollien ollien changed the title build: migrate to eslint flat config format chore: migrate to eslint flat config format May 12, 2024
@justinmk
Copy link
Collaborator

"chore" is a useless prefix. Of course this is either "build" or "lint". Why wouldn't it be?

@xiyaowong
Copy link
Collaborator

Should delete .eslintignore

@ollien
Copy link
Collaborator Author

ollien commented May 12, 2024

"chore" is a useless prefix. Of course this is either "build" or "lint". Why wouldn't it be?

FYI, lint is not a prefix we allow. From the CI:

allowed-commit-types: feat,fix,docs,style,refactor,test,build,perf,ci,chore,revert,merge,wip

I agree that would be the most fitting here

@ollien ollien changed the title chore: migrate to eslint flat config format build: migrate to eslint flat config format May 12, 2024
@justinmk
Copy link
Collaborator

lint is not a prefix we allow.

we can add it (and remove "chore")

@ollien ollien merged commit 8dda2b8 into vscode-neovim:master May 12, 2024
8 checks passed
@xiyaowong
Copy link
Collaborator

xiyaowong commented May 13, 2024

we can add it

馃憤馃徎

(and remove "chore")

馃憥馃徎

Most front-end projects use something like chore(lint)

@justinmk
Copy link
Collaborator

justinmk commented May 13, 2024

Most front-end projects use something like chore(lint)

Why does that matter?

The problem is that people over-use "chore", it ends up being 30% of the commits. Which defeats the purpose of having a prefix.

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.

None yet

4 participants