X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=.eslintrc.json;h=85d91b66625c406af6d62f8c359b066171e44101;hb=7a4f2663a78824804fa8b43a9f0460b428a68173;hp=40e26ca081a4578ac316a2549ebac85c00131edb;hpb=0f2447023d794bece608ce9bf40397519a9c5a13;p=lhc%2Fweb%2Fwiklou.git diff --git a/.eslintrc.json b/.eslintrc.json index 40e26ca081..85d91b6662 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,202 +1,17 @@ { - "extends": "wikimedia", - "env": { - "browser": true - }, + "extends": [ + "wikimedia/client", + "wikimedia/jquery" + ], "globals": { "require": false, "module": false, "mw": false, - "$": false, "OO": false }, "rules": { - "no-restricted-properties": [ - 2, - { - "object": "$", - "property": "map", - "message": "Please use Array.prototype.map instead" - }, - { - "object": "$", - "property": "inArray", - "message": "Please use Array.prototype.indexOf instead" - }, - { - "object": "$", - "property": "each", - "message": "Please consider different approaches to $.each, especially when using Array's. You can override this warning if necessary with eslint-disable-next-line." - }, - { - "object": "$", - "property": "isArray", - "message": "Please use Array.isArray instead" - }, - { - "object": "$", - "property": "isFunction", - "message": "Please use typeof (e.g. typeof e === 'function') instead" - }, - { - "object": "$", - "property": "grep", - "message": "Please use Array.prototype.filter instead" - }, - { - "object": "$", - "property": "trim", - "message": "Please use String.prototype.trim instead" - }, - { - "object": "$", - "property": "proxy", - "message": "Please use Function.prototype.bind instead" - }, - - { - "property": "codePointAt", - "message": "Unsupported method String.prototype.codePointAt requires ES6." - }, - { - "property": "endsWith", - "message": "Unsupported method String.prototype.endsWith requires ES6." - }, - { - "property": "normalize", - "message": "Unsupported method String.prototype.normalize requires ES6." - }, - { - "property": "padEnd", - "message": "Unsupported method String.prototype.padEnd requires ES2017." - }, - { - "property": "padStart", - "message": "Unsupported method String.prototype.padStart requires ES2017." - }, - { - "property": "repeat", - "message": "Unsupported method String.prototype.repeat requires ES6." - }, - { - "property": "startsWith", - "message": "Unsupported method String.prototype.startsWith requires ES6." - }, - { - "property": "trimEnd", - "message": "Unsupported method String.prototype.trimEnd is still experimental." - }, - { - "property": "trimLeft", - "message": "Unsupported method String.prototype.trimLeft is still experimental." - }, - { - "property": "trimRight", - "message": "Unsupported method String.prototype.trimRight is still experimental." - }, - { - "property": "trimStart", - "message": "Unsupported method String.prototype.trimStart is still experimental." - }, - { - "property": "copyWithin", - "message": "Unsupported method Array.prototype.copyWithin requires ES6." - }, - { - "property": "entries", - "message": "Unsupported method Array.prototype.entries requires ES6." - }, - { - "property": "fill", - "message": "Unsupported method Array.prototype.fill requires ES6." - }, - { - "property": "findIndex", - "message": "Unsupported method Array.prototype.findIndex requires ES6." - }, - { - "property": "flat", - "message": "Unsupported method Array.prototype.flat is still experimental." - }, - { - "property": "flatMap", - "message": "Unsupported method Array.prototype.flatMap is still experimental." - }, - { - "object": "String", - "property": "fromCodePoint", - "message": "Unsupported method String.fromCodePoint requires ES6." - }, - { - "object": "String", - "property": "raw", - "message": "Unsupported method String.raw requires ES6." - }, - { - "object": "Array", - "property": "from", - "message": "Unsupported method Array.from requires ES6." - }, - { - "object": "Array", - "property": "of", - "message": "Unsupported method Array.of requires ES6." - }, - { - "object": "Object", - "property": "assign", - "message": "Unsupported method Object.assign requires ES6." - }, - { - "object": "Object", - "property": "entries", - "message": "Unsupported method Object.entries requires ES2017." - }, - { - "object": "Object", - "property": "getOwnPropertyDescriptors", - "message": "Unsupported method Object.getOwnPropertyDescriptors requires ES2017." - }, - { - "object": "Object", - "property": "getOwnPropertySymbols", - "message": "Unsupported method Object.getOwnPropertySymbols requires ES6." - }, - { - "object": "Object", - "property": "is", - "message": "Unsupported method Object.is requires ES6." - }, - { - "object": "Object", - "property": "values", - "message": "Unsupported method Object.values requires ES2017." - } - ], - "no-restricted-syntax": [ - 2, - { - // Match expressions like .includes( … ) (false positives when used as a property name) - "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='includes']", - "message": "Unsupported methods String.prototype.includes and Array.prototype.includes require ES6 and ES2016 respectively." - }, - { - // Match expressions like .find( function ( … ) { … } ) (avoid $( … ).find( … )) - "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='find'][arguments.length=1][arguments.0.type='FunctionExpression']", - "message": "Unsupported method Array.prototype.find requires ES6." - }, - { - // Match expressions like .keys( … ), except Object.keys( … ) (which is valid) - "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='keys'][callee.object.name!='Object']", - "message": "Unsupported method Array.prototype.keys requires ES6." - }, - { - // Match expressions like .values( … ), except Object.values( … ) (disallowed separately) - "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='values'][callee.object.name!='Object']", - "message": "Unsupported method Array.prototype.values requires ES6." - } - ], - "dot-notation": 0, - "max-len": 0 + "quote-props": [ "error", "as-needed" ], + "max-len": "off", + "no-jquery/no-global-selector": "off" } }