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

Eslint flat config #1099

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SimonFischer04
Copy link

PR Checklist:

  • Provide a meaningful description to this PR or mention which issues this fixes.
  • Ensure the project builds with npm run build
  • Add tests for your change. This includes negative tests (i.e. inputs that need to fail) as well as baseline tests (i.e. how should the directory structure look like?).
  • Run the test suite with npm test
  • If there are baseline changes, review them and make a separate commit for them with the comment "accept baselines" if they are desired changes
  • If you added a required option, also add it to the template creation (.github/create_templates.ts)
  • Add a detailed migration description to docs/updates explaining what the user needs to do when manually updating an existing project
  • Add your changes to CHANGELOG.md (referencing the migration description and this PR or the issue you fixed)

Description:
add description here

@SimonFischer04
Copy link
Author

work in progress version of moving root eslint config to new flat config format.:
basic config / migrated rules from .eslintrc.js && .eslintignore to eslint.config.js
NOTE: prettier plugin still missing
PS: kept old configs as .bak for now / as reference until is pr is done

Sorry, not much for now, as I spent most time reading README / dev setup and debugging issue described on discord, this is also why I ultimately started with migrating the root config and not the template - as I could not get the generator to run - should still be useful as reference / can be copied to the template later.

Will (hopefully) have time tomorrow to continue this.

@SimonFischer04
Copy link
Author

NOTE for docs:
for the vs-code users: you may have to enable the new format to get linting help in ide working again:
image

@SimonFischer04
Copy link
Author

another thing:
would it make sense to create a shared "eslint-config-iobroker" (more details see: https://eslint.org/docs/latest/extend/shareable-configs)
with the 4 common templates (space/singlequotes, space/doublequotes, tab/doublequote, tab/sinlgequote)?
so if changes are required (again) not every adapter has to do (a lot of) migration.

@AlCalzone
Copy link
Collaborator

I'm afraid we cannot upgrade yet:
typescript-eslint/typescript-eslint#8211
Until typescript-eslint supports ESLint v9, we can neither upgrade the creator, nor can we upgrade TS adapters. Upgrading JS-only adapters only will create a mess I'm not willing to support.
So we should wait and tell devs not to merge ESLint v9 PRs.

For reference: Here's documentation about the necessary changes to the configuration files:
https://eslint.org/blog/2022/08/new-config-system-part-2/

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

2 participants