aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-05-17 13:23:01 +0300
committerAarni Koskela <akx@iki.fi>2023-05-17 16:09:06 +0300
commit13f4c62ba3870f172e6fdb26d4f33576f7f60f7e (patch)
treea525b4f45480b95d4502bc6ff0877d48bd39da50
parent9ac85b8b73e180154453609f10b044a475289e24 (diff)
Add basic ESLint configuration for formatting
This doesn't enable any of ESLint's actual possible-issue linting, but just style normalization based on the Prettier configuration (but without line length limits).
-rw-r--r--.eslintignore4
-rw-r--r--.eslintrc.js49
-rw-r--r--.gitignore2
-rw-r--r--package.json11
4 files changed, 66 insertions, 0 deletions
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000..1cfd9487
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,4 @@
+extensions
+extensions-disabled
+repositories
+venv \ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 00000000..48f9df7d
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,49 @@
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ },
+ // "extends": "eslint:recommended",
+ parserOptions: {
+ ecmaVersion: "latest",
+ },
+ rules: {
+ "arrow-spacing": "error",
+ "block-spacing": "error",
+ "brace-style": "error",
+ "comma-dangle": ["error", "only-multiline"],
+ "comma-spacing": "error",
+ "comma-style": ["error", "last"],
+ "curly": ["error", "multi-line", "consistent"],
+ "eol-last": "error",
+ "func-call-spacing": "error",
+ "function-call-argument-newline": ["error", "consistent"],
+ "function-paren-newline": ["error", "consistent"],
+ "indent": ["error", 4],
+ "key-spacing": "error",
+ "keyword-spacing": "error",
+ "linebreak-style": ["error", "unix"],
+ "no-extra-semi": "error",
+ "no-mixed-spaces-and-tabs": "error",
+ "no-trailing-spaces": "error",
+ "no-whitespace-before-property": "error",
+ "object-curly-newline": ["error", {consistent: true, multiline: true}],
+ "quote-props": ["error", "consistent-as-needed"],
+ "semi": ["error", "always"],
+ "semi-spacing": "error",
+ "semi-style": ["error", "last"],
+ "space-before-blocks": "error",
+ "space-before-function-paren": ["error", "never"],
+ "space-in-parens": ["error", "never"],
+ "space-infix-ops": "error",
+ "space-unary-ops": "error",
+ "switch-colon-spacing": "error",
+ "template-curly-spacing": ["error", "never"],
+ "unicode-bom": "error",
+ // "no-multi-spaces": "error", // TODO: enable?
+ // "object-curly-spacing": "off", // TODO: enable?
+ // "object-property-newline": "off", // TODO: enable?
+ // "operator-linebreak": "off", // TODO: enable?
+ // "quotes": ["error", "double", {avoidEscape: true}], // TODO: enable?
+ },
+};
diff --git a/.gitignore b/.gitignore
index 7328401f..46654d83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,5 @@ notification.mp3
/test/stderr.txt
/cache.json*
/config_states/
+/node_modules
+/package-lock.json \ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..c0ba4067
--- /dev/null
+++ b/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "stable-diffusion-webui",
+ "version": "0.0.0",
+ "devDependencies": {
+ "eslint": "^8.40.0"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "fix": "eslint --fix ."
+ }
+}