Skip to content

Commit 613267c

Browse files
authored
DEV: apply coding standards (#90)
1 parent c89e0dd commit 613267c

File tree

13 files changed

+1675
-166
lines changed

13 files changed

+1675
-166
lines changed

.eslintrc

+1-104
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,3 @@
11
{
2-
"env": {
3-
"jasmine": true,
4-
"node": true,
5-
"mocha": true,
6-
"browser": true,
7-
"builtin": true
8-
},
9-
"parserOptions": {
10-
"ecmaVersion": 7,
11-
"sourceType": "module"
12-
},
13-
"globals":
14-
{"Ember":true,
15-
"jQuery":true,
16-
"$":true,
17-
"RSVP":true,
18-
"Discourse":true,
19-
"Em":true,
20-
"PreloadStore":true,
21-
"Handlebars":true,
22-
"I18n":true,
23-
"bootbox":true,
24-
"module":true,
25-
"moduleFor":true,
26-
"moduleForComponent":true,
27-
"Pretender":true,
28-
"sandbox":true,
29-
"controllerFor":true,
30-
"test":true,
31-
"ok":true,
32-
"not":true,
33-
"expect":true,
34-
"equal":true,
35-
"visit":true,
36-
"andThen":true,
37-
"click":true,
38-
"currentPath":true,
39-
"currentRouteName":true,
40-
"currentURL":true,
41-
"fillIn":true,
42-
"keyEvent":true,
43-
"triggerEvent":true,
44-
"count":true,
45-
"exists":true,
46-
"visible":true,
47-
"invisible":true,
48-
"asyncRender":true,
49-
"selectDropdown":true,
50-
"asyncTestDiscourse":true,
51-
"fixture":true,
52-
"find":true,
53-
"sinon":true,
54-
"moment":true,
55-
"start":true,
56-
"_":true,
57-
"alert":true,
58-
"containsInstance":true,
59-
"deepEqual":true,
60-
"notEqual":true,
61-
"define":true,
62-
"require":true,
63-
"requirejs":true,
64-
"hasModule":true,
65-
"Blob":true,
66-
"File":true},
67-
"rules": {
68-
"block-scoped-var": 2,
69-
"dot-notation": 0,
70-
"eqeqeq": [
71-
2,
72-
"allow-null"
73-
],
74-
"guard-for-in": 2,
75-
"no-bitwise": 2,
76-
"no-caller": 2,
77-
"no-cond-assign": 0,
78-
"no-debugger": 2,
79-
"no-empty": 0,
80-
"no-eval": 2,
81-
"no-extend-native": 2,
82-
"no-extra-parens": 0,
83-
"no-irregular-whitespace": 2,
84-
"no-iterator": 2,
85-
"no-loop-func": 2,
86-
"no-multi-str": 2,
87-
"no-new": 2,
88-
"no-plusplus": 0,
89-
"no-proto": 2,
90-
"no-script-url": 2,
91-
"no-sequences": 2,
92-
"no-shadow": 2,
93-
"no-undef": 2,
94-
"no-unused-vars": 2,
95-
"no-with": 2,
96-
"no-this-before-super": 2,
97-
"semi": 2,
98-
"strict": 0,
99-
"valid-typeof": 2,
100-
"wrap-iife": [
101-
2,
102-
"inside"
103-
]
104-
},
105-
"parser": "babel-eslint"
2+
"extends": "eslint-config-discourse"
1063
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
yarn-error.log
3+
.rubocop-https---raw-githubusercontent-com-discourse-*

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.template-lintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
plugins: ["ember-template-lint-plugin-discourse"],
3+
extends: "discourse:recommended",
4+
};

assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import I18n from "I18n";
12
import DiscourseUrl from "discourse/lib/url";
23

34
export default {
@@ -16,10 +17,10 @@ export default {
1617
},
1718

1819
setupComponent(args, component) {
19-
const statuses = ["all", "solved", "unsolved"].map(status => {
20+
const statuses = ["all", "solved", "unsolved"].map((status) => {
2021
return {
2122
name: I18n.t(`solved.topic_status_filter.${status}`),
22-
value: status
23+
value: status,
2324
};
2425
});
2526
component.set("statuses", statuses);
@@ -42,7 +43,7 @@ export default {
4243
? queryStrings.substr(1).split("&")
4344
: [];
4445

45-
params = params.filter(param => !param.startsWith("solved="));
46+
params = params.filter((param) => !param.startsWith("solved="));
4647

4748
if (newStatus && newStatus !== "all") {
4849
newStatus = newStatus === "solved" ? "yes" : "no";
@@ -53,6 +54,6 @@ export default {
5354
DiscourseUrl.routeTo(
5455
`${location.pathname}${queryStrings}${location.hash}`
5556
);
56-
}
57-
}
57+
},
58+
},
5859
};

assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export default {
55
"category.custom_fields.enable_accepted_answers",
66
value ? "true" : "false"
77
);
8-
}
9-
}
8+
},
9+
},
1010
};

0 commit comments

Comments
 (0)