Use eslint-plugin-mozilla and the webextensions environment to avoid defining globals in each file.
This commit is contained in:
		
							parent
							
								
									e9cbfbccb4
								
							
						
					
					
						commit
						2e9ae50a3a
					
				| @ -3,11 +3,20 @@ | ||||
|     ../../.eslintrc | ||||
|   ], | ||||
| 
 | ||||
|   "env": { | ||||
|     "webextensions": true | ||||
|   }, | ||||
| 
 | ||||
|   "plugins": [ | ||||
|     "mozilla" | ||||
|   ], | ||||
| 
 | ||||
|   "parserOptions": { | ||||
|     "sourceType": "script" | ||||
|   }, | ||||
| 
 | ||||
|   "rules": { | ||||
|     "mozilla/import-globals": "error", | ||||
|     "object-shorthand": "off", | ||||
|   }, | ||||
| } | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome, CSS */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -14,7 +14,6 @@ See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* eslint strict: ["error", "function"] */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| (function() { | ||||
|   'use strict'; | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| var storageAreaName = chrome.storage.sync ? 'sync' : 'local'; | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -14,7 +14,7 @@ See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* eslint strict: ["error", "function"] */ | ||||
| /* globals chrome, getViewerURL */ | ||||
| /* import-globals-from pdfHandler.js */ | ||||
| 
 | ||||
| (function() { | ||||
|   'use strict'; | ||||
|  | ||||
| @ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome, Features, saveReferer */ | ||||
| /* import-globals-from feature-detect.js */ | ||||
| /* import-globals-from preserve-referer.js */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -13,8 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome, getHeaderFromHeaders */ | ||||
| /* exported saveReferer */ | ||||
| /* import-globals-from pdfHandler.js */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| /** | ||||
|  | ||||
| @ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* globals chrome */ | ||||
| 
 | ||||
| 'use strict'; | ||||
| 
 | ||||
|  | ||||
| @ -14,7 +14,6 @@ See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
| /* eslint strict: ["error", "function"] */ | ||||
| /* globals chrome, crypto, Headers, Request */ | ||||
| 
 | ||||
| (function() { | ||||
|   'use strict'; | ||||
|  | ||||
| @ -8,7 +8,18 @@ | ||||
|     "sourceType": "script" | ||||
|   }, | ||||
| 
 | ||||
|   "plugins": [ | ||||
|     "mozilla" | ||||
|   ], | ||||
| 
 | ||||
|   "globals": { | ||||
|     "Components": false, | ||||
|     "dump": false | ||||
|   }, | ||||
| 
 | ||||
|   "rules": { | ||||
|     "mozilla/import-globals": "error", | ||||
| 
 | ||||
|     // Best Practices | ||||
|     "consistent-return": "error", | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										4
									
								
								extensions/firefox/bootstrap.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								extensions/firefox/bootstrap.js
									
									
									
									
										vendored
									
									
								
							| @ -12,8 +12,8 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, dump, XPCOMUtils, PdfStreamConverter, | ||||
|            APP_SHUTDOWN, PdfjsChromeUtils, PdfjsContentUtils */ | ||||
| /* globals PdfStreamConverter, APP_SHUTDOWN, PdfjsChromeUtils, | ||||
|            PdfjsContentUtils */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,8 +12,7 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, XPCOMUtils, PdfjsContentUtils, | ||||
|            PdfjsContentUtils, PdfStreamConverter, addMessageListener */ | ||||
| /* eslint-env mozilla/frame-script */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,8 +12,6 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, XPCOMUtils, PdfjsChromeUtils, | ||||
|            PdfjsContentUtils, PdfStreamConverter */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,6 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -13,7 +13,6 @@ | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* eslint max-len: ["error", 100] */ | ||||
| /* globals Components, Services */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,8 +12,6 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils, | ||||
|            dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,6 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, XPCOMUtils */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,6 @@ | ||||
|  * See the License for the specific language governing permissions and | ||||
|  * limitations under the License. | ||||
|  */ | ||||
| /* globals Components, Services, XPCOMUtils */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,6 @@ | ||||
| * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | ||||
| */ | ||||
| /* globals Components, PdfJs, Services */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,6 @@ | ||||
| * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | ||||
| */ | ||||
| /* globals Components, PdfjsContentUtils */ | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
|  | ||||
| @ -9,6 +9,7 @@ | ||||
|     "babel-preset-es2015": "^6.24.1", | ||||
|     "escodegen": "^1.8.0", | ||||
|     "eslint": "^3.11.1", | ||||
|     "eslint-plugin-mozilla": "^0.2.47", | ||||
|     "gulp": "^3.9.1", | ||||
|     "gulp-rename": "^1.2.2", | ||||
|     "gulp-replace": "^0.5.4", | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user