Merge pull request #19916 from Snuffleupagus/prefer-import-meta-properties
Enable the `unicorn/prefer-import-meta-properties` ESLint plugin rule
This commit is contained in:
commit
57cbaae8e4
@ -145,6 +145,7 @@ export default [
|
|||||||
"unicorn/prefer-date-now": "error",
|
"unicorn/prefer-date-now": "error",
|
||||||
"unicorn/prefer-dom-node-append": "error",
|
"unicorn/prefer-dom-node-append": "error",
|
||||||
"unicorn/prefer-dom-node-remove": "error",
|
"unicorn/prefer-dom-node-remove": "error",
|
||||||
|
"unicorn/prefer-import-meta-properties": "error",
|
||||||
"unicorn/prefer-includes": "error",
|
"unicorn/prefer-includes": "error",
|
||||||
"unicorn/prefer-logical-operator-over-ternary": "error",
|
"unicorn/prefer-logical-operator-over-ternary": "error",
|
||||||
"unicorn/prefer-modern-dom-apis": "error",
|
"unicorn/prefer-modern-dom-apis": "error",
|
||||||
|
|||||||
3
external/builder/test-fixtures.mjs
vendored
3
external/builder/test-fixtures.mjs
vendored
@ -1,9 +1,8 @@
|
|||||||
import * as builder from "./builder.mjs";
|
import * as builder from "./builder.mjs";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
let errors = 0;
|
let errors = 0;
|
||||||
|
|
||||||
|
|||||||
3
external/builder/test-fixtures_babel.mjs
vendored
3
external/builder/test-fixtures_babel.mjs
vendored
@ -1,9 +1,8 @@
|
|||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { preprocessPDFJSCode } from "./babel-plugin-pdfjs-preprocessor.mjs";
|
import { preprocessPDFJSCode } from "./babel-plugin-pdfjs-preprocessor.mjs";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
let errors = 0;
|
let errors = 0;
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import { exec, execSync, spawn, spawnSync } from "child_process";
|
|||||||
import autoprefixer from "autoprefixer";
|
import autoprefixer from "autoprefixer";
|
||||||
import babel from "@babel/core";
|
import babel from "@babel/core";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import gulp from "gulp";
|
import gulp from "gulp";
|
||||||
import hljs from "highlight.js";
|
import hljs from "highlight.js";
|
||||||
@ -46,7 +45,7 @@ import webpack2 from "webpack";
|
|||||||
import webpackStream from "webpack-stream";
|
import webpackStream from "webpack-stream";
|
||||||
import zip from "gulp-zip";
|
import zip from "gulp-zip";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
const BUILD_DIR = "build/";
|
const BUILD_DIR = "build/";
|
||||||
const L10N_DIR = "l10n/";
|
const L10N_DIR = "l10n/";
|
||||||
|
|||||||
146
package-lock.json
generated
146
package-lock.json
generated
@ -28,7 +28,7 @@
|
|||||||
"eslint-plugin-no-unsanitized": "^4.1.2",
|
"eslint-plugin-no-unsanitized": "^4.1.2",
|
||||||
"eslint-plugin-perfectionist": "^4.12.3",
|
"eslint-plugin-perfectionist": "^4.12.3",
|
||||||
"eslint-plugin-prettier": "^5.2.6",
|
"eslint-plugin-prettier": "^5.2.6",
|
||||||
"eslint-plugin-unicorn": "^58.0.0",
|
"eslint-plugin-unicorn": "^59.0.1",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"gulp": "^5.0.0",
|
"gulp": "^5.0.0",
|
||||||
"gulp-cli": "^3.0.0",
|
"gulp-cli": "^3.0.0",
|
||||||
@ -5351,9 +5351,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-unicorn": {
|
"node_modules/eslint-plugin-unicorn": {
|
||||||
"version": "58.0.0",
|
"version": "59.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-58.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-59.0.1.tgz",
|
||||||
"integrity": "sha512-fc3iaxCm9chBWOHPVjn+Czb/wHS0D2Mko7wkOdobqo9R2bbFObc4LyZaLTNy0mhZOP84nKkLhTUQxlLOZ7EjKw==",
|
"integrity": "sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -5364,12 +5364,12 @@
|
|||||||
"clean-regexp": "^1.0.0",
|
"clean-regexp": "^1.0.0",
|
||||||
"core-js-compat": "^3.41.0",
|
"core-js-compat": "^3.41.0",
|
||||||
"esquery": "^1.6.0",
|
"esquery": "^1.6.0",
|
||||||
|
"find-up-simple": "^1.0.1",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"indent-string": "^5.0.0",
|
"indent-string": "^5.0.0",
|
||||||
"is-builtin-module": "^5.0.0",
|
"is-builtin-module": "^5.0.0",
|
||||||
"jsesc": "^3.1.0",
|
"jsesc": "^3.1.0",
|
||||||
"pluralize": "^8.0.0",
|
"pluralize": "^8.0.0",
|
||||||
"read-package-up": "^11.0.0",
|
|
||||||
"regexp-tree": "^0.1.27",
|
"regexp-tree": "^0.1.27",
|
||||||
"regjsparser": "^0.12.0",
|
"regjsparser": "^0.12.0",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
@ -5917,9 +5917,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/find-up-simple": {
|
"node_modules/find-up-simple": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz",
|
||||||
"integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==",
|
"integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -6921,26 +6921,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/hosted-git-info": {
|
|
||||||
"version": "7.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz",
|
|
||||||
"integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"lru-cache": "^10.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^16.14.0 || >=18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/hosted-git-info/node_modules/lru-cache": {
|
|
||||||
"version": "10.4.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
|
||||||
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/html-tags": {
|
"node_modules/html-tags": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz",
|
||||||
@ -7093,19 +7073,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/index-to-position": {
|
|
||||||
"version": "0.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz",
|
|
||||||
"integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/inflight": {
|
"node_modules/inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
@ -8942,21 +8909,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/normalize-package-data": {
|
|
||||||
"version": "6.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz",
|
|
||||||
"integrity": "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"dependencies": {
|
|
||||||
"hosted-git-info": "^7.0.0",
|
|
||||||
"semver": "^7.3.5",
|
|
||||||
"validate-npm-package-license": "^3.0.4"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^16.14.0 || >=18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/normalize-range": {
|
"node_modules/normalize-range": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
|
||||||
@ -9996,62 +9948,6 @@
|
|||||||
"safe-buffer": "^5.1.0"
|
"safe-buffer": "^5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/read-package-up": {
|
|
||||||
"version": "11.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz",
|
|
||||||
"integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"find-up-simple": "^1.0.0",
|
|
||||||
"read-pkg": "^9.0.0",
|
|
||||||
"type-fest": "^4.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/read-pkg": {
|
|
||||||
"version": "9.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz",
|
|
||||||
"integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/normalize-package-data": "^2.4.3",
|
|
||||||
"normalize-package-data": "^6.0.0",
|
|
||||||
"parse-json": "^8.0.0",
|
|
||||||
"type-fest": "^4.6.0",
|
|
||||||
"unicorn-magic": "^0.1.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/read-pkg/node_modules/parse-json": {
|
|
||||||
"version": "8.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz",
|
|
||||||
"integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/code-frame": "^7.22.13",
|
|
||||||
"index-to-position": "^0.1.2",
|
|
||||||
"type-fest": "^4.7.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/readable-stream": {
|
"node_modules/readable-stream": {
|
||||||
"version": "2.3.6",
|
"version": "2.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||||
@ -11914,19 +11810,6 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/type-fest": {
|
|
||||||
"version": "4.35.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.35.0.tgz",
|
|
||||||
"integrity": "sha512-2/AwEFQDFEy30iOLjrvHDIH7e4HEWH+f1Yl1bI5XMqzuoCUqwYCdxachgsgv0og/JdVZUhbfjcJAoHj5L1753A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "(MIT OR CC0-1.0)",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/typed-array-buffer": {
|
"node_modules/typed-array-buffer": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz",
|
||||||
@ -12159,19 +12042,6 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/unicorn-magic": {
|
|
||||||
"version": "0.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz",
|
|
||||||
"integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz",
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
"eslint-plugin-no-unsanitized": "^4.1.2",
|
"eslint-plugin-no-unsanitized": "^4.1.2",
|
||||||
"eslint-plugin-perfectionist": "^4.12.3",
|
"eslint-plugin-perfectionist": "^4.12.3",
|
||||||
"eslint-plugin-prettier": "^5.2.6",
|
"eslint-plugin-prettier": "^5.2.6",
|
||||||
"eslint-plugin-unicorn": "^58.0.0",
|
"eslint-plugin-unicorn": "^59.0.1",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.0.0",
|
||||||
"gulp": "^5.0.0",
|
"gulp": "^5.0.0",
|
||||||
"gulp-cli": "^3.0.0",
|
"gulp-cli": "^3.0.0",
|
||||||
|
|||||||
@ -41,11 +41,10 @@ import {
|
|||||||
waitForSerialized,
|
waitForSerialized,
|
||||||
waitForTimeout,
|
waitForTimeout,
|
||||||
} from "./test_utils.mjs";
|
} from "./test_utils.mjs";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
const selectAll = selectEditors.bind(null, "highlight");
|
const selectAll = selectEditors.bind(null, "highlight");
|
||||||
|
|
||||||
|
|||||||
@ -27,13 +27,11 @@ import {
|
|||||||
waitForPointerUp,
|
waitForPointerUp,
|
||||||
waitForTimeout,
|
waitForTimeout,
|
||||||
} from "./test_utils.mjs";
|
} from "./test_utils.mjs";
|
||||||
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { PNG } from "pngjs";
|
import { PNG } from "pngjs";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
const switchToSignature = switchToEditor.bind(null, "Signature");
|
const switchToSignature = switchToEditor.bind(null, "Signature");
|
||||||
|
|
||||||
|
|||||||
@ -49,12 +49,11 @@ import {
|
|||||||
waitForSerialized,
|
waitForSerialized,
|
||||||
waitForTimeout,
|
waitForTimeout,
|
||||||
} from "./test_utils.mjs";
|
} from "./test_utils.mjs";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { PNG } from "pngjs";
|
import { PNG } from "pngjs";
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
const clearAll = clearEditors.bind(null, "stamp");
|
const clearAll = clearEditors.bind(null, "stamp");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user