Skip to content

Commit 13f4c62

Browse files
committed
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).
1 parent 9ac85b8 commit 13f4c62

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extensions
2+
extensions-disabled
3+
repositories
4+
venv

.eslintrc.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
// "extends": "eslint:recommended",
7+
parserOptions: {
8+
ecmaVersion: "latest",
9+
},
10+
rules: {
11+
"arrow-spacing": "error",
12+
"block-spacing": "error",
13+
"brace-style": "error",
14+
"comma-dangle": ["error", "only-multiline"],
15+
"comma-spacing": "error",
16+
"comma-style": ["error", "last"],
17+
"curly": ["error", "multi-line", "consistent"],
18+
"eol-last": "error",
19+
"func-call-spacing": "error",
20+
"function-call-argument-newline": ["error", "consistent"],
21+
"function-paren-newline": ["error", "consistent"],
22+
"indent": ["error", 4],
23+
"key-spacing": "error",
24+
"keyword-spacing": "error",
25+
"linebreak-style": ["error", "unix"],
26+
"no-extra-semi": "error",
27+
"no-mixed-spaces-and-tabs": "error",
28+
"no-trailing-spaces": "error",
29+
"no-whitespace-before-property": "error",
30+
"object-curly-newline": ["error", {consistent: true, multiline: true}],
31+
"quote-props": ["error", "consistent-as-needed"],
32+
"semi": ["error", "always"],
33+
"semi-spacing": "error",
34+
"semi-style": ["error", "last"],
35+
"space-before-blocks": "error",
36+
"space-before-function-paren": ["error", "never"],
37+
"space-in-parens": ["error", "never"],
38+
"space-infix-ops": "error",
39+
"space-unary-ops": "error",
40+
"switch-colon-spacing": "error",
41+
"template-curly-spacing": ["error", "never"],
42+
"unicode-bom": "error",
43+
// "no-multi-spaces": "error", // TODO: enable?
44+
// "object-curly-spacing": "off", // TODO: enable?
45+
// "object-property-newline": "off", // TODO: enable?
46+
// "operator-linebreak": "off", // TODO: enable?
47+
// "quotes": ["error", "double", {avoidEscape: true}], // TODO: enable?
48+
},
49+
};

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ notification.mp3
3434
/test/stderr.txt
3535
/cache.json*
3636
/config_states/
37+
/node_modules
38+
/package-lock.json

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "stable-diffusion-webui",
3+
"version": "0.0.0",
4+
"devDependencies": {
5+
"eslint": "^8.40.0"
6+
},
7+
"scripts": {
8+
"lint": "eslint .",
9+
"fix": "eslint --fix ."
10+
}
11+
}

0 commit comments

Comments
 (0)