Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Commit f36c826

Browse files
committed
Enforce MediaWiki code style
1 parent e7e6814 commit f36c826

File tree

5 files changed

+4284
-681
lines changed

5 files changed

+4284
-681
lines changed

.eslintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "wikimedia",
3+
"env": {
4+
"browser": true,
5+
"jquery": true
6+
},
7+
"globals": {
8+
"mediaWiki": false,
9+
"OO": false,
10+
"module": false
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 6
14+
},
15+
"rules": {
16+
}
17+
}

.stylelintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "stylelint-config-wikimedia",
3+
"rules": {
4+
"selector-max-id": 1
5+
}
6+
}

Gruntfile.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
/*jshint node:true */
1+
/* jshint node:true */
22
module.exports = function ( grunt ) {
3-
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
3+
grunt.loadNpmTasks( 'grunt-eslint' );
44
grunt.loadNpmTasks( 'grunt-jsonlint' );
5+
grunt.loadNpmTasks( 'grunt-stylelint' );
56
grunt.loadNpmTasks( 'grunt-banana-checker' );
67

78
grunt.initConfig( {
8-
jshint: {
9+
eslint: {
910
all: [
1011
'**/*.js',
1112
'!node_modules/**',
@@ -21,9 +22,17 @@ module.exports = function ( grunt ) {
2122
'!node_modules/**',
2223
'!vendor/**'
2324
]
25+
},
26+
stylelint: {
27+
all: [
28+
'**/*.css',
29+
'**/*.less',
30+
'!node_modules/**',
31+
'!vendor/**'
32+
]
2433
}
2534
} );
2635

27-
grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
36+
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'stylelint', 'banana' ] );
2837
grunt.registerTask( 'default', 'test' );
2938
};

0 commit comments

Comments
 (0)