diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..2a845caea --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,21 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true, + "qunit": true + }, + "globals": { + "OO": false, + "mw": false, + "Hogan": false, + "require": false + }, + "rules": { + "dot-notation": [ "error", { "allowKeywords": true } ], + "object-property-newline": "error", + "computed-property-spacing": 0, + "no-use-before-define": 0, + "no-underscore-dangle": 0 + } +} diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 000000000..81328b96f --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,11 @@ +{ + "extends": "stylelint-config-wikimedia", + "rules": { + "declaration-no-important": null, + "property-blacklist": [ + "background-size" + ], + "selector-list-comma-newline-after": null, + "selector-no-id": null + } +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000000000..20815d8bb --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,61 @@ +/* eslint-env node */ +module.exports = function ( grunt ) { + var conf = grunt.file.readJSON( 'skin.json' ); + + grunt.loadNpmTasks( 'grunt-banana-checker' ); + grunt.loadNpmTasks( 'grunt-contrib-watch' ); + grunt.loadNpmTasks( 'grunt-eslint' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.loadNpmTasks( 'grunt-notify' ); + grunt.loadNpmTasks( 'grunt-stylelint' ); + + grunt.initConfig( { + eslint: { + all: [ + '**/*.js', + '!libs/**', + '!vendor/**', + '!docs/**', + '!node_modules/**' + ] + }, + stylelint: { + options: { + syntax: 'less' + }, + all: [ + 'minerva.less/**/*.less', + 'resources/**/*.less' + ] + }, + watch: { + lint: { + files: [ 'resources/**/*.js', 'tests/qunit/**/*.js' ], + tasks: [ 'lint' ] + }, + scripts: { + files: [ 'resources/**/*.js', 'tests/qunit/**/*.js' ], + tasks: [ 'test' ] + }, + configFiles: { + files: [ 'Gruntfile.js' ], + options: { + reload: true + } + } + }, + banana: conf.MessagesDirs, + jsonlint: { + all: [ + '*.json', + '**/*.json', + '!node_modules/**' + ] + } + } ); + + grunt.registerTask( 'lint', [ 'eslint', 'jsonlint', 'banana' ] ); + grunt.registerTask( 'test', [ 'lint' ] ); + + grunt.registerTask( 'default', [ 'test' ] ); +}; diff --git a/MinervaNeue.php b/MinervaNeue.php new file mode 100644 index 000000000..f63fc936c --- /dev/null +++ b/MinervaNeue.php @@ -0,0 +1,14 @@ +=0.4.4" + }, + "devDependencies": { + "eslint-config-wikimedia": "0.3.0", + "grunt": "^1.0.1", + "grunt-banana-checker": "^0.5.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "19.0.0", + "grunt-jsonlint": "^1.1.0", + "grunt-notify": "^0.4.5", + "grunt-stylelint": "^0.6.0", + "stylelint-config-wikimedia": "^0.3.0" + } +} diff --git a/skin.json b/skin.json new file mode 100644 index 000000000..9cec34b28 --- /dev/null +++ b/skin.json @@ -0,0 +1,36 @@ +{ + "AutoloadClasses": {}, + "ConfigRegistry": { + "minerva-neue": "GlobalVarConfig::newInstance" + }, + "Hooks": {}, + "MessagesDirs": { + "MinervaNeue": [ + "i18n" + ] + }, + "ResourceFileModulePaths": { + "localBasePath": "", + "remoteSkinPath": "MinervaNeue" + }, + "ResourceModuleSkinStyles": { + "minerva-neue": {} + }, + "ResourceModules": {}, + "ValidSkinNames": { + "minerva": "Minerva" + }, + "author": [], + "callback": "MinervaHooks::onRegistration", + "config": {}, + "descriptionmsg": "minerva-neue-skin-desc", + "license-name": "GPL-2.0+", + "manifest_version": 1, + "name": "MinervaNeue", + "namemsg": "skinname-minerva-neue", + "requires": { + "MediaWiki": ">= 1.25.0" + }, + "type": "skin", + "url": "https://www.mediawiki.org/wiki/Skin:MinervaNeue" +} \ No newline at end of file