Skip to content

Migrated from JSHint to ESLint#3836

Merged
khanniie merged 2 commits intoprocessing:develop-codemirror-v6from
Nishthajain7:migarte-to-eslint
Apr 10, 2026
Merged

Migrated from JSHint to ESLint#3836
khanniie merged 2 commits intoprocessing:develop-codemirror-v6from
Nishthajain7:migarte-to-eslint

Conversation

@Nishthajain7
Copy link
Copy Markdown
Contributor

Fixes #1540

Changes: Updated the preprocessing lint step to use ESLint instead of JSHint.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@welcome
Copy link
Copy Markdown

welcome bot commented Feb 2, 2026

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

@khanniie
Copy link
Copy Markdown
Member

Hi! Thank you so much for the contribution! If this is regarding the codemirror 5 to 6 migration, the subissue we published was actually regarding the js linter used within the Editor/stateUtils.js file. I do think the approach is correct, it would be great if you could move the changes to that file!

@Nishthajain7
Copy link
Copy Markdown
Contributor Author

Sorry for the delay. There were a lot of emails, and this one slipped through. I've moved the changes to stateUtils.js

@khanniie
Copy link
Copy Markdown
Member

khanniie commented Mar 1, 2026

Hi Nishthajain7! I checked out the branch and it doesn't build properly -- it looks like eslint-linter-browserify isn't installed in the package.json? Would you be able to address this? Thanks!

@Nishthajain7
Copy link
Copy Markdown
Contributor Author

The changes to package.json got lost when I discarded the old changes and force-pushed the new ones. I made the changes now

@khanniie
Copy link
Copy Markdown
Member

khanniie commented Mar 8, 2026

Hi! Thanks for updating the package.json. I just checked out the branch but unfortunately it doesn't build for me. I get a Module not found: Can't resolve 'eslint-linter-browserify' in '/usr/src/app/client/modules/IDE/components/Editor' client/modules/IDE/components/Editor/stateUtils.js error. I looked into this a bit more and it actually looks like the import method needs to be following the example they gave in their Codemirror example here! https://github.com/UziTech/eslint-linter-browserify/blob/064fd06afd68555be7fccaea329182552a95beeb/example/script.js

It also looks like we wouldn't need to go through the trouble of parsing the message responses and could just pass the linter in directly, if you reference the example code linked above. Could you make the following changes? Thank you!

@Nishthajain7
Copy link
Copy Markdown
Contributor Author

@khanniie Thank you for your guidance and suggestions. I've made the requested changes and now it looks much more simpler. I have tested the build as well and it works. Sorry for the inconvinience caused.

Copy link
Copy Markdown
Member

@khanniie khanniie left a comment

Choose a reason for hiding this comment

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

I left a couple of tiny comments but overall this looks and feels great! Thank you so much for accommodating all my requests!


return diagnostics;
};
function makeJsLinter(callback) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we can just move line 199 to line 207? Since it looks like the callback is no longer necessary anyways!


import p5JavaScript from './p5JavaScript';
import { esLint } from '@codemirror/lang-javascript';
import { Linter } from 'eslint-linter-browserify';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's import as import {Linter as ESLinter}!

@raclim
Copy link
Copy Markdown
Collaborator

raclim commented Mar 24, 2026

Thanks so much @khanniie for the review! Just wanted to check in @Nishthajain7 for the follow up changes!

@Nishthajain7
Copy link
Copy Markdown
Contributor Author

I have made the suggested changes

@khanniie khanniie merged commit 3d020a5 into processing:develop-codemirror-v6 Apr 10, 2026
1 check passed
@khanniie
Copy link
Copy Markdown
Member

Yay, thank you so much!!!

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.

3 participants