Wire up stylistic to ESLint

This commit is contained in:
Simon Ser 2024-09-29 11:45:42 +02:00
parent 78bfd16f25
commit d96e34da79
3 changed files with 23 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import globals from "globals"; import globals from "globals";
import js from "@eslint/js"; import js from "@eslint/js";
import stylisticJs from "@stylistic/eslint-plugin-js";
export default [ export default [
{ {
@ -13,6 +14,7 @@ export default [
"process": "readonly", "process": "readonly",
}, },
}, },
plugins: { "@stylistic/js": stylisticJs },
rules: { rules: {
"no-case-declarations": "off", "no-case-declarations": "off",
"no-unused-vars": ["error", { "no-unused-vars": ["error", {
@ -21,6 +23,8 @@ export default [
destructuredArrayIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_",
}], }],
"no-var": "error", "no-var": "error",
"@stylistic/js/indent": ["warn", "tab"],
"@stylistic/js/quotes": ["warn", "double"],
}, },
}, },
]; ];

18
package-lock.json generated
View file

@ -14,6 +14,7 @@
"@eslint/js": "^9.11.1", "@eslint/js": "^9.11.1",
"@parcel/packager-raw-url": "^2.0.0", "@parcel/packager-raw-url": "^2.0.0",
"@parcel/transformer-webmanifest": "^2.0.0", "@parcel/transformer-webmanifest": "^2.0.0",
"@stylistic/eslint-plugin-js": "^2.8.0",
"eslint": "^9.11.1", "eslint": "^9.11.1",
"globals": "^15.9.0", "globals": "^15.9.0",
"node-static": "^0.7.11", "node-static": "^0.7.11",
@ -2180,6 +2181,23 @@
"@parcel/core": "^2.12.0" "@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": { "node_modules/@swc/core": {
"version": "1.7.26", "version": "1.7.26",
"resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.26.tgz", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.26.tgz",

View file

@ -10,6 +10,7 @@
"@eslint/js": "^9.11.1", "@eslint/js": "^9.11.1",
"@parcel/packager-raw-url": "^2.0.0", "@parcel/packager-raw-url": "^2.0.0",
"@parcel/transformer-webmanifest": "^2.0.0", "@parcel/transformer-webmanifest": "^2.0.0",
"@stylistic/eslint-plugin-js": "^2.8.0",
"eslint": "^9.11.1", "eslint": "^9.11.1",
"globals": "^15.9.0", "globals": "^15.9.0",
"node-static": "^0.7.11", "node-static": "^0.7.11",