5 Commits

Author SHA1 Message Date
Kristjan ESPERANTO
143dfd6b67
Add some ESLint rules + minor changes (#3665)
Main point was to enable ESLint `dot-notation` and `no-unneeded-ternary`
rules for more code consistency.

I took the occasion to add two minor commits:
- Fix a problem found by running `test:spelling
- Minor dependency update

It wouldn't be a problem if the PR didn't arrive in the next release,
the changes are cosmetic.
2024-12-30 12:24:51 +01:00
Kristjan ESPERANTO
07768c3a88
Reactivate eslint-plugin-package-json (#3643)
Somehow the plugin get lost when we moved to ESLint flat config. Now I
reactivated it.

One rules caused sorting the scripts. If this is not okay, I can undo
this and switch off the rule.

Thank's @bugsounet for the pinging in
https://github.com/MagicMirrorOrg/MagicMirror/pull/3637#issuecomment-2509771362.
2024-12-01 15:26:23 +01:00
Kristjan ESPERANTO
f1522da153
Fix eslint ignores (#3633)
This will fix #3632.
2024-11-12 21:05:31 +01:00
Veeck
fff31068ab
Re-add eslint-plugin-import (#3586)
eslint-plugin-import was missing since the switch to
[v9](https://github.com/MagicMirrorOrg/MagicMirror/pull/3558). They
finally
[support](https://github.com/import-js/eslint-plugin-import/pull/2996)
it so we can re-add it.
2024-10-13 15:22:02 +02:00
Kristjan ESPERANTO
d3187689f0
Switch to ESLint v9 and flat config (#3558)
Since PR #3551 was not yet complete, I made my own attempt.

1. Update to ESLint v9.
2. Replace deprecated `.eslintrc.json` and `.eslintignore` by flat
config `eslint.config.mjs`.
3. Adapt `check_config.js` to use flat config.
4. Since `eslint-plugin-import` still doesn't support ESLint v9 I
removed it. We can add it back when it does support v9.
5. Run tests `npm run check:js` and `npm run config:check`.
6. In order not to overload this PR, I have not yet activated more
additional rules - there are some useful ones in the new plugin
`@eslint/js`.

@bugsounet, please don't take it as an offence that I have created a
competing PR. The migration to ESLint v9 has been burning under my nails
for some time.
2024-09-25 21:05:11 +02:00