Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,10 @@ We hold our code to standard, and these standards are documented below.

We use [prettier](https://prettier.io/) for automatic formatting a lot all our files. The configuration is in our `prettier.config.mjs` file.

To run prettier, use `node --run lint:prettier`.
And we use [ESLint](https://eslint.org) to lint our JavaScript, Markdown, and CSS files. The configuration is in our `eslint.config.mjs` file.

### JavaScript: Run ESLint

We use [ESLint](https://eslint.org) to lint our JavaScript files. The configuration is in our `eslint.config.mjs` file.

To run ESLint, use `node --run lint:js`.

### CSS: Run StyleLint

We use [StyleLint](https://stylelint.io) to lint our CSS. The configuration is in our `stylelint.config.mjs` file.

To run StyleLint, use `node --run lint:css`.

### Markdown: Run markdownlint

We use [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) to lint our markdown files. The configuration is in our `.markdownlint.json` file.

To run markdownlint, use `node --run lint:markdown`.
To check for formatting and linting errors, use `node --run test:lint`
To fix formatting and linting errors, use `node --run lint:fix`.

## Testing

Expand All @@ -43,6 +28,7 @@ The `package.json` scripts expose finer-grained test commands:
- `test:watch` – keep Vitest in watch mode for fast local feedback
- `test:ui` – open the Vitest UI dashboard (needs OS file-watch support enabled)
- `test:calendar` – run the legacy calendar debug helper
- `test:css`, `test:markdown`, `test:prettier`, `test:spelling`, `test:js` – lint-only scripts that enforce formatting, spelling, markdown style, and ESLint.
- `test:lint` – run linter and formatter checks
- `test:spelling` – run the spell checker

You can invoke any script with `node --run <script>` (or `npm run <script>`). Individual files can still be targeted directly, e.g. `npx vitest run tests/e2e/env_spec.js`.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Hello and thank you for wanting to contribute to the MagicMirror² project!
> - What does the pull request accomplish? Use a list if needed.
> - If it includes major visual changes please add screenshots.
>
> 3. Please run `node --run lint:prettier` before submitting so that
> 3. Please run `node --run lint:fix` before submitting so that
> style issues are fixed.
**Note**: Sometimes the development moves very fast. It is highly
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/automated-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ jobs:
node --run install-mm:dev
- name: "Run linter tests"
run: |
node --run test:prettier
node --run test:js
node --run test:css
node --run test:markdown
node --run test:lint
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
Expand Down
6 changes: 0 additions & 6 deletions .markdownlint.json

This file was deleted.

1 change: 0 additions & 1 deletion cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@
"sthuber",
"Stieber",
"strinner",
"stylelintrc",
"sunaction",
"suncalc",
"suntimes",
Expand Down
21 changes: 21 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
import {defineConfig, globalIgnores} from "eslint/config";
import css from "@eslint/css";
import globals from "globals";
import {flatConfigs as importX} from "eslint-plugin-import-x";
import js from "@eslint/js";
import jsdocPlugin from "eslint-plugin-jsdoc";
import markdown from "@eslint/markdown";
import {configs as packageJsonConfigs} from "eslint-plugin-package-json";
import playwright from "eslint-plugin-playwright";
import stylistic from "@stylistic/eslint-plugin";
import vitest from "@vitest/eslint-plugin";

export default defineConfig([
globalIgnores(["config/**", "modules/**/*", "js/positions.js", "tests/configs/config_variables.js"]),
{
files: ["**/*.css"],
language: "css/css",
plugins: {css},
extends: ["css/recommended"],
rules: {
"css/no-invalid-properties": ["error", {allowUnknownVariables: true}],
"css/use-baseline": "off"
}
},
{
files: ["**/*.md"],
plugins: {markdown},
language: "markdown/gfm",
extends: ["markdown/recommended"],
rules: {
"markdown/no-missing-label-refs": "off"
}
},
{
files: ["**/*.js"],
languageOptions: {
Expand Down
Loading
Loading