From d96e34da79718f10a930df7e27d468b596f2ef1e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 29 Sep 2024 11:45:42 +0200 Subject: [PATCH] Wire up stylistic to ESLint --- eslint.config.js | 4 ++++ package-lock.json | 18 ++++++++++++++++++ package.json | 1 + 3 files changed, 23 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index 7de4470..f740aa3 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,5 +1,6 @@ import globals from "globals"; import js from "@eslint/js"; +import stylisticJs from "@stylistic/eslint-plugin-js"; export default [ { @@ -13,6 +14,7 @@ export default [ "process": "readonly", }, }, + plugins: { "@stylistic/js": stylisticJs }, rules: { "no-case-declarations": "off", "no-unused-vars": ["error", { @@ -21,6 +23,8 @@ export default [ destructuredArrayIgnorePattern: "^_", }], "no-var": "error", + "@stylistic/js/indent": ["warn", "tab"], + "@stylistic/js/quotes": ["warn", "double"], }, }, ]; diff --git a/package-lock.json b/package-lock.json index d982d7f..575b27e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@eslint/js": "^9.11.1", "@parcel/packager-raw-url": "^2.0.0", "@parcel/transformer-webmanifest": "^2.0.0", + "@stylistic/eslint-plugin-js": "^2.8.0", "eslint": "^9.11.1", "globals": "^15.9.0", "node-static": "^0.7.11", @@ -2180,6 +2181,23 @@ "@parcel/core": "^2.12.0" } }, + "node_modules/@stylistic/eslint-plugin-js": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.8.0.tgz", + "integrity": "sha512-/e7pSzVMrwBd6yzSDsKHwax3TS96+pd/xSKzELaTkOuYqUhYfj/becWdfDbFSBGQD7BBBCiiE4L8L2cUfu5h+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, "node_modules/@swc/core": { "version": "1.7.26", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.26.tgz", diff --git a/package.json b/package.json index 02dff46..3af12ba 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@eslint/js": "^9.11.1", "@parcel/packager-raw-url": "^2.0.0", "@parcel/transformer-webmanifest": "^2.0.0", + "@stylistic/eslint-plugin-js": "^2.8.0", "eslint": "^9.11.1", "globals": "^15.9.0", "node-static": "^0.7.11",