diff --git a/client.json b/client.json index 2b0e580d..a899ebe9 100644 --- a/client.json +++ b/client.json @@ -1,3 +1,3 @@ { - "extends": "./client/es6" + "extends": "./client/es2016" } diff --git a/client/es2016.json b/client/es2016.json new file mode 100644 index 00000000..872b5086 --- /dev/null +++ b/client/es2016.json @@ -0,0 +1,7 @@ +{ + "extends": [ + "./common", + "../language/es2016", + "../vue/es2016" + ] +} diff --git a/readme.md b/readme.md index 2c6db31f..31cfb858 100644 --- a/readme.md +++ b/readme.md @@ -12,24 +12,24 @@ Then, [configure ESLint](https://eslint.org/docs/user-guide/configuring) with on Below are some potential recommended uses: ### A typical front-end project -This config allows ES6 code and browser native functions. It will complain about ES2016+ code and language features. +This config allows ES2016 code and browser native functions. It will complain about ES2017+ code and language features. It also automatically applies the Vue plugin and Vue-specific rules to `.vue` files. `.eslintrc.json`: ```json { - "extends": "wikimedia/client/es6" + "extends": "wikimedia/client/es2016" } ``` If you want to only allow ES5 code and browser native functions, you can use `wikimedia/client/es5` instead. #### jQuery -This config adds the jQuery `$` global, and additional rules preventing the use of jQuery features which are deprecated, have performance issues, or have simple ES6 alternatives. +This config adds the jQuery `$` global, and additional rules preventing the use of jQuery features which are deprecated, have performance issues, or have simple ES2016 alternatives. `.eslintrc.json`: ```json { "extends": [ - "wikimedia/client/es6", + "wikimedia/client/es2016", "wikimedia/jquery" ] } @@ -41,7 +41,7 @@ Code that runs in MediaWiki can use this config. It enforces rules that are spec ```json { "extends": [ - "wikimedia/client/es6", + "wikimedia/client/es2016", "wikimedia/mediawiki" ] } diff --git a/vue/es2016.json b/vue/es2016.json new file mode 100644 index 00000000..435a8558 --- /dev/null +++ b/vue/es2016.json @@ -0,0 +1,3 @@ +{ + "extends": "../vue3/es2016" +} diff --git a/vue3/es2016.js b/vue3/es2016.js new file mode 100644 index 00000000..9f90f5c2 --- /dev/null +++ b/vue3/es2016.js @@ -0,0 +1,12 @@ +'use strict'; + +/* eslint-disable quote-props, quotes */ +module.exports = { + "overrides": [ { + "files": [ "**/*.vue" ], + "extends": [ + "../vue3/common", + "../language/es2016" + ] + } ] +};