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:
commit
5b17fe81dc
15
.eslintrc
15
.eslintrc
@ -100,7 +100,20 @@
|
|||||||
"no-catch-shadow": "error",
|
"no-catch-shadow": "error",
|
||||||
"no-delete-var": "error",
|
"no-delete-var": "error",
|
||||||
"no-label-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-restricted-names": "error",
|
||||||
"no-shadow": "off",
|
"no-shadow": "off",
|
||||||
"no-undef-init": "error",
|
"no-undef-init": "error",
|
||||||
|
9
extensions/.eslintrc
Normal file
9
extensions/.eslintrc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
../.eslintrc
|
||||||
|
],
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"no-restricted-globals": "off",
|
||||||
|
},
|
||||||
|
}
|
2
external/.eslintrc
vendored
2
external/.eslintrc
vendored
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"mozilla/use-includes-instead-of-indexOf": "off",
|
"mozilla/use-includes-instead-of-indexOf": "off",
|
||||||
|
|
||||||
"object-shorthand": "off",
|
"object-shorthand": "off",
|
||||||
|
"no-restricted-globals": "off",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": [
|
|
||||||
../.eslintrc
|
|
||||||
],
|
|
||||||
|
|
||||||
"rules": {
|
|
||||||
// Variables
|
|
||||||
"no-restricted-globals": ["error",
|
|
||||||
"ReadableStream",
|
|
||||||
"URL",
|
|
||||||
"WritableStream",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
|
@ -12,6 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable no-restricted-globals */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -7,4 +7,8 @@
|
|||||||
"node": true,
|
"node": true,
|
||||||
"jasmine": true,
|
"jasmine": true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"no-restricted-globals": "off",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,6 @@
|
|||||||
],
|
],
|
||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
// Variables
|
|
||||||
"no-restricted-globals": ["error",
|
|
||||||
"ReadableStream",
|
|
||||||
"URL",
|
|
||||||
"WritableStream",
|
|
||||||
],
|
|
||||||
|
|
||||||
// ECMAScript 6
|
// ECMAScript 6
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user