mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-24 07:34:11 +00:00
807100bcca
Enforce it with eslint. Ignore: * Comment lines with eslint disable directives * QUnit test lines as they contain long subjects (QUnit.* (only, test, module, skip, etc) * Strings, since long strings are used extensively in tests * Ignore template literals for similar reasons * Regex literals as they may be too long, but can't be easily split in several lines * Long urls See bug for more general proposal for eslint-wikimedia-config. Bug: T185295 Change-Id: I3aacaf46e61a4d96547c513073e179ef997deb09
42 lines
1 KiB
JSON
42 lines
1 KiB
JSON
{
|
|
"extends": "wikimedia",
|
|
"parserOptions": {
|
|
"sourceType": "module",
|
|
"ecmaVersion": "5"
|
|
},
|
|
"env": {
|
|
"browser": true,
|
|
"jquery": true,
|
|
"commonjs": true,
|
|
"qunit": true
|
|
},
|
|
"globals": {
|
|
"mediaWiki": false,
|
|
"OO": false,
|
|
"moment": false,
|
|
"Redux": false,
|
|
"ReduxThunk": false
|
|
},
|
|
"rules": {
|
|
"dot-notation": [ "error", { "allowKeywords": true } ],
|
|
"no-use-before-define": 0,
|
|
"max-len": [
|
|
"warn",
|
|
{
|
|
"tabWidth": 2,
|
|
// Note: exclude all eslint- directives except for max-len itself
|
|
// since `// eslint-disable-line max-len` would cause this line to be
|
|
// ignored AND this rule to be disabled which would trigger
|
|
// --report-unused-disable-directives. By excluding max-len, the effect
|
|
// is to consider the line but disable this rule.
|
|
"ignorePattern": "^/// .+|// (?!eslint-.+max-len)eslint-.+|QUnit.",
|
|
"ignoreUrls": true,
|
|
"ignoreComments": false,
|
|
"ignoreRegExpLiterals": true,
|
|
"ignoreStrings": true,
|
|
"ignoreTemplateLiterals": true
|
|
}
|
|
]
|
|
}
|
|
}
|