eslint-plugin-mediawiki
MediaWiki-specific linting rules, for use in MediaWiki core and extensions.
Usage
If you are developing in MediaWiki you should be using eslint-config-wikimedia which includes this plugin.
Add mediawiki
to the plugins section of your .eslintrc
configuration file, then enable the required rules.
{
"plugins": [
"mediawiki"
],
"rules": {
"mediawiki/msg-doc": "error"
}
}
Rules
mediawiki/class-doc
- Ensures CSS classes are documented when they are constructed.mediawiki/msg-doc
- Ensures message keys are documented when they are constructed.mediawiki/valid-package-file-require
- Ensures require
d files are in the format that is expected within ResourceLoader package modules, i.e. contain the file extension and are proper relative paths, e.g. ./foo.js
instead of ./foo
or foo.js
.mediawiki/no-vue-dynamic-i18n
- Ensures that $i18n()
and v-i18n-html
are not passed dynamic message keys in Vue templates
Development
npm install
npm test
License
Distributed under the MIT license. See LICENSE for details.