Skip to content

Commit

Permalink
Update to ESLint 9's "flat" configuration file format.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Apr 20, 2024
1 parent d31d508 commit 4660753
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 95 deletions.
90 changes: 0 additions & 90 deletions .eslintrc.json

This file was deleted.

61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import js from "@eslint/js";
import eslintPluginJsdoc from "eslint-plugin-jsdoc";
import eslintPluginNode from "eslint-plugin-n";
import eslintPluginUnicorn from "eslint-plugin-unicorn";

export default [
js.configs.all,
eslintPluginJsdoc.configs['flat/recommended'],
eslintPluginNode.configs["flat/recommended"],
eslintPluginUnicorn.configs["flat/all"],
{
"ignores": [
"test/*/**",
"webworker/markdownlint-cli2-webworker.js",
"webworker/setImmediate.js"
]
},
{
"languageOptions": {
"sourceType": "commonjs"
},
"linterOptions": {
"reportUnusedDisableDirectives": true
},
"rules": {
"capitalized-comments": "off",
"complexity": "off",
"guard-for-in": "off",
"id-length": "off",
"max-lines-per-function": "off",
"max-lines": "off",
"max-params": "off",
"max-statements": "off",
"multiline-comment-style": [ "error", "separate-lines" ],
"no-console": "off",
"no-magic-numbers": "off",
"no-plusplus": "off",
"no-ternary": "off",
"no-undef-init": "off",
"no-undefined": "off",
"no-useless-assignment": "off",
"one-var": "off",
"require-atomic-updates": "off",
"sort-keys": "off",
"sort-imports": "off",

"unicorn/no-null": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-string-replace-all": "off",
"unicorn/prevent-abbreviations": "off"
}
},
{
"files": [
"**/*.mjs"
],
"languageOptions": {
"sourceType": "module"
}
}
];
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build-docker-image": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker build -t davidanson/markdownlint-cli2:v$VERSION -f docker/Dockerfile --label org.opencontainers.image.version=v$VERSION .",
"build-docker-image-rules": "VERSION=$(node -e \"process.stdout.write(require('./package.json').version)\") && docker build -t davidanson/markdownlint-cli2-rules:v$VERSION -f docker/Dockerfile-rules --build-arg VERSION=v$VERSION --label org.opencontainers.image.version=v$VERSION .",
"ci": "npm-run-all --continue-on-error --parallel test-cover lint schema && git diff --exit-code",
"lint": "eslint --max-warnings 0 --no-eslintrc --config .eslintrc.json .",
"lint": "eslint --max-warnings 0",
"lint-dockerfile": "docker run --rm -i hadolint/hadolint:latest-alpine < docker/Dockerfile",
"lint-watch": "git ls-files | entr npm run lint",
"schema": "cpy ./node_modules/markdownlint/schema/markdownlint-config-schema.json ./schema --flat",
Expand Down Expand Up @@ -76,6 +76,7 @@
"micromatch": "4.0.5"
},
"devDependencies": {
"@eslint/js": "9.1.1",
"@iktakahiro/markdown-it-katex": "4.0.1",
"ajv": "8.12.0",
"ava": "6.1.2",
Expand Down
2 changes: 0 additions & 2 deletions test/fs-mock.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @ts-check

/* eslint-disable n/prefer-promises/fs */

"use strict";

const fs = require("node:fs");
Expand Down
3 changes: 1 addition & 2 deletions webworker/webworker-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";

/* eslint-env qunit */
/* globals markdownlintCli2, FsVirtual */
/* globals markdownlintCli2, FsVirtual, QUnit */

const md009 = "# Title\n\nText \n";
const md010 = "# Title\n\n\tText\n";
Expand Down

0 comments on commit 4660753

Please sign in to comment.