Skip to content

Commit

Permalink
eslint: Update config and fix warnings
Browse files Browse the repository at this point in the history
Expand on the eslint configuration started in Ie7c2451:
* Use wikimedia/vue-es6 standard for Vue frontend
* Use wikimedia/mocha standard for jsonschema
* Use wikimedia/server for vue.config.js
* use wikimedia/client for any other js files found

This change also includes lint error corrections after applying the
expanded configuration. These were largely automatic changes applied by
`eslint --fix .`

Change-Id: I947e26ee7af7212f80aadff7c18fe7c0bbfd48f9
  • Loading branch information
bd808 committed Nov 2, 2020
1 parent 19015d6 commit 7981676
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 473 deletions.
133 changes: 81 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 19 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"scripts": {
"build:vue": "vue-cli-service build",
"lint": "eslint . & npm run lint:vue",
"lint": "npm run lint:eslint && npm run lint:vue",
"lint:eslint": "eslint .",
"lint:vue": "vue-cli-service lint",
"schemas:generate": "jsonschema-tools materialize-all",
"serve:vue": "vue-cli-service serve",
Expand Down Expand Up @@ -53,32 +54,37 @@
},
"eslintConfig": {
"root": true,
"extends": [ "wikimedia/client" ],
"overrides": [
{
"files": [
"*.js",
"*.vue"
],
"files": [ "vue/src/**/*.{js,vue}" ],
"extends": [
"wikimedia/client",
"wikimedia/vue-es6",
"wikimedia/language/es6",
"plugin:vue/recommended"
],
"rules": {
"no-undef": "off"
"camelcase" : "off",
"no-undef" : "off"
}
},
{
"files": [ "tests/jsonschema/**/*.js" ],
"extends": [
"wikimedia/server",
"wikimedia/mocha"
]
},
{
"files": [ "vue.config.js" ],
"extends": [ "wikimedia/server" ]
}
]
},
"eslintIgnore": [
".eslintrc.js",
"docs",
"toolhub",
"bin",
"jsonschema",
".pipeline",
"tests",
"vue.config.js"
".pipeline"
],
"browserslist": [
"> 1%",
Expand Down
2 changes: 1 addition & 1 deletion tests/jsonschema/repository.test.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
'use strict';
require('@wikimedia/jsonschema-tools').tests.all({ logLevel: 'info' });
require( '@wikimedia/jsonschema-tools' ).tests.all( { logLevel: 'info' } );
Loading

0 comments on commit 7981676

Please sign in to comment.