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

Migrate to flat eslint config file #137

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Migrate to flat eslint config file #137

merged 2 commits into from
Apr 28, 2024

Conversation

DanielYang59
Copy link
Collaborator

@DanielYang59 DanielYang59 commented Apr 27, 2024

closes #136

@DanielYang59
Copy link
Collaborator Author

DanielYang59 commented Apr 27, 2024

@janosh. Would appreciate it if you have time to have a look (I have absolutely zero knowledge of javascript), not sure why eslint is failing, thought I already have eslint-plugin-svelte in the "additional_dependencies" of .pre-commit-config.yaml?

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36)

@DanielYang59 DanielYang59 marked this pull request as ready for review April 27, 2024 02:33
@janosh janosh added docs Improvements or additions to documentation linting Linting & quality assurance ci Continuous integration labels Apr 28, 2024
Copy link
Owner

@janosh janosh left a comment

Choose a reason for hiding this comment

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

thanks @DanielYang59! 👍

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js

i had the same error over at matbench-discovery which is why i just skipped eslint there. i suspect it's a node version incompatibility. i.e. that the default node installed by pre-commit CI is too old. i briefly tried to fix that but didn't manage. not important enough to spend time on 😄

@janosh janosh merged commit cf8365e into janosh:main Apr 28, 2024
5 of 6 checks passed
@DanielYang59 DanielYang59 deleted the eslint branch April 29, 2024 01:47
@DanielYang59
Copy link
Collaborator Author

DanielYang59 commented Apr 29, 2024

thanks @DanielYang59! 👍

No worries at all :)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js

i had the same error over at matbench-discovery which is why i just skipped eslint there. i suspect it's a node version incompatibility. i.e. that the default node installed by pre-commit CI is too old. i briefly tried to fix that but didn't manage. not important enough to spend time on 😄

Ah, that's bad news. I would personally prefer to use the legacy config then if so. Even we suppressed eslint run in CI, it would still give a lot of error message when running pre-commit locally, and flood the terminal.

pre-commit run --all-files
ruff.....................................................................Passed
ruff-format..............................................................Passed
mypy.....................................................................Passed
Format iPython Cells.....................................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect destroyed symlinks................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
codespell................................................................Passed
nbstripout...............................................................Passed
No missing readme images.................................................Passed
prettier.................................................................Passed
eslint...................................................................Failed
- hook id: eslint
- exit code: 2

Oops! Something went wrong! :(

ESLint: 9.1.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:528:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:497:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:231:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:97:39)
    at link (node:internal/modules/esm/module_job:96:36)

Oops! Something went wrong! :(

ESLint: 9.1.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:528:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:497:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:231:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:97:39)
    at link (node:internal/modules/esm/module_job:96:36)

Oops! Something went wrong! :(

ESLint: 9.1.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:528:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:497:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:231:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:97:39)
    at link (node:internal/modules/esm/module_job:96:36)

Oops! Something went wrong! :(

ESLint: 9.1.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:528:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:497:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:231:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:97:39)
    at link (node:internal/modules/esm/module_job:96:36)

Oops! Something went wrong! :(

ESLint: 9.1.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-svelte' imported from /Users/yang/developer/pymatviz/site/eslint.config.js
Did you mean to import "eslint-plugin-svelte/lib/index.js"?
    at packageResolve (node:internal/modules/esm/resolve:845:9)
    at moduleResolve (node:internal/modules/esm/resolve:918:18)
    at defaultResolve (node:internal/modules/esm/resolve:1148:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:528:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:497:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:231:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:97:39)
    at link (node:internal/modules/esm/module_job:96:36)

pyright..................................................................Passed

@janosh
Copy link
Owner

janosh commented Apr 29, 2024

I've been considering migrating typescript+svelte linting to https://github.com/oxc-project/oxc altogether. not sure how complete its feature set is at this point but eslint has not always been smooth sailing so i wouldn't mind replacing it. the problem might solve itself in a few months e.g. when default node versions are updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration docs Improvements or additions to documentation linting Linting & quality assurance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legacy eslint config file deprecated and caused pre-commit to fail
2 participants