fix linting errors

* add strict mode
* fix trailing commas
This commit is contained in:
Peter Krautzberger 2015-07-24 10:39:25 +02:00
parent 1350d174f6
commit 08932e468f

View File

@ -25,16 +25,16 @@ THE SOFTWARE.
*/ */
module.exports = function(grunt) { module.exports = function(grunt) {
"use strict";
// # Notes # // # Notes #
// NEVER remove: // NEVER remove:
// //
// * LICENSE -- the Apache license. // * LICENSE -- the Apache license.
// * jax/element/mml -- this implements MathJax's internal format. Keep either the packed or unpacked copy. // * jax/element/mml -- this implements MathJax"s internal format. Keep either the packed or unpacked copy.
// //
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON("package.json"),
clean: { clean: {
// //
// ## Early choices // ## Early choices
@ -51,7 +51,7 @@ module.exports = function(grunt) {
"localization", "localization",
"MathJax.js" "MathJax.js"
], ],
// If you don't need combined configuration files or want to build your own: // If you don"t need combined configuration files or want to build your own:
allConfigs: [ allConfigs: [
"config", "config",
"unpacked/config" "unpacked/config"
@ -60,7 +60,7 @@ module.exports = function(grunt) {
// ## Choosing a font // ## Choosing a font
// See http://docs.mathjax.org/en/latest/font-support.html#font-configuration for background information // See http://docs.mathjax.org/en/latest/font-support.html#font-configuration for background information
// //
// 1. Remove font files and font data for fonts you won't use. // 1. Remove font files and font data for fonts you won"t use.
// **IMPORTANT.** Make sure to prevent fallbacks and local fonts in your configuration! // **IMPORTANT.** Make sure to prevent fallbacks and local fonts in your configuration!
// //
// //
@ -124,7 +124,7 @@ module.exports = function(grunt) {
// Remove font formats // Remove font formats
// If you know you only need a specific format of your remaining fonts (e.g., woff), then you can delete the others. // If you know you only need a specific format of your remaining fonts (e.g., woff), then you can delete the others.
dropFonts: [ // if you use SVG output, you can drop all font formats (SVG output uses the data in `jax/output/SVG/fonts/...`) dropFonts: [ // if you use SVG output, you can drop all font formats (SVG output uses the data in `jax/output/SVG/fonts/...`)
"fonts", "fonts"
], ],
eot: [ eot: [
"fonts/**/eot" "fonts/**/eot"
@ -142,7 +142,7 @@ module.exports = function(grunt) {
"fonts/**/woff" "fonts/**/woff"
], ],
// ## Choose the input // ## Choose the input
// Remove input that you don't need. // Remove input that you don"t need.
// **Note.** This includes combined configuration files. // **Note.** This includes combined configuration files.
asciimathInput: [ asciimathInput: [
"config/AM*", "config/AM*",
@ -164,7 +164,7 @@ module.exports = function(grunt) {
"config/TeX*", "config/TeX*",
"jax/input/TeX", "jax/input/TeX",
"unpacked/config/TeX*", "unpacked/config/TeX*",
"unpacked/jax/input/TeX", "unpacked/jax/input/TeX"
], ],
// ## Extensions // ## Extensions
extensionsAsciimath: [ extensionsAsciimath: [
@ -220,7 +220,7 @@ module.exports = function(grunt) {
"jax/output/CommonHTML", "jax/output/CommonHTML",
"unpacked/jax/output/CommonHTML", "unpacked/jax/output/CommonHTML",
"extensions/CHTML-preview.js", "extensions/CHTML-preview.js",
"unpacked/extensions/CHTML-preview.js", "unpacked/extensions/CHTML-preview.js"
], ],
// ## Locales // ## Locales
// Removes all locale files. Change this as needed to keep your preferred language. // Removes all locale files. Change this as needed to keep your preferred language.
@ -260,7 +260,7 @@ module.exports = function(grunt) {
"unpacked/extensions/MathMenu.js", "unpacked/extensions/MathMenu.js",
"unpacked/extensions/MathZoom.js", "unpacked/extensions/MathZoom.js",
"unpacked/extensions/Safe.js", "unpacked/extensions/Safe.js",
"unpacked/extensions/CHTML-preview.js", "unpacked/extensions/CHTML-preview.js"
// "unpacked/extensions/toMathML.js", // only remove `toMathML.js` if you know exactly what you are doing. // "unpacked/extensions/toMathML.js", // only remove `toMathML.js` if you know exactly what you are doing.
], ],
images: [ images: [
@ -279,101 +279,101 @@ module.exports = function(grunt) {
} }
}); });
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks("grunt-contrib-clean");
grunt.registerTask('template', [ grunt.registerTask("template", [
// **Notes** on the template. When instructions say "Pick one", this means commenting out one item (so that it's not cleaned). // **Notes** on the template. When instructions say "Pick one", this means commenting out one item (so that it"s not cleaned).
// //
// Early choices. // Early choices.
'clean:unpacked', "clean:unpacked",
'clean:packed', // pick one -- packed for production, unpacked for development. "clean:packed", // pick one -- packed for production, unpacked for development.
'clean:allConfigs', // if you do not need any combined configuration files. "clean:allConfigs", // if you do not need any combined configuration files.
// Fonts. Pick at least one! Check notes above on configurations. // Fonts. Pick at least one! Check notes above on configurations.
'clean:fontAsana', "clean:fontAsana",
'clean:fontGyrePagella', "clean:fontGyrePagella",
'clean:fontGyreTermes', "clean:fontGyreTermes",
'clean:fontLatinModern', "clean:fontLatinModern",
'clean:fontNeoEuler', "clean:fontNeoEuler",
'clean:fontStix', "clean:fontStix",
'clean:fontStixWeb', "clean:fontStixWeb",
'clean:fontTeX', "clean:fontTeX",
// Font formats. Pick at least one (unless you use SVG output; then clean all). // Font formats. Pick at least one (unless you use SVG output; then clean all).
'clean:dropFonts', // when using SVG output "clean:dropFonts", // when using SVG output
'clean:eot', "clean:eot",
'clean:otf', "clean:otf",
'clean:png', "clean:png",
'clean:svg', "clean:svg",
'clean:woff', "clean:woff",
// Input. Pick at least one. // Input. Pick at least one.
'clean:asciimathInput', "clean:asciimathInput",
'clean:mathmlInput', "clean:mathmlInput",
'clean:texInput', "clean:texInput",
// Output // Output
'clean:htmlCssOutput', "clean:htmlCssOutput",
'clean:mathmlOutput', "clean:mathmlOutput",
'clean:svgOutput', "clean:svgOutput",
// Extensions. You probably want to leave the set matching your choices. // Extensions. You probably want to leave the set matching your choices.
'clean:extensionsAsciimath', "clean:extensionsAsciimath",
'clean:extensionsMathml', "clean:extensionsMathml",
'clean:extensionsTeX', "clean:extensionsTeX",
'clean:extensionHtmlCss', "clean:extensionHtmlCss",
// Other items // Other items
'clean:locales', "clean:locales",
'clean:miscConfig', "clean:miscConfig",
// 'clean:miscExtensions', // you probably want that // "clean:miscExtensions", // you probably want that
'clean:images', "clean:images",
'clean:notcode' "clean:notcode"
]); ]);
grunt.registerTask('MML_SVG_TeX', [ grunt.registerTask("MML_SVG_TeX", [
// Early choices. // Early choices.
'clean:unpacked', "clean:unpacked",
// 'clean:packed', // pick one -- packed for production, unpacked for development. // "clean:packed", // pick one -- packed for production, unpacked for development.
'clean:allConfigs', // if you do not need any combined configuration files. "clean:allConfigs", // if you do not need any combined configuration files.
// Fonts. Pick at least one! Check notes above on configurations. // Fonts. Pick at least one! Check notes above on configurations.
'clean:fontAsana', "clean:fontAsana",
'clean:fontGyrePagella', "clean:fontGyrePagella",
'clean:fontGyreTermes', "clean:fontGyreTermes",
'clean:fontLatinModern', "clean:fontLatinModern",
'clean:fontNeoEuler', "clean:fontNeoEuler",
'clean:fontStix', "clean:fontStix",
'clean:fontStixWeb', "clean:fontStixWeb",
// 'clean:fontTeX', // "clean:fontTeX",
// Font formats. Pick at least one (unless you use SVG output; then clean all). // Font formats. Pick at least one (unless you use SVG output; then clean all).
'clean:dropFonts', // when using SVG output "clean:dropFonts", // when using SVG output
'clean:eot', "clean:eot",
'clean:otf', "clean:otf",
'clean:png', "clean:png",
'clean:svg', "clean:svg",
'clean:woff', "clean:woff",
// Input. Pick at least one. // Input. Pick at least one.
'clean:asciimathInput', "clean:asciimathInput",
// 'clean:mathmlInput', // "clean:mathmlInput",
'clean:texInput', "clean:texInput",
// Output // Output
'clean:htmlCssOutput', "clean:htmlCssOutput",
'clean:mathmlOutput', "clean:mathmlOutput",
// 'clean:svgOutput', // "clean:svgOutput",
// Extensions. You probably want to leave the set matching your choices. // Extensions. You probably want to leave the set matching your choices.
'clean:extensionsAsciimath', "clean:extensionsAsciimath",
// 'clean:extensionsMathml', // "clean:extensionsMathml",
'clean:extensionsTeX', "clean:extensionsTeX",
'clean:extensionHtmlCss', "clean:extensionHtmlCss",
// Other items // Other items
'clean:locales', "clean:locales",
'clean:miscConfig', "clean:miscConfig",
// 'clean:miscExtensions', // you probably want that // "clean:miscExtensions", // you probably want that
'clean:images', "clean:images",
'clean:notcode' "clean:notcode"
]); ]);
grunt.registerTask('mjNode', [ grunt.registerTask("mjNode", [
'clean:packed', "clean:packed",
'clean:allConfigs', "clean:allConfigs",
'clean:dropFonts', "clean:dropFonts",
'clean:htmlCssOutput', "clean:htmlCssOutput",
'clean:locales', "clean:locales",
'clean:miscConfig', "clean:miscConfig",
'clean:images', "clean:images",
'clean:notcode', "clean:notcode",
'clean:miscExtensions' "clean:miscExtensions"
]); ]);
}; };