Re-factor how the ESLint no-var
rule is enabled in the src/
folder
This simplifies/consolidates the ESLint configuration slightly in the `src/` folder, and prevents the addition of any new files where `var` is being used.[1] Hence we no longer need to manually add `/* eslint no-var: error */` in files, which is easy to forget, and can instead disable the rule in the `src/core/` files where `var` is still in use. --- [1] Obviously the `no-var` rule can, in the same way as every other rule, be disabled on a case-by-case basis where actually necessary.
This commit is contained in:
parent
48e27a1a22
commit
9416b14e8b
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"../../.eslintrc"
|
"../.eslintrc"
|
||||||
],
|
],
|
||||||
|
|
||||||
"rules": {
|
"rules": {
|
@ -4,7 +4,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"../../.eslintrc"
|
"../.eslintrc"
|
||||||
],
|
],
|
||||||
|
|
||||||
"env": {
|
"env": {
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AnnotationBorderStyleType,
|
AnnotationBorderStyleType,
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
// Table C-2
|
// Table C-2
|
||||||
const QeTable = [
|
const QeTable = [
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { warn } from "../shared/util.js";
|
import { warn } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { Dict, isDict } from "./primitives.js";
|
import { Dict, isDict } from "./primitives.js";
|
||||||
import { CCITTFaxDecoder } from "./ccitt.js";
|
import { CCITTFaxDecoder } from "./ccitt.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
bytesToString,
|
bytesToString,
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
const ISOAdobeCharset = [
|
const ISOAdobeCharset = [
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
arrayByteLength,
|
arrayByteLength,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CMapCompressionType,
|
CMapCompressionType,
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { assert, BaseException, warn } from "../shared/util.js";
|
import { assert, BaseException, warn } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
bytesToString,
|
bytesToString,
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AbortException,
|
AbortException,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
bytesToString,
|
bytesToString,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { Dict, isDict, isStream, Ref } from "./primitives.js";
|
import { Dict, isDict, isStream, Ref } from "./primitives.js";
|
||||||
import {
|
import {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* no-babel-preset */
|
/* no-babel-preset */
|
||||||
|
/* eslint-disable no-var */
|
||||||
|
|
||||||
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
|
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
|
||||||
|
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { assert, FormatError, ImageKind, info, warn } from "../shared/util.js";
|
import { assert, FormatError, ImageKind, info, warn } from "../shared/util.js";
|
||||||
import { isName, isStream, Name } from "./primitives.js";
|
import { isName, isStream, Name } from "./primitives.js";
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { assert, info, shadow, unreachable } from "../shared/util.js";
|
import { assert, info, shadow, unreachable } from "../shared/util.js";
|
||||||
import { RefSetCache } from "./primitives.js";
|
import { RefSetCache } from "./primitives.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { BaseException, shadow } from "../shared/util.js";
|
import { BaseException, shadow } from "../shared/util.js";
|
||||||
import { log2, readInt8, readUint16, readUint32 } from "./core_utils.js";
|
import { log2, readInt8, readUint16, readUint32 } from "./core_utils.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { assert, BaseException, warn } from "../shared/util.js";
|
import { assert, BaseException, warn } from "../shared/util.js";
|
||||||
import { readUint16 } from "./core_utils.js";
|
import { readUint16 } from "./core_utils.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { BaseException, info, warn } from "../shared/util.js";
|
import { BaseException, info, warn } from "../shared/util.js";
|
||||||
import { log2, readUint16, readUint32 } from "./core_utils.js";
|
import { log2, readUint16, readUint32 } from "./core_utils.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { getLookupTableFactory } from "./core_utils.js";
|
import { getLookupTableFactory } from "./core_utils.js";
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.
|
* Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.
|
||||||
* Hashes roughly 100 KB per millisecond on i7 3.4 GHz.
|
* Hashes roughly 100 KB per millisecond on i7 3.4 GHz.
|
||||||
*/
|
*/
|
||||||
/* eslint no-var: error */
|
|
||||||
|
|
||||||
import { isArrayBuffer, isString } from "../shared/util.js";
|
import { isArrayBuffer, isString } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { assert, ImageKind, OPS, warn } from "../shared/util.js";
|
import { assert, ImageKind, OPS, warn } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Ascii85Stream,
|
Ascii85Stream,
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
|
@ -12,7 +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.
|
||||||
*/
|
*/
|
||||||
/* uses XRef */
|
/* eslint-disable no-var */
|
||||||
|
|
||||||
import { assert, unreachable } from "../shared/util.js";
|
import { assert, unreachable } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { FormatError, shadow } from "../shared/util.js";
|
import { FormatError, shadow } from "../shared/util.js";
|
||||||
import { EOF } from "./primitives.js";
|
import { EOF } from "./primitives.js";
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { getLookupTableFactory } from "./core_utils.js";
|
import { getLookupTableFactory } from "./core_utils.js";
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* of XPDF's implementation, made available under the Apache 2.0 open source
|
* of XPDF's implementation, made available under the Apache 2.0 open source
|
||||||
* license.
|
* license.
|
||||||
*/
|
*/
|
||||||
|
/* eslint-disable no-var */
|
||||||
|
|
||||||
import { FormatError, stringToBytes, unreachable } from "../shared/util.js";
|
import { FormatError, stringToBytes, unreachable } from "../shared/util.js";
|
||||||
import { isDict } from "./primitives.js";
|
import { isDict } from "./primitives.js";
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import { getEncoding } from "./encodings.js";
|
import { getEncoding } from "./encodings.js";
|
||||||
import { isWhiteSpace } from "./core_utils.js";
|
import { isWhiteSpace } from "./core_utils.js";
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* no-babel-preset */
|
/* no-babel-preset */
|
||||||
|
/* eslint-disable no-var */
|
||||||
|
|
||||||
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
|
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
|
||||||
|
|
||||||
|
@ -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-var */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AbortException,
|
AbortException,
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { assert } from "../shared/util.js";
|
import { assert } from "../shared/util.js";
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* 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 no-var: error */
|
|
||||||
|
|
||||||
import { bytesToString, escapeString, warn } from "../shared/util.js";
|
import { bytesToString, escapeString, warn } from "../shared/util.js";
|
||||||
import { Dict, isDict, isName, isRef, isStream, Name } from "./primitives.js";
|
import { Dict, isDict, isName, isRef, isStream, Name } from "./primitives.js";
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": [
|
|
||||||
"../../.eslintrc"
|
|
||||||
],
|
|
||||||
|
|
||||||
"rules": {
|
|
||||||
// ECMAScript 6
|
|
||||||
"no-var": "error",
|
|
||||||
},
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user