Skip to content

Commit 29e9470

Browse files
authored
Prettier (mar10#893)
* Add prettier * Enable prettier for builds * Use tabs (4) for now * Fix jshint for prettier * Add prettier badge * Update changelog * Apply prettier
1 parent 6164164 commit 29e9470

29 files changed

+14016
-11245
lines changed

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
root = true
55

66
[*]
7-
indent_style = tab
8-
indent_size = 4
7+
indent_style = space
8+
indent_size = 2
99
end_of_line = lf
1010
charset = utf-8
1111
trim_trailing_whitespace = true
@@ -16,7 +16,10 @@ indent_style = space
1616
indent_size = 2
1717

1818
[*.js]
19+
# indent_style = space
20+
# indent_size = 2
1921
indent_style = tab
22+
indent_size = 4
2023

2124
[*.coffee]
2225
indent_style = space

.eslintrc.json

Lines changed: 1 addition & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,3 @@
11
{
2-
"env": {
3-
"browser": true,
4-
// "commonjs": true,
5-
// "es6": true,
6-
"jquery": true
7-
},
8-
"globals": {
9-
// "document": false,
10-
// "jQuery": false,
11-
// "window": false
12-
"define": true,
13-
"module": true,
14-
"require": true
15-
},
16-
"rules": {
17-
"no-negated-in-lhs": "error",
18-
"no-cond-assign": [
19-
"error",
20-
"except-parens"
21-
],
22-
"curly": [
23-
"error",
24-
"all"
25-
],
26-
"object-curly-spacing": [
27-
"error",
28-
"always"
29-
],
30-
"computed-property-spacing": [
31-
"error",
32-
"always"
33-
],
34-
"array-bracket-spacing": [
35-
"error",
36-
"always"
37-
],
38-
"eqeqeq": [
39-
"error",
40-
"smart"
41-
],
42-
"no-unused-expressions": "error",
43-
"no-sequences": "error",
44-
"no-nested-ternary": "error",
45-
"no-unreachable": "error",
46-
"wrap-iife": [
47-
"warn",
48-
"outside"
49-
//"inside"
50-
],
51-
"no-caller": "error",
52-
"quotes": [
53-
"error",
54-
"double"
55-
],
56-
"no-undef": "error",
57-
"no-unused-vars": ["error", {
58-
"vars": "all",
59-
"args": "none"
60-
}],
61-
"operator-linebreak": [
62-
"error",
63-
"after"
64-
],
65-
"comma-style": [
66-
"error",
67-
"last"
68-
],
69-
"camelcase": [
70-
"error",
71-
{
72-
"properties": "never"
73-
}
74-
],
75-
"dot-notation": [
76-
"error",
77-
{
78-
"allowPattern": "^[a-z]+(_[a-z]+)+$"
79-
}
80-
],
81-
"max-len": [
82-
"error",
83-
{
84-
"code": 100,
85-
"ignoreComments": true,
86-
"ignoreUrls": true,
87-
"ignoreRegExpLiterals": true
88-
}
89-
],
90-
"no-mixed-spaces-and-tabs": "error",
91-
"no-trailing-spaces": "error",
92-
"no-multi-str": "error",
93-
"comma-dangle": [
94-
"error",
95-
"never"
96-
],
97-
"comma-spacing": [
98-
"error",
99-
{
100-
"before": false,
101-
"after": true
102-
}
103-
],
104-
"space-before-blocks": [
105-
"error",
106-
"always"
107-
],
108-
"space-in-parens": [
109-
"error",
110-
"always", { "exceptions": ["{}", "[]"] }
111-
],
112-
"keyword-spacing": [
113-
2
114-
],
115-
"semi": [
116-
"error",
117-
"always"
118-
],
119-
"semi-spacing": [
120-
"error",
121-
{
122-
// Because of the `for ( ; ...)` requirement
123-
// "before": true,
124-
"after": true
125-
}
126-
],
127-
"space-infix-ops": "error",
128-
"eol-last": "error",
129-
"lines-around-comment": [
130-
"error",
131-
{
132-
// "beforeLineComment": true
133-
}
134-
],
135-
"linebreak-style": [
136-
// "error",
137-
// "warn",
138-
"off", // accept git autoconvert on windows
139-
"unix"
140-
],
141-
"no-with": "error",
142-
"brace-style": "error",
143-
"space-before-function-paren": [
144-
"error",
145-
"never"
146-
],
147-
"no-loop-func": "error",
148-
"no-spaced-func": "error",
149-
"key-spacing": [
150-
"error",
151-
{
152-
"beforeColon": false,
153-
"afterColon": true
154-
}
155-
],
156-
"space-unary-ops": [
157-
"error",
158-
{
159-
"words": false,
160-
"nonwords": false
161-
}
162-
],
163-
"no-multiple-empty-lines": 2
164-
}
2+
"extends": ["plugin:prettier/recommended"]
1653
}

.eslintrc_org.json

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
// "commonjs": true,
5+
// "es6": true,
6+
"jquery": true
7+
},
8+
"globals": {
9+
// "document": false,
10+
// "jQuery": false,
11+
// "window": false
12+
"define": true,
13+
"module": true,
14+
"require": true
15+
},
16+
"rules": {
17+
"no-negated-in-lhs": "error",
18+
"no-cond-assign": [
19+
"error",
20+
"except-parens"
21+
],
22+
"curly": [
23+
"error",
24+
"all"
25+
],
26+
"object-curly-spacing": [
27+
"error",
28+
"always"
29+
],
30+
"computed-property-spacing": [
31+
"error",
32+
"always"
33+
],
34+
"array-bracket-spacing": [
35+
"error",
36+
"always"
37+
],
38+
"eqeqeq": [
39+
"error",
40+
"smart"
41+
],
42+
"no-unused-expressions": "error",
43+
"no-sequences": "error",
44+
"no-nested-ternary": "error",
45+
"no-unreachable": "error",
46+
"wrap-iife": [
47+
"warn",
48+
"outside"
49+
//"inside"
50+
],
51+
"no-caller": "error",
52+
"quotes": [
53+
"error",
54+
"double"
55+
],
56+
"no-undef": "error",
57+
"no-unused-vars": ["error", {
58+
"vars": "all",
59+
"args": "none"
60+
}],
61+
"operator-linebreak": [
62+
"error",
63+
"after"
64+
],
65+
"comma-style": [
66+
"error",
67+
"last"
68+
],
69+
"camelcase": [
70+
"error",
71+
{
72+
"properties": "never"
73+
}
74+
],
75+
"dot-notation": [
76+
"error",
77+
{
78+
"allowPattern": "^[a-z]+(_[a-z]+)+$"
79+
}
80+
],
81+
"max-len": [
82+
"error",
83+
{
84+
"code": 100,
85+
"ignoreComments": true,
86+
"ignoreUrls": true,
87+
"ignoreRegExpLiterals": true
88+
}
89+
],
90+
"no-mixed-spaces-and-tabs": "error",
91+
"no-trailing-spaces": "error",
92+
"no-multi-str": "error",
93+
"comma-dangle": [
94+
"error",
95+
"never"
96+
],
97+
"comma-spacing": [
98+
"error",
99+
{
100+
"before": false,
101+
"after": true
102+
}
103+
],
104+
"space-before-blocks": [
105+
"error",
106+
"always"
107+
],
108+
"space-in-parens": [
109+
"error",
110+
"always", { "exceptions": ["{}", "[]"] }
111+
],
112+
"keyword-spacing": [
113+
2
114+
],
115+
"semi": [
116+
"error",
117+
"always"
118+
],
119+
"semi-spacing": [
120+
"error",
121+
{
122+
// Because of the `for ( ; ...)` requirement
123+
// "before": true,
124+
"after": true
125+
}
126+
],
127+
"space-infix-ops": "error",
128+
"eol-last": "error",
129+
"lines-around-comment": [
130+
"error",
131+
{
132+
// "beforeLineComment": true
133+
}
134+
],
135+
"linebreak-style": [
136+
// "error",
137+
// "warn",
138+
"off", // accept git autoconvert on windows
139+
"unix"
140+
],
141+
"no-with": "error",
142+
"brace-style": "error",
143+
"space-before-function-paren": [
144+
"error",
145+
"never"
146+
],
147+
"no-loop-func": "error",
148+
"no-spaced-func": "error",
149+
"key-spacing": [
150+
"error",
151+
{
152+
"beforeColon": false,
153+
"afterColon": true
154+
}
155+
],
156+
"space-unary-ops": [
157+
"error",
158+
{
159+
"words": false,
160+
"nonwords": false
161+
}
162+
],
163+
"no-multiple-empty-lines": 2
164+
}
165+
}

.jshintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
{
3-
"bitwise": true,
3+
"-W014": true, // Misleading line break before '?'
4+
5+
"bitwise": true,
46
"camelcase": true,
57
"curly": true,
68
"eqeqeq": true,
@@ -11,7 +13,7 @@
1113
"noarg": true,
1214
"nonew": true,
1315
"onevar": true,
14-
"quotmark": "double",
16+
// "quotmark": "double",
1517
"trailing": true,
1618
"undef": true,
1719
"unused": "vars",

0 commit comments

Comments
 (0)