Merge pull request #9913 from Snuffleupagus/no-restricted-globals

Provide custom messages for the `no-restricted-globals` ESLint rule, and refactor the `.eslintrc` files (PR 9868 follow-up)
This commit is contained in:
Tim van der Meij 2018-07-24 23:39:12 +02:00 committed by GitHub
commit 5b17fe81dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 23 deletions

View File

@ -100,7 +100,20 @@
"no-catch-shadow": "error",
"no-delete-var": "error",
"no-label-var": "error",
"no-restricted-globals": "off",
"no-restricted-globals": ["error",
{
"name": "ReadableStream",
"message": "Import it from `src/shared/util.js` or `pdfjsLib` instead; outside of the `/src` and `/web` folders, the rule may be disabled as needed. ",
},
{
"name": "URL",
"message": "Import it from `src/shared/util.js` or `pdfjsLib` instead; outside of the `/src` and `/web` folders, the rule may be disabled as needed. ",
},
{
"name": "WritableStream",
"message": "Import it from `src/shared/util.js` or `pdfjsLib` instead; outside of the `/src` and `/web` folders, the rule may be disabled as needed. ",
},
],
"no-shadow-restricted-names": "error",
"no-shadow": "off",
"no-undef-init": "error",

9
extensions/.eslintrc Normal file
View File

@ -0,0 +1,9 @@
{
"extends": [
../.eslintrc
],
"rules": {
"no-restricted-globals": "off",
},
}

2
external/.eslintrc vendored
View File

@ -9,7 +9,7 @@
"rules": {
"mozilla/use-includes-instead-of-indexOf": "off",
"object-shorthand": "off",
"no-restricted-globals": "off",
},
}

View File

@ -1,14 +0,0 @@
{
"extends": [
../.eslintrc
],
"rules": {
// Variables
"no-restricted-globals": ["error",
"ReadableStream",
"URL",
"WritableStream",
],
},
}

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-restricted-globals */
'use strict';

View File

@ -7,4 +7,8 @@
"node": true,
"jasmine": true,
},
"rules": {
"no-restricted-globals": "off",
},
}

View File

@ -4,13 +4,6 @@
],
"rules": {
// Variables
"no-restricted-globals": ["error",
"ReadableStream",
"URL",
"WritableStream",
],
// ECMAScript 6
"no-var": "error",
},