ci: setup ESlint and Stylelint

This commit is contained in:
alistair3149 2021-06-21 14:35:54 -04:00
parent 5a6421cab7
commit ff3a266434
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
6 changed files with 8093 additions and 6 deletions

3
.eslintignore Normal file
View file

@ -0,0 +1,3 @@
/i18n/
/node_modules/
/vendor/

20
.eslintrc.json Normal file
View file

@ -0,0 +1,20 @@
{
"root": true,
"extends": [
"wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki"
],
"globals": {
"require": "readonly",
"module": "readonly"
},
"rules": {
"one-var": "off",
"//": [
"off",
"ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."
],
"no-implicit-globals": "off"
}
}

9
.gitignore vendored
View file

@ -1,7 +1,4 @@
*.kate-swp
*~
.*.swp
.DS_Store
.svn
/composer.lock
/vendor
composer.lock
/node_modules
.eslintcache

10
.stylelintrc.json Normal file
View file

@ -0,0 +1,10 @@
{
"extends": [
"stylelint-config-idiomatic-order",
"stylelint-config-wikimedia"
],
"rules": {
"selector-max-id": null,
"selector-class-pattern": "^(tabber)"
}
}

8040
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

17
package.json Normal file
View file

@ -0,0 +1,17 @@
{
"private": true,
"scripts": {
"lint": "npm -s run lint:js && npm -s run lint:i18n",
"lint:fix:js": "npm -s run lint:js -- --fix",
"lint:fix:styles": "npm -s run lint:styles -- --fix",
"lint:js": "eslint --cache --max-warnings 0 .",
"lint:styles": "stylelint \"**/*.{less,css}\"",
"lint:i18n": "banana-checker --requireLowerCase=0 i18n/"
},
"devDependencies": {
"eslint-config-wikimedia": "0.20.0",
"grunt-banana-checker": "0.9.0",
"stylelint-config-idiomatic-order": "8.1.0",
"stylelint-config-wikimedia": "0.11.1"
}
}