Skip to content

Commit 626f15a

Browse files
gulp overhaul 2.0
- compilation with Babel, Sass, Autoprefixer - switch JSHint/JSCS to ESLint for ES7 support - lint SCSS with scss-lint - update documentation - remove Grunt, makelinks.sh - remove extra OperaBlink config (identical to Chrome)
1 parent d274ff8 commit 626f15a

40 files changed

+677
-1169
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-1"]
3+
}
File renamed without changes.

.eslintrc

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
{
2+
"parser": "babel-eslint",
3+
"plugins": [
4+
"babel"
5+
],
6+
"env": {
7+
"browser": true,
8+
"webextensions": true,
9+
"jquery": true
10+
},
11+
"globals": {
12+
"Favico": false,
13+
"guiders": false,
14+
"Hogan": false,
15+
"Pasteurizer": false,
16+
"SnuOwnd": false,
17+
"Konami": false,
18+
"Imgrush": false,
19+
"MediaPlayer": false,
20+
"gfyObject": false,
21+
22+
"unsafeWindow": false,
23+
"permissionQueue": false,
24+
25+
"RESUtils": true,
26+
"RESMetadata": true,
27+
"modules": true,
28+
"libraries": true,
29+
"RESEnvironment": true,
30+
"RESdoBeforeLoad": true,
31+
"RESInit": true,
32+
"xhrQueue": true,
33+
"RESConsole": true,
34+
"RESStorage": true,
35+
"RESRunOnce": true,
36+
"RESInitReadyCheck": true,
37+
"RESdoAfterLoad": true,
38+
"safeJSON": true,
39+
"RESVersion": true,
40+
"RESdefaultModuleID": true,
41+
"escapeHTML": true,
42+
"addModule": true,
43+
"addLibrary": true,
44+
"perfTest": true,
45+
"RESTemplates": true,
46+
"BrowserDetect": true,
47+
"RESOptionsMigrate": true,
48+
"gdAlert": true,
49+
50+
"exports": true
51+
},
52+
"rules": {
53+
// Reimplemented for ES6/7 compatibility
54+
"babel/generator-star-spacing": [2, { "before": false, "after": true }],
55+
//"babel/new-cap": 2,
56+
//"babel/object-curly-spacing": [2, "always"],
57+
//"babel/object-shorthand": 2,
58+
//"babel/arrow-parens": [2, "as-needed"],
59+
"babel/no-await-in-loop": 2,
60+
61+
// ES6
62+
//"arrow-body-style": 2,
63+
"arrow-spacing": 2,
64+
"constructor-super": 2,
65+
"no-arrow-condition": 2,
66+
"no-class-assign": 2,
67+
"no-const-assign": 2,
68+
"no-dupe-class-members": 2,
69+
"no-this-before-super": 2,
70+
//"no-var": 2,
71+
//"prefer-arrow-callback": 2,
72+
"prefer-const": 2,
73+
//"prefer-reflect": 2,
74+
//"prefer-spread": 2,
75+
//"prefer-template": 2,
76+
"require-yield": 2,
77+
78+
// Legacy / JSHint compat
79+
//"max-depth": [1, 3],
80+
//"max-len": [1, 80],
81+
//"max-statements": [1, 15],
82+
83+
// Possible Errors
84+
//"comma-dangle": 2,
85+
"no-cond-assign": 2,
86+
//"no-console": 2,
87+
//"no-constant-condition": 2,
88+
"no-control-regex": 2,
89+
"no-debugger": 2,
90+
"no-dupe-args": 2,
91+
"no-dupe-keys": 2,
92+
"no-duplicate-case": 2,
93+
"no-empty-character-class": 2,
94+
"no-empty": 2,
95+
"no-ex-assign": 2,
96+
"no-extra-boolean-cast": 2,
97+
//"no-extra-parens": 2,
98+
"no-extra-semi": 2,
99+
"no-func-assign": 2,
100+
//"no-inner-declarations": 2, ES6 has block-scoped functions
101+
"no-invalid-regexp": 2,
102+
//"no-irregular-whitespace": 2,
103+
"no-negated-in-lhs": 2,
104+
"no-obj-calls": 2,
105+
"no-regex-spaces": 2,
106+
"no-sparse-arrays": 2,
107+
"no-unexpected-multiline": 2,
108+
"no-unreachable": 2,
109+
"use-isnan": 2,
110+
//"valid-jsdoc": [2, { "requireParamDescription": false, "prefer": { "return": "returns" } }],
111+
"valid-typeof": 2,
112+
113+
// Best Practices
114+
"accessor-pairs": 2,
115+
//"block-scoped-var": 2,
116+
"complexity": 1,
117+
//"consistent-return": 2,
118+
//"curly": 2,
119+
//"default-case": 2,
120+
//"dot-location": [2, "property"],
121+
//"dot-notation": 2,
122+
//"eqeqeq": 2,
123+
//"guard-for-in": 2,
124+
//"no-alert": 2,
125+
//"no-caller": 2,
126+
"no-div-regex": 2,
127+
//"no-else-return": 2,
128+
"no-empty-label": 2,
129+
"no-empty-pattern": 2,
130+
"no-eq-null": 2,
131+
"no-eval": 2,
132+
"no-extend-native": 2,
133+
"no-extra-bind": 2,
134+
"no-fallthrough": 2,
135+
"no-floating-decimal": 2,
136+
//"no-implicit-coercion": [2, { "boolean": false }],
137+
"no-implied-eval": 2,
138+
//"no-invalid-this": 2,
139+
"no-iterator": 2,
140+
"no-labels": 2,
141+
"no-lone-blocks": 2,
142+
//"no-loop-func": 2,
143+
//"no-magic-numbers": 2,
144+
//"no-multi-spaces": 2,
145+
//"no-multi-str": 2,
146+
"no-native-reassign": 2,
147+
"no-new-func": 2,
148+
"no-new-wrappers": 2,
149+
//"no-new": 2,
150+
"no-octal-escape": 2,
151+
"no-octal": 2,
152+
//"no-param-reassign": 2,
153+
"no-process-env": 2,
154+
"no-proto": 2,
155+
"no-redeclare": 2,
156+
"no-return-assign": 2,
157+
"no-script-url": 2,
158+
"no-self-compare": 2,
159+
"no-sequences": 2,
160+
//"no-throw-literal": 2,
161+
"no-unused-expressions": 2,
162+
"no-useless-call": 2,
163+
//"no-useless-concat": 2,
164+
"no-void": 2,
165+
//"no-warning-comments": 2,
166+
"no-with": 2,
167+
"radix": 2,
168+
//"vars-on-top": 2, no-var is enabled
169+
//"wrap-iife": [2, "inside"],
170+
//"yoda": 2,
171+
172+
// Variables
173+
//"init-declarations": 2,
174+
"no-catch-shadow": 2,
175+
"no-delete-var": 2,
176+
"no-label-var": 2,
177+
"no-shadow-restricted-names": 2,
178+
//"no-shadow": 2,
179+
"no-undef-init": 2,
180+
"no-undef": 2,
181+
//"no-undefined": 2,
182+
//"no-unused-vars": [2, { "args": "none" }],
183+
//"no-use-before-define": [2, "nofunc"],
184+
185+
// Code Style
186+
//"array-bracket-spacing": 2,
187+
//"block-spacing": 2,
188+
//"brace-style": [2, "1tbs", { "allowSingleLine": true }],
189+
//"camelcase": 2,
190+
//"comma-spacing": 2,
191+
"comma-style": 2,
192+
"computed-property-spacing": 2,
193+
//"consistent-this": [2, "this"], // do not alias `this`, use arrow functions
194+
"eol-last": 2,
195+
//"func-names": 2, // all anonymous functions should be arrows
196+
//"func-style": [2, "declaration"],
197+
//"id-length": 2,
198+
//"id-match": 2,
199+
//"indent": [2, "tab"],
200+
//"jsx-quotes": 2,
201+
//"key-spacing": 2,
202+
//"linebreak-style": 2,
203+
//"lines-around-comment": [2, { "allowBlockStart": true }],
204+
//"max-nested-callbacks": [2, 3],
205+
"new-parens": 2,
206+
//"newline-after-var": [2, "never"],
207+
"no-array-constructor": 2,
208+
//"no-continue": 2,
209+
//"no-inline-comments": 2,
210+
//"no-lonely-if": 2,
211+
//"no-mixed-spaces-and-tabs": 2,
212+
//"no-multiple-empty-lines": 2,
213+
//"no-negated-condition": 2,
214+
//"no-nested-ternary": 2,
215+
"no-new-object": 2,
216+
"no-spaced-func": 2,
217+
//"no-ternary": 2,
218+
//"no-trailing-spaces": 2,
219+
//"no-underscore-dangle": 2,
220+
//"no-unneeded-ternary": 2,
221+
//"one-var": [2, { "initialized": "never" }],
222+
//"operator-assignment": [2, "always"],
223+
"operator-linebreak": [2, "after"],
224+
//"padded-blocks": [2, "never"],
225+
//"quote-props": [2, "as-needed"],
226+
"quotes": [2, "single"],
227+
//"require-jsdoc": 2,
228+
//"semi-spacing": 2,
229+
"semi": 2,
230+
//"sort-vars": 2,
231+
//"space-after-keywords": 2,
232+
//"space-before-blocks": 2,
233+
//"space-before-function-paren": [2, "never"],
234+
//"space-before-keywords": 2,
235+
//"space-in-parens": 2,
236+
//"space-infix-ops": 2,
237+
"space-return-throw-case": 2
238+
//"space-unary-ops": 2,
239+
//"spaced-comment": 2,
240+
//"wrap-regex": 2
241+
}
242+
}

