mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Setup grunt-tyops and fix
Change-Id: I372c3cc5bedaf800716bff68cadb2846a399a42a
This commit is contained in:
parent
083900821e
commit
a70f411ee1
19
Gruntfile.js
19
Gruntfile.js
|
@ -5,6 +5,7 @@ module.exports = function ( grunt ) {
|
|||
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
||||
grunt.loadNpmTasks( 'grunt-eslint' );
|
||||
grunt.loadNpmTasks( 'grunt-stylelint' );
|
||||
grunt.loadNpmTasks( 'grunt-tyops' );
|
||||
|
||||
grunt.initConfig( {
|
||||
eslint: {
|
||||
|
@ -20,9 +21,25 @@ module.exports = function ( grunt ) {
|
|||
'modules/**/*.{css,less}'
|
||||
]
|
||||
},
|
||||
tyops: {
|
||||
options: {
|
||||
typos: 'typos.json'
|
||||
},
|
||||
src: [
|
||||
'**/*.{js,json,less,css,txt,php,md,sh}',
|
||||
'!package-lock.json',
|
||||
'!typos.json',
|
||||
'!i18n/**',
|
||||
'i18n/en.json',
|
||||
'i18n/qqq.json',
|
||||
'!lib/**',
|
||||
'!{docs,node_modules,vendor}/**',
|
||||
'!.git/**'
|
||||
]
|
||||
},
|
||||
banana: conf.MessagesDirs
|
||||
} );
|
||||
|
||||
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
||||
grunt.registerTask( 'test', [ 'tyops', 'eslint', 'stylelint', 'banana' ] );
|
||||
grunt.registerTask( 'default', 'test' );
|
||||
};
|
||||
|
|
|
@ -971,9 +971,9 @@ class CommentFormatter {
|
|||
|
||||
// Check fallback languages
|
||||
$fallbackLanguages = $userLang->getFallbackLanguages();
|
||||
foreach ( $fallbackLanguages as $fallbackLangauge ) {
|
||||
if ( isset( $languages[ $fallbackLangauge ] ) ) {
|
||||
return (bool)$languages[ $fallbackLangauge ];
|
||||
foreach ( $fallbackLanguages as $fallbackLanguage ) {
|
||||
if ( isset( $languages[ $fallbackLanguage ] ) ) {
|
||||
return (bool)$languages[ $fallbackLanguage ];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
13
package-lock.json
generated
13
package-lock.json
generated
|
@ -13,6 +13,7 @@
|
|||
"grunt-banana-checker": "0.11.1",
|
||||
"grunt-eslint": "24.3.0",
|
||||
"grunt-stylelint": "0.19.0",
|
||||
"grunt-tyops": "0.1.1",
|
||||
"stylelint-config-wikimedia": "0.16.1"
|
||||
}
|
||||
},
|
||||
|
@ -2515,6 +2516,12 @@
|
|||
"stylelint": "15.x"
|
||||
}
|
||||
},
|
||||
"node_modules/grunt-tyops": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/grunt-tyops/-/grunt-tyops-0.1.1.tgz",
|
||||
"integrity": "sha512-fLTY6Ai1JpIv1INYCWq3/gNZKsvGrcg6M2XxBsmwdciY//3+12/dlKZy5C5HjjupwpcpScggilgSyvwnU+I1Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/grunt/node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
|
@ -7046,6 +7053,12 @@
|
|||
"chalk": "^4.1.2"
|
||||
}
|
||||
},
|
||||
"grunt-tyops": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/grunt-tyops/-/grunt-tyops-0.1.1.tgz",
|
||||
"integrity": "sha512-fLTY6Ai1JpIv1INYCWq3/gNZKsvGrcg6M2XxBsmwdciY//3+12/dlKZy5C5HjjupwpcpScggilgSyvwnU+I1Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"hard-rejection": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz",
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"grunt-banana-checker": "0.11.1",
|
||||
"grunt-eslint": "24.3.0",
|
||||
"grunt-stylelint": "0.19.0",
|
||||
"grunt-tyops": "0.1.1",
|
||||
"stylelint-config-wikimedia": "0.16.1"
|
||||
}
|
||||
}
|
||||
|
|
25
typos.json
Normal file
25
typos.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"caseInsensitive": [
|
||||
[ "paralell", "parallel" ],
|
||||
[ "properites", "properties" ],
|
||||
[ "visiblit(ies|y)", "visibilit$1" ],
|
||||
[ "movablilties", "movabilities" ],
|
||||
[ "inpsect(ors?|ion)", "inspect$1" ],
|
||||
[ "\bteh\b", "the" ],
|
||||
[ "intialization", "initialization" ],
|
||||
[ "durring", "during" ],
|
||||
[ "contian", "contain" ],
|
||||
[ "occured", "occurred" ],
|
||||
[ "pgk", "pkg" ],
|
||||
[ "arrray", "array" ],
|
||||
[ "overriden", "overridden" ],
|
||||
[ "begining", "beginning" ],
|
||||
[ "detatched", "detached" ],
|
||||
[ "paramter", "parameter" ],
|
||||
[ "descendent", "descendant" ],
|
||||
[ "sepcific", "specific" ],
|
||||
[ "connet", "connect" ],
|
||||
[ "emtpy", "empty" ],
|
||||
[ "langauge", "language" ]
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue