Vulcan/packages/custom/package.js
Maxime Quandalle 94c6121d91 Improve jsHint consistency
This commit touch a lot of lines of code with the goal to be more
rigorous about JavaScript code conventions defined in the `.jshintrc`.

Some modification:

* Add a list of used global symbols in the corresponding section of
  `.jshintrc`
* Use local variables instead of global in a lot of places where the
  keyword `var` was mistakenly forgotten
* Add missing semi-colons after instructions
* Add new lines at the end of files
* Remove trailing whitespaces
* Use newer name of some Meteor APIs, eg `addFiles` instead of
  `add_files`
* Add missing `break` statements in `switch` blocks
* Use `===` instead of `==` and `!==` instead of `!=`
* Remove unused variables

This commit should also fix a few bugs due to this lack of rigor. One
example of that was the test `typeof navElements === "array"` that was
never true because in JavaScript, `typeof [] === "object"`, we
replaced this test by the `_.isArray` method provided by underscore.
It might also fix some potential collision related to global
variables.

There is still plenty of work until Telescope code base passes jsHint
validation, but at least this commit is a step in the right direction.
2015-05-01 18:38:27 +02:00

87 lines
2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Package.describe({
summary: 'Telescope blank package use as template for your own packages',
version: '0.1.0',
name: 'telescope-blank'
});
Npm.depends({
// NPM package dependencies
});
Package.onUse(function (api) {
// --------------------------- 1. Meteor packages dependencies ---------------------------
// automatic (let the package specify where it's needed)
api.use([
'tap:i18n', // internationalization package
'iron:router', // routing package
'telescope-base', // basic Telescope hooks and objects
'telescope:lib', // useful functions
'telescope:settings',
'telescope:i18n', // internationalization wrapper
'fourseven:scss' // SCSS compilation package
]);
// client
api.use([
'jquery', // useful for DOM interactions
'underscore', // JavaScript swiss army knife library
'templating' // required for client-side templates
], ['client']);
// server
api.use([
//
], ['server']);
// ---------------------------------- 2. Files to include ----------------------------------
// i18n config (must come first)
api.addFiles([
'package-tap.i18n'
], ['client', 'server']);
// both
api.addFiles([
'lib/custom_fields.js',
'lib/hooks.js',
'lib/main.js',
'lib/routes.js',
'lib/settings.js',
'lib/templates.js'
], ['client', 'server']);
// client
api.addFiles([
'lib/client/templates/custom_template.html',
'lib/client/templates/custom_template.js',
'lib/client/templates/customPostTitle.html',
'lib/client/stylesheets/custom.scss'
], ['client']);
// server
api.addFiles([
'lib/server/publications.js'
], ['server']);
// i18n languages (must come last)
api.addFiles([
'i18n/en.i18n.json',
], ['client', 'server']);
// -------------------------------- 3. Variables to export --------------------------------
api.export([
'myFunction'
]);
});