From 235535bdb74489d92a3edf79656a22fca01f4eb2 Mon Sep 17 00:00:00 2001 From: David Anson Date: Sun, 1 Sep 2024 15:27:29 -0700 Subject: [PATCH] Add @stylistic/eslint-plugin to ESLint configuration. --- dist/index.js | 6 +++--- eslint.config.mjs | 15 ++++++++++++++- markdownlint-cli2-action.js | 6 +++--- package.json | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index 88f1861..b3f1c91 100644 --- a/dist/index.js +++ b/dist/index.js @@ -57946,11 +57946,11 @@ var __webpack_exports__ = {}; const core = __nccwpck_require__(2186); -const {"main": markdownlintCli2} = __nccwpck_require__(9247); +const { "main": markdownlintCli2 } = __nccwpck_require__(9247); const logMessage = core.info; const outputFormatter = (options) => { - const {results} = options; + const { results } = options; for (const lintError of results) { const { errorContext, @@ -58007,7 +58007,7 @@ const parameters = { argv, logMessage, "optionsOverride": { - "outputFormatters": [[outputFormatter]] + "outputFormatters": [ [ outputFormatter ] ] } }; markdownlintCli2(parameters).then( diff --git a/eslint.config.mjs b/eslint.config.mjs index b9d6d40..c8f1bda 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,11 +2,20 @@ import js from "@eslint/js"; import eslintPluginNode from "eslint-plugin-n"; +import eslintPluginStylistic from "@stylistic/eslint-plugin"; import eslintPluginUnicorn from "eslint-plugin-unicorn"; export default [ js.configs.all, eslintPluginNode.configs["flat/recommended"], + eslintPluginStylistic.configs.customize({ + "arrowParens": true, + "commaDangle": "never", + "jsx": false, + "quoteProps": "always", + "quotes": "double", + "semi": true + }), eslintPluginUnicorn.configs["flat/all"], { "languageOptions": { @@ -22,7 +31,11 @@ export default [ "one-var": "off", "sort-imports": "off", "sort-keys": "off", - + + "@stylistic/array-bracket-spacing": [ "error", "always" ], + "@stylistic/dot-location": [ "error", "object" ], + "@stylistic/operator-linebreak": [ "error", "after" ], + "unicorn/no-array-callback-reference": "off", "unicorn/prefer-module": "off", "unicorn/prefer-top-level-await": "off" diff --git a/markdownlint-cli2-action.js b/markdownlint-cli2-action.js index b69685a..ffcaccb 100644 --- a/markdownlint-cli2-action.js +++ b/markdownlint-cli2-action.js @@ -3,11 +3,11 @@ "use strict"; const core = require("@actions/core"); -const {"main": markdownlintCli2} = require("markdownlint-cli2"); +const { "main": markdownlintCli2 } = require("markdownlint-cli2"); const logMessage = core.info; const outputFormatter = (options) => { - const {results} = options; + const { results } = options; for (const lintError of results) { const { errorContext, @@ -64,7 +64,7 @@ const parameters = { argv, logMessage, "optionsOverride": { - "outputFormatters": [[outputFormatter]] + "outputFormatters": [ [ outputFormatter ] ] } }; markdownlintCli2(parameters).then( diff --git a/package.json b/package.json index d2e5e7b..6aed502 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@eslint/js": "9.9.1", + "@stylistic/eslint-plugin": "2.7.2", "@vercel/ncc": "0.38.1", "eslint": "9.9.1", "eslint-plugin-n": "17.10.2",