-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Chore/upgrade eslint #7853
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
base: dev-2.0
Are you sure you want to change the base?
Chore/upgrade eslint #7853
Conversation
We have a situation ...
... and I have a few questions:
Next steps:
Additionaly I have to wrap my head around Cheers! |
The existing rules should be all good and intended. The one thing to possibly consider is to switch from errors to warnings for the style related rules, eg. indentation and semi-colon, that does not change behavior of the code (ie. arrow function will still error since it change behavior of function more significantly). If there are some suggestion on rules changes or addition, do feel free to make them here and we can review.
If needed, the additional plugins can be added to enable relevant linting of existing rules. I would like to limit the scope of linting to JS files only though so not really considering additional plugin to lint other file types.
I assume this is about why Typr.js is inlined in this repo? The reason is that the original Typr.js repo does not export the code as an NPM package so as a stop gap we inline the library files directly. It is not meant to be edited by p5.js contributors so this file can be ignored by ESLint.
It should be fine, unless in the 2.0 codebase it looks like we are using newer syntax then we can bump the version number up to 2024.
Yes should be fine. |
I was wondering which would be the preferred way to integrate the linting rules? As already mentioned I could create a commit for each rule
Sorry if this sounded kind of impolite. I just wanted to know if this could be a task for the future? My aforementioned general intention is to help improve performance and reduce bundle size. See #7761
I've been looking into
The plugins could be used to lint js code snippets in .md and .html files. Should I implement this feature? |
Instead of individual PR for each rule, which I feel is a bit excessive, we can do this PR as you mentioned with the general setup then open another unified PR (or start with an issue for discussion) for discussing the rules in details. That way we avoid spilling too much bike shedding conversation around and just have one place dedicated for it. What do you think?
No worries, it is just worth to be a bit clearer on the question so I don't have to assume. For things like Typr.js, it might be worth discussing this with @dhowe who worked on the new implementation of the typography section replacing opentype.js with Typr.js as well. There are some existing discussion issues around too so might want to have a look at what's already looked at in those first.
Yes that is meant to lint the examples so that they also follow the lint rules we have. If the eslint-plugin-jsdoc can lint example code, that would really help us not having the custom solution we have that is probably more brittle, so yes do look into it.
That could be helpful 🤔 I think maybe let's have the md plugin, I don't think we have much complex html with contents in the repo. |
sounds good to me |
56fca1b
to
cb190b7
Compare
@limzykenneth Sorry, I made a (git) mess. I shouldn't do any git operations when I'm about to go to bed. But I wanted to get this done. Please let me know if I should restart with a clean PR/branch. The majority of warnings are reported from style related rules like This PR introduces I haven't touched the This leads me to the ignored files. The eslint config of this PR ignores the files in Another ignored file in 1.x is Oh dear, sorry for the wall of words but I just wanted to give you an update. |
@error-four-o-four Thanks for the updates For the commit history don't worry too much about it, git will take care of it when merging and the diff still looks clean so should be fine. For rules, ignore the Airbnb guide for now and just base things on the current rule set in the old config file, we'll discuss exact rules to adopt in a separate issue as mentioned last time. I'm not sure what The Numjs Matrix file is just a work in progress, if it is causing problems you can add it to the ignore list. If
I think it would be an idea we can explore, may want to do this later though as a separate thing. Same with the tests, we need to normalize it later.
|
Yes, I'll doublecheck this PR one more time this evening and then we shoud be good to go |
48dfe18
to
002cc3f
Compare
That was too risky for me. I made mistakes as I rebased stuff. So I started clean.
Not yet but I've prepared it and will investigate this further. We're good to go https://github.com/processing/p5.js/actions/runs/15570657337/job/43845501279?pr=7853#step:5:4920 Thank you for your patience |
@lirenjie95 Thanks for helping to review! @error-four-o-four I'm a bit swamped with work at the moment but I want to review this more thoroughly myself, so bear with me while I try to find some time to do so. Feel free to look at other things to work on if you like before I get back to this. Thanks! |
Changes:
8.54.0
to9.28
@sytlistic/eslint-plugin
to replace deprecated eslint rules.gitignore