.gitignore

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,6 @@ node_modules
1313

1414
# Copied files
1515
dist/
16-
/Chrome/*.js
17-
/Chrome/*.css
18-
/Chrome/templates.html
19-
!/Chrome/background.js
20-
/Chrome/core/*
21-
/Chrome/modules/*
22-
/Chrome/vendor/*
23-
/OperaBlink/*.js
24-
/OperaBlink/*.css
25-
/OperaBlink/templates.html
26-
!/OperaBlink/background.js
27-
/OperaBlink/core/*
28-
/OperaBlink/modules/*
29-
/OperaBlink/vendor/*
30-
/RES.safariextension/*.js
31-
/RES.safariextension/*.css
32-
/RES.safariextension/templates.html
33-
/RES.safariextension/core/*
34-
/RES.safariextension/modules/*
35-
/RES.safariextension/vendor/*
36-
/Opera/*.js
37-
/Opera/*.css
38-
/Opera/templates.html
39-
!/Opera/opera-*.js
40-
/Opera/core/*
41-
/Opera/modules/*
42-
/Opera/vendor/*
43-
!/Opera/includes/*
44-
/XPI/data/*
45-
!/XPI/data/images
46-
!/XPI/lib/main.js
47-
!/lib/*
48-
!browsersupport-*.js
49-
/OperaBlink/browsersupport-chrome.js
5016

5117
/tests/selenium/opera-profile/
5218
/tests/selenium/opera-profile-patch/

.jscsrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 55 deletions
This file was deleted.

.scss-lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Inherits from default config
2+
# https://github.com/brigade/scss-lint/blob/master/config/default.yml
3+
4+
linters:
5+
Indentation:
6+
character: tab
7+
width: 1
8+
9+
LeadingZero:
10+
style: include_zero
11+
12+
PropertySortOrder:
13+
order: smacss
14+
15+
# Linters below are temporarily disabled/loosened
16+
# as fixing them immediately would require restructuring a lot of our HTML
17+
18+
QualifyingElement:
19+
allow_element_with_class: true
20+
21+
IdSelector:
22+
enabled: false
23+
24+
SelectorFormat:
25+
enabled: false
26+
27+
ImportantRule:
28+
enabled: false

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- "0.12"
4+
- "5.0"
55
before_script:
6-
- npm install -g grunt-cli
7-
script: grunt travis
6+
- npm install -g gulp
7+
- gem install scss_lint
8+
script: gulp travis

0 commit comments

Comments
 (0)