0
0
Fork 0
mirror of https://github.com/DavidAnson/markdownlint-cli2-action.git synced 2024-11-24 07:06:23 +01:00

Update to ESLint 9's "flat" configuration file format, convert deprecated eslint-plugin-node to eslint-plugin-n.

This commit is contained in:
David Anson 2024-04-17 22:34:41 -07:00
parent 0b744e6d2e
commit fa8f1b12cd
3 changed files with 42 additions and 73 deletions

View file

@ -1,71 +0,0 @@
{
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "script"
},
"env": {
"node": true,
"es6": true
},
"plugins": [
"node",
"unicorn"
],
"extends": [
"eslint:all",
"plugin:unicorn/all"
],
"reportUnusedDisableDirectives": true,
"rules": {
"max-statements": "off",
"multiline-ternary": "off",
"no-magic-numbers": "off",
"no-ternary": "off",
"one-var": "off",
"sort-keys": "off",
"node/handle-callback-err": "error",
"node/no-callback-literal": "error",
"node/no-exports-assign": "error",
"node/no-extraneous-import": "error",
"node/no-extraneous-require": "error",
"node/no-missing-import": "error",
"node/no-missing-require": "error",
"node/no-new-require": "error",
"node/no-path-concat": "error",
"node/no-process-exit": "error",
"node/no-unpublished-bin": "error",
"node/no-unpublished-import": "error",
"node/no-unpublished-require": "error",
"node/no-unsupported-features/es-builtins": "error",
"node/no-unsupported-features/es-syntax": "error",
"node/no-unsupported-features/node-builtins": "error",
"node/process-exit-as-throw": "error",
"node/shebang": "error",
"node/no-deprecated-api": "error",
"node/callback-return": "error",
"node/exports-style": "error",
"node/file-extension-in-import": "error",
"node/global-require": "error",
"node/no-mixed-requires": "error",
"node/no-process-env": "error",
"node/no-restricted-import": "error",
"node/no-restricted-require": "error",
"node/no-sync": "error",
"node/prefer-global/buffer": "error",
"node/prefer-global/console": "error",
"node/prefer-global/process": "error",
"node/prefer-global/text-decoder": "error",
"node/prefer-global/text-encoder": "error",
"node/prefer-global/url-search-params": "error",
"node/prefer-global/url": "error",
"node/prefer-promises/dns": "error",
"node/prefer-promises/fs": "error",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-unsafe-regex": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/switch-case-braces": ["error", "avoid"]
}
}

39
eslint.config.mjs Normal file
View file

@ -0,0 +1,39 @@
/* eslint-disable n/no-unpublished-import */
import js from "@eslint/js";
import eslintPluginNode from "eslint-plugin-n";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
export default [
js.configs.all,
eslintPluginNode.configs["flat/recommended"],
eslintPluginUnicorn.configs["flat/all"],
{
"languageOptions": {
"sourceType": "commonjs"
},
"linterOptions": {
"reportUnusedDisableDirectives": true
},
"rules": {
"max-statements": "off",
"no-magic-numbers": "off",
"no-ternary": "off",
"one-var": "off",
"sort-imports": "off",
"sort-keys": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-top-level-await": "off"
}
},
{
"files": [
"eslint.config.mjs"
],
"languageOptions": {
"sourceType": "module"
}
}
];

View file

@ -19,7 +19,7 @@
"build": "ncc build markdownlint-cli2-action.js",
"docker-npm-install": "docker run --rm --tty --name npm-install --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm install",
"docker-npm-run-upgrade": "docker run --rm --tty --name npm-run-upgrade --volume $PWD:/home/workdir --workdir /home/workdir --user node node:16 npm run upgrade",
"lint": "eslint *.js && markdownlint-cli2 *.md",
"lint": "eslint *.js eslint.config.mjs && markdownlint-cli2 *.md",
"test": "npm run lint && npm run build && git diff --exit-code",
"upgrade": "npx --yes npm-check-updates --upgrade"
},
@ -28,9 +28,10 @@
"markdownlint-cli2": "0.13.0"
},
"devDependencies": {
"@eslint/js": "9.0.0",
"@vercel/ncc": "0.38.1",
"eslint": "9.0.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-n": "17.2.1",
"eslint-plugin-unicorn": "52.0.0"
}
}