Adds the following npm scripts:
- npm run lint
- npm run lint:js
- npm run lint:styles
- npm run lint:i18n
Bug: T242781
Change-Id: I0c2cfce73a02029b9d0c4d329309aff477cb02d4
This adds the wmf theme styles to our jsdoc as can be seen on
https://doc.wikimedia.org/Parsoid/master/.
There is a caveat with this though. jsdoc-wmf-theme adds warnings for
unlinked symbols (e.g. 'return {jQuery}') [1] which causes the jsdoc doc
generation to fail since it is set to fail on warnings (we have it
configured with `pedantic: true`).
If we add the jsdoc-wmf-theme, we will need to be stricter about our
symbol usage which could be a good thing or just be tedious and
annoying.
What do you think?
[1] https://github.com/cscott/jsdoc-wmf-theme/blob/master/publish.js#L29
Bug: T239258
Change-Id: Icade62a278d7e685cbda28a8ca26a1b703e64f19
* jsdoc.json was copied from Minerva. The markdown plugin from that
config was removed since there no usages of that in Vector.
* Added latest jsdoc dependency to package.json
* Copied 'jsdoc' task from Minerva into Vector. Revised storybook output
so that multiple docs (storybook + jsdoc) could be in /docs
* Made collapsibleTabs.js JSDoc compliant (This was really the only
thing using jsduck syntax)
* Modified Gruntfile stylelinter to ignore docs folder
Bug: T239258
Change-Id: Id07d591ffe7bf0ac021109051e89b91ffdcf4c78
- Update package.json with the new dependencies.
- A script storybook.sh pulls down CSS and LESS imports from external
dependencies. This copies the approach taken in Popups and MobileFrontend.
- Icons from external repos are maintained within the repo in SVG-only form.
Using load.php modules is also possible, but will pull down other unnecessary icons
and break if any of these modules are changed. Decided that we should manually maintain
these for the time being given there are only 3 icons.
- Several LESS files now import the variables file. I think it's useful for stories
to only import the CSS they use as this encourages us to modularise our CSS. Before these
imports were not necessary as they inherit imports from index.less. This will have no impact
on the bundle size as the LESS compiler silently discards duplicate imports
- stories/utils.js provides a useful placeholder function for generalising our hook entry
points.
Bug: T242674
Change-Id: I722e84d2fb57653a2f96142dc3e5248043261746
* Rename 'rtl' to 'isRTL' and use DOM to compute its value.
* Document code with JSDuck similar to other extensions.
* Remove unused 'prevElement' property. Not used in Vector
nor anywhere else in Wikimedia Git.
* Make 'boundEvent' property private. Not used anywhere in
Wikimedia Git outside this file.
* Simplify 'instances' tracking.
The jQuery object stored in this property wasn't used beyond
calling each(). Convert to a plain array.
Preserve and re-use the jQuery object first created
by collapsibleTabs().
* Simplify calculateTabDistance() by using getElementById() and
getBoundingClientRect(). Its support includes IE 5.
The "new" version (since Firefox 3.5 and IE 9) also includes
'height' and 'width' properties and is supported in all
browsers supported by the MediaWiki 1.28 startup feature test.
This helps avoid code in offset() and width(), which is fairly
expensive in jQuery 1.x.
* moveToCollapsed()
- Remove redundant jQuery object creation (only caller passes a
jQuery object already).
- Remove redundant re-receiving of expContainerSettings inside
the animate() callback. Already in the main scope.
Relates to a bunch of patches that work around a problem
caused by use of remove() instead of detach() in an earlier
version of the code. Which was only a problem because the
other settings object was also not used from the main scope.
(See pre-Gerrit commits 1f93310e and e7900807.)
Change-Id: I48d542580d767df2d17ce4c6668e9e233a0f7902
Update grunt-contrib-jshint to 1.0.0
Update grunt-banana-checker to 0.5.0
Update grunt-jscs to 2.8.0
Change-Id: I2875efab17acc9007725f1e79b9353cb8b0ceb3f
Difference between 0.2.2 and 0.4.0
0.4.0
* Make disallowUnusedTranslations default to false (Ed Sanders)
* Make disallowDuplicateTranslations default to false (Ed Sanders)
* build: Remove use of global grunt-cli (Timo Tijhof)
* build: Add Node.js v0.12 and v4.0 (Timo Tijhof)
* tests: Migrate Travis to container-based infrastructure (James D.
* Forrester)
* readme: Add line break between images and h1 (Timo Tijhof)
0.3.0
* Fail if the target directory doesn't exist (James D. Forrester)
* Allow individual checks to be disabled in config (James D. Forrester)
* Be able to require complete translations, or specific messages in all
* translations (James D. Forrester)
* build: Bump grunt-jscs to latest version (James D. Forrester)
* Enforce disallowBlankTranslations, disallowDuplicateTranslations and
* disallowUnusedTranslations (James D. Forrester)
Change-Id: I68c5c747d2f92fdedd7e4450f618f577f493fb4a