diff --git a/eslint.config.mjs b/eslint.config.mjs index 89d816c..1ceac3f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,10 +3,15 @@ import globals from "globals"; import js from "@eslint/js"; +import stylisticJs from "@stylistic/eslint-plugin-js"; + export default [ js.configs.recommended, { + plugins: { + "@stylistic/js": stylisticJs + }, languageOptions: { ecmaVersion: 2022, sourceType: "module", @@ -17,21 +22,21 @@ export default [ require: "readonly", } }, - ignores: ["./node_modules/*.*", "./build/**/*.js"], + ignores: ["node_modules/*", "build/*"], rules: { - "indent": [ + "@stylistic/js/indent": [ "error", 4 ], - "linebreak-style": [ + "@stylistic/js/linebreak-style": [ "error", "unix" ], - "quotes": [ + "@stylistic/js/quotes": [ "error", "double" ], - "semi": [ + "@stylistic/js/semi": [ "error", "always" ] diff --git a/package.json b/package.json index 232e390..d0efd43 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@lhci/cli": "0.13.0", "@liber-ufpe/esbuild-plugin-compress": "^1.0.0", "@liber-ufpe/esbuild-plugin-sharp": "^1.0.0", + "@stylistic/eslint-plugin-js": "^2.0.0", "autoprefixer": "^10.4.17", "esbuild": "0.21.1", "esbuild-sass-plugin": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 1ce52cf..3b46dea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -988,6 +988,20 @@ __metadata: languageName: node linkType: hard +"@stylistic/eslint-plugin-js@npm:^2.0.0": + version: 2.0.0 + resolution: "@stylistic/eslint-plugin-js@npm:2.0.0" + dependencies: + "@types/eslint": "npm:^8.56.10" + acorn: "npm:^8.11.3" + eslint-visitor-keys: "npm:^4.0.0" + espree: "npm:^10.0.1" + peerDependencies: + eslint: ">=8.40.0" + checksum: 10c0/510011f1045b548ada5f6c6a419ef93ac593a2c606bfccffaaef54982525bd6e04d193a1d8270a117c597bd9da9e6e5f05c37d9ca43855e334878c6792aa125c + languageName: node + linkType: hard + "@tootallnate/quickjs-emscripten@npm:^0.23.0": version: 0.23.0 resolution: "@tootallnate/quickjs-emscripten@npm:0.23.0" @@ -995,6 +1009,30 @@ __metadata: languageName: node linkType: hard +"@types/eslint@npm:^8.56.10": + version: 8.56.10 + resolution: "@types/eslint@npm:8.56.10" + dependencies: + "@types/estree": "npm:*" + "@types/json-schema": "npm:*" + checksum: 10c0/674349d6c342c3864d70f4d5a9965f96fb253801532752c8c500ad6a1c2e8b219e01ccff5dc8791dcb58b5483012c495708bb9f3ff929f5c9322b3da126c15d3 + languageName: node + linkType: hard + +"@types/estree@npm:*": + version: 1.0.5 + resolution: "@types/estree@npm:1.0.5" + checksum: 10c0/b3b0e334288ddb407c7b3357ca67dbee75ee22db242ca7c56fe27db4e1a31989cb8af48a84dd401deb787fe10cc6b2ab1ee82dc4783be87ededbe3d53c79c70d + languageName: node + linkType: hard + +"@types/json-schema@npm:*": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.11.20 resolution: "@types/node@npm:20.11.20" @@ -4803,6 +4841,7 @@ __metadata: "@lhci/cli": "npm:0.13.0" "@liber-ufpe/esbuild-plugin-compress": "npm:^1.0.0" "@liber-ufpe/esbuild-plugin-sharp": "npm:^1.0.0" + "@stylistic/eslint-plugin-js": "npm:^2.0.0" autoprefixer: "npm:^10.4.17" esbuild: "npm:0.21.1" esbuild-sass-plugin: "npm:^3.0.0"