chore: fix eslint

This commit is contained in:
alexander.akait 2023-04-12 21:09:24 +03:00
parent f1ef2eded2
commit 1cab8f4fd6
162 changed files with 347 additions and 408 deletions

View File

@ -1,26 +1,28 @@
# Ignore node_modules # Ignore some test files
node_modules test/**/*.*
!test/*.js
!test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
test/cases/parsing/es2022/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js
!test/helpers/*.*
# Ignore some folders # Ignore some folders
benchmark benchmark
coverage coverage
# Ignore generated files
*.check.js
# Ignore not supported files # Ignore not supported files
!.*.js
.eslintrc.js
*.d.ts *.d.ts
# Ignore precompiled schemas # Ignore precompiled schemas
schemas/**/*.check.js schemas/**/*.check.js
# Ignore some test files
test/*
!test/*Cases
!test/helpers
!test/*.js
test/*Cases/**/*.js
!test/*Cases/**/webpack.config.js
# Ignore some examples files # Ignore some examples files
examples/**/*.js examples/**/*.js
!examples/*/webpack.config.js !examples/*/webpack.config.js

View File

@ -2,7 +2,7 @@
<!-- Before creating an issue please make sure you are using the latest version of webpack. --> <!-- Before creating an issue please make sure you are using the latest version of webpack. -->
<!-- Also consider trying the webpack@beta version, maybe it's already fixed. --> <!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->
**Do you want to request a *feature* or report a *bug*?** **Do you want to request a _feature_ or report a _bug_?**
<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). --> <!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->
<!-- Issues which contain questions or support requests will be closed. --> <!-- Issues which contain questions or support requests will be closed. -->

View File

@ -15,10 +15,8 @@ about: Create a report to help us improve
**What is the current behavior?** **What is the current behavior?**
**If the current behavior is a bug, please provide the steps to reproduce.** **If the current behavior is a bug, please provide the steps to reproduce.**
<!-- A great way to do this is to provide your configuration via a GitHub repository --> <!-- A great way to do this is to provide your configuration via a GitHub repository -->
<!-- The most helpful is a minimal reproduction with instructions on how to reproduce --> <!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->
<!-- Repositories with too many files or large `webpack.config.js` files are not suitable --> <!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->
@ -28,7 +26,6 @@ about: Create a report to help us improve
**What is the expected behavior?** **What is the expected behavior?**
<!-- "It should work" is not a helpful explanation --> <!-- "It should work" is not a helpful explanation -->
<!-- Explain exactly how it should behave --> <!-- Explain exactly how it should behave -->

View File

@ -1,7 +1,6 @@
--- ---
name: Feature request name: Feature request
about: Suggest an idea for this project about: Suggest an idea for this project
--- ---
<!-- Please don't delete this template or we'll close your issue --> <!-- Please don't delete this template or we'll close your issue -->
@ -16,12 +15,9 @@ about: Suggest an idea for this project
**What is the expected behavior?** **What is the expected behavior?**
**What is motivation or use case for adding/changing the behavior?** **What is motivation or use case for adding/changing the behavior?**
**How should this be implemented in your opinion?** **How should this be implemented in your opinion?**
**Are you willing to work on this yourself?** **Are you willing to work on this yourself?**
yes yes

View File

@ -1,7 +1,6 @@
--- ---
name: Other name: Other
about: Something else about: Something else
--- ---
<!-- Bug reports and Feature requests must use other templates, or will be closed --> <!-- Bug reports and Feature requests must use other templates, or will be closed -->

View File

@ -5,9 +5,13 @@
<!-- Try to link to an open issue for more information. --> <!-- Try to link to an open issue for more information. -->
## Summary ## Summary
<!-- cspell:disable-next-line --> <!-- cspell:disable-next-line -->
copilot:summary copilot:summary
## Details ## Details
<!-- cspell:disable-next-line --> <!-- cspell:disable-next-line -->
copilot:walkthrough copilot:walkthrough

View File

@ -2,7 +2,6 @@
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. --> <!-- Try to link to an open issue for more information. -->
<!-- In addition to that please answer these questions: --> <!-- In addition to that please answer these questions: -->
**What kind of change does this PR introduce?** **What kind of change does this PR introduce?**

View File

@ -1,14 +1,30 @@
package.json package.json
# Ignore test fixtures # Ignore some test files
test/*.* test/**/*.*
!test/*.js !test/*.js
!test/**/webpack.config.js !test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js !test/**/deprecations.js
!test/*.md
!test/helpers/*.*
# Ignore example fixtures # Ignore some folders
examples/*.* benchmark/
!examples/**/webpack.config.js coverage/
# Ignore generated files # Ignore generated files
*.check.js *.check.js
# Ignore not supported files
*.d.ts
# Ignore precompiled schemas
schemas/**/*.check.js
# Ignore example fixtures
examples/
!examples/**/webpack.config.js

View File

@ -1,6 +1,4 @@
{ {
"extends": "assemblyscript/std/assembly.json", "extends": "assemblyscript/std/assembly.json",
"include": [ "include": ["./**/*.asm.ts"]
"./**/*.asm.ts"
]
} }

View File

@ -150,7 +150,7 @@
"pretest": "yarn lint", "pretest": "yarn lint",
"prelint": "yarn setup", "prelint": "yarn setup",
"lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck", "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck",
"code-lint": "eslint . --ext '.js' --cache", "code-lint": "eslint --cache .",
"type-lint": "tsc", "type-lint": "tsc",
"typings-test": "tsc -p tsconfig.types.test.json", "typings-test": "tsc -p tsconfig.types.test.json",
"module-typings-test": "tsc -p tsconfig.module.test.json", "module-typings-test": "tsc -p tsconfig.module.test.json",
@ -159,9 +159,8 @@
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write", "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
"fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix", "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
"prepare": "husky install", "prepare": "husky install",
"pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"", "pretty-lint-base": "prettier --cache .",
"pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"module.d.ts\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"", "pretty-lint-fix": "yarn pretty-lint-base --loglevel warn --write",
"pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write",
"pretty-lint": "yarn pretty-lint-base --check", "pretty-lint": "yarn pretty-lint-base --check",
"yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock", "yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock",
"yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock", "yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock",
@ -179,11 +178,11 @@
"cover:report": "nyc report -t coverage" "cover:report": "nyc report -t coverage"
}, },
"lint-staged": { "lint-staged": {
"*.js|{lib,setup,bin,hot,tooling,schemas}/**/*.js|test/*.js|{test,examples}/**/webpack.config.js}": [ "*.{js,cjs,mjs}": [
"eslint --cache" "eslint --cache --fix"
], ],
"*.{ts,json,yml,yaml,md}|examples/*.md": [ "*": [
"prettier --check" "prettier --cache --ignore-unknown"
], ],
"*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [ "*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [
"cspell" "cspell"

View File

@ -1,20 +1,25 @@
# Welcome to the webpack test suite!!!! # Welcome to the webpack test suite!!!!
Every pull request that you submit to webpack (besides README and spelling corrections in comments) requires tests that are created. Every pull request that you submit to webpack (besides README and spelling corrections in comments) requires tests that are created.
But don't give up hope!!! Although our tests may appear complex and overwhelming, once you become familiar with the test suite and structure, adding and creating tests will be fun and beneficial as you work inside the codebase! ❤ But don't give up hope!!! Although our tests may appear complex and overwhelming, once you become familiar with the test suite and structure, adding and creating tests will be fun and beneficial as you work inside the codebase! ❤
## tl;dr ## tl;dr
Run all tests (this automatically runs the setup): Run all tests (this automatically runs the setup):
```sh ```sh
yarn test yarn test
``` ```
Run an individual suite: Run an individual suite:
```sh ```sh
yarn jest ConfigTestCases yarn jest ConfigTestCases
``` ```
Watch mode: Watch mode:
```sh ```sh
yarn jest --watch ConfigTestCases yarn jest --watch ConfigTestCases
``` ```
@ -22,16 +27,20 @@ yarn jest --watch ConfigTestCases
See also: [Jest CLI docs](https://jestjs.io/docs/cli) See also: [Jest CLI docs](https://jestjs.io/docs/cli)
## Test suite overview ## Test suite overview
We use Jest for our tests. For more information on Jest you can visit their [homepage](https://jestjs.io/)! We use Jest for our tests. For more information on Jest you can visit their [homepage](https://jestjs.io/)!
### Class Tests ### Class Tests
All test files can be found in *.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation).
All test files can be found in \*.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation).
If the feature you are contributing involves one of those classes, then best to start there to understand the structure. If the feature you are contributing involves one of those classes, then best to start there to understand the structure.
### xCases ### xCases
In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding *.test.js files.
In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding \*.test.js files.
#### cases (`TestCases.test.js`) <sup>1</sup> #### cases (`TestCases.test.js`) <sup>1</sup>
Cases are a set of general purpose tests that will run against a variety of permutations of webpack configurations. When you are making a general purpose change that doesn't require you to have a special configuration, you would likely add your tests here. Inside of the `./test/cases` directory you will find tests are broken into thematic sub directories. Take a moment to explore the different options. Cases are a set of general purpose tests that will run against a variety of permutations of webpack configurations. When you are making a general purpose change that doesn't require you to have a special configuration, you would likely add your tests here. Inside of the `./test/cases` directory you will find tests are broken into thematic sub directories. Take a moment to explore the different options.
To add a new case, create a new directory inside of the top level test groups, and then add an `index.js` file (and any other supporting files). To add a new case, create a new directory inside of the top level test groups, and then add an `index.js` file (and any other supporting files).
@ -39,11 +48,13 @@ To add a new case, create a new directory inside of the top level test groups, a
By default this file will be the entry point for the test suite and you can add your `it()`'s there. This will also become bundled so that node env support happens as well. By default this file will be the entry point for the test suite and you can add your `it()`'s there. This will also become bundled so that node env support happens as well.
#### configCases (`ConfigTestCases.basictest.js`) <sup>1</sup> #### configCases (`ConfigTestCases.basictest.js`) <sup>1</sup>
If you are trying to solve a bug which is reproducible when x and y properties are used together in a config, then configCases is the place to be!!!! If you are trying to solve a bug which is reproducible when x and y properties are used together in a config, then configCases is the place to be!!!!
In addition to an `index.js`, these configCases require a `webpack.config.js` is located inside of your test suite. This will run this specific config through `webpack` just as you were building individually. They will use the same loading/bundling technique of your `it()` tests, however you now have a more specific config use cases that you can write even before you start coding. In addition to an `index.js`, these configCases require a `webpack.config.js` is located inside of your test suite. This will run this specific config through `webpack` just as you were building individually. They will use the same loading/bundling technique of your `it()` tests, however you now have a more specific config use cases that you can write even before you start coding.
#### statsCases (`StatsTestCases.basictest.js`) #### statsCases (`StatsTestCases.basictest.js`)
Stats cases are similar to configCases except specifically focusing on the `expected` output of your stats. Instead of writing to the console, however the output of stats will be written to disk. Stats cases are similar to configCases except specifically focusing on the `expected` output of your stats. Instead of writing to the console, however the output of stats will be written to disk.
By default, the "expected" outcome is a pain to write by hand so instead when statsCases are run, runner is checking output using jest's awesome snapshot functionality. By default, the "expected" outcome is a pain to write by hand so instead when statsCases are run, runner is checking output using jest's awesome snapshot functionality.
@ -52,21 +63,23 @@ Basically you don't need to write any expected behaviors yourself. The assumptio
Please follow the approach described below: Please follow the approach described below:
* write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js` - write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js`
```javascript ```javascript
import("./someModule"); import("./someModule");
``` ```
* don't forget the `webpack.config.js`
* run the test - don't forget the `webpack.config.js`
* jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there - run the test
* Next time test will run -> runner will compare results against your output written to snapshot previously - jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there
- Next time test will run -> runner will compare results against your output written to snapshot previously
You can read more about SnapShot testing [right here](https://jestjs.io/docs/snapshot-testing) You can read more about SnapShot testing [right here](https://jestjs.io/docs/snapshot-testing)
## Questions? Comments? ## Questions? Comments?
If you are still nervous or don't quite understand, please submit an issue and tag us in it, and provide a relevant PR while working on! If you are still nervous or don't quite understand, please submit an issue and tag us in it, and provide a relevant PR while working on!
## Footnotes ## Footnotes
<sup>1</sup> webpack's parser supports the use of ES2015 features like arrow functions, harmony exports, etc. However as a library we follow Node.js' timeline for dropping older versions of node. Because of this we expect your tests on GitHub Actions to pass all the way back to NodeJS v10; Therefore if you would like specific tests that use these features to be ignored if they are not supported, then you should add a `test.filter.js` file. This allows you to import the syntax needed for that test, meanwhile ignoring it on node versions (during CI) that don't support it. webpack has a variety of helpful examples you can refer to if you are just starting out. See the `./helpers` folder to find a list of the versions. <sup>1</sup> webpack's parser supports the use of ES2015 features like arrow functions, harmony exports, etc. However as a library we follow Node.js' timeline for dropping older versions of node. Because of this we expect your tests on GitHub Actions to pass all the way back to NodeJS v10; Therefore if you would like specific tests that use these features to be ignored if they are not supported, then you should add a `test.filter.js` file. This allows you to import the syntax needed for that test, meanwhile ignoring it on node versions (during CI) that don't support it. webpack has a variety of helpful examples you can refer to if you are just starting out. See the `./helpers` folder to find a list of the versions.

View File

@ -1,4 +1,4 @@
module.exports = function(config) { module.exports = function (config) {
// This test can't run in development mode as it depends on the flagIncludedChunks optimization // This test can't run in development mode as it depends on the flagIncludedChunks optimization
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,5 @@
module.exports = [ module.exports = [
[/It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./], [
/It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./
]
]; ];

View File

@ -1,6 +1,3 @@
module.exports = [ module.exports = [
[ [/Module build failed( \(from [^)]+\))?:\nMessage/, { details: /Stack/ }]
/Module build failed( \(from [^)]+\))?:\nMessage/,
{details: /Stack/}
]
]; ];

View File

@ -1,3 +1,3 @@
module.exports = [ module.exports = [
[/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/], [/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/]
]; ];

View File

@ -1,6 +1,6 @@
var fs = require("fs"); var fs = require("fs");
var path = require("path"); var path = require("path");
module.exports = function(config) { module.exports = function (config) {
return fs.existsSync(path.join(__dirname, "TEST.FILTER.JS")); return fs.existsSync(path.join(__dirname, "TEST.FILTER.JS"));
}; };

View File

@ -1,4 +1,12 @@
module.exports = [ module.exports = [
[/There are multiple modules with names that only differ in casing/, /case-sensitive.A\.js/, /case-sensitive.a\.js/], [
[/There are multiple modules with names that only differ in casing/, /case-sensitive.B.file\.js/, /case-sensitive.b.file\.js/] /There are multiple modules with names that only differ in casing/,
/case-sensitive.A\.js/,
/case-sensitive.a\.js/
],
[
/There are multiple modules with names that only differ in casing/,
/case-sensitive.B.file\.js/,
/case-sensitive.b.file\.js/
]
]; ];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Module not found/]];
[/Module not found/],
];

View File

@ -1,5 +1 @@
module.exports = [ module.exports = [[/Can't resolve '.\/missing'/]];
[
/Can't resolve '.\/missing'/
]
];

View File

@ -1,8 +1 @@
module.exports = [ module.exports = [[/err: abc/], [/The loaded module contains errors/]];
[
/err: abc/,
],
[
/The loaded module contains errors/,
],
];

View File

@ -1,12 +1,4 @@
module.exports = [ module.exports = [
[ [/abc/, /Emitted value instead of an instance of Error/, /error-loader\.js/],
/abc/, [/def/, /Emitted value instead of an instance of Error/, /error-loader\.js/]
/Emitted value instead of an instance of Error/,
/error-loader\.js/
],
[
/def/,
/Emitted value instead of an instance of Error/,
/error-loader\.js/
]
]; ];

View File

@ -1,7 +1,3 @@
module.exports = [ module.exports = [
[ [/xyz/, /Emitted value instead of an instance of Error/, /warning-loader\.js/]
/xyz/,
/Emitted value instead of an instance of Error/,
/warning-loader\.js/
]
]; ];

View File

@ -1,10 +1,16 @@
module.exports = [ module.exports = [
[ [
{moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/}, {
moduleName:
/\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/
},
/Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/ /Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/
], ],
[ [
{moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/}, {
moduleName:
/\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/
},
/Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/ /Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/
] ]
]; ];

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return !config.minimize; return !config.minimize;
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return !config.minimize; return !config.minimize;
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Critical dependency: Accessing import\.meta/]];
[/Critical dependency: Accessing import\.meta/]
];

View File

@ -1,4 +1,4 @@
module.exports = function(config) { module.exports = function (config) {
// terser doesn't support static {} // terser doesn't support static {}
if (config.mode === "production") return false; if (config.mode === "production") return false;

View File

@ -1,3 +1,3 @@
module.exports = [ module.exports = [
[/Module not found/, /Can't resolve '\.\/b' /, {details: /b\.js/}] [/Module not found/, /Can't resolve '\.\/b' /, { details: /b\.js/ }]
]; ];

View File

@ -1,3 +1,7 @@
module.exports = [ module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /extract-require\/index.js/}] [
/Module not found/,
/Can't resolve '\.\/missingModule' /,
{ moduleName: /extract-require\/index.js/ }
]
]; ];

View File

@ -1,4 +1,4 @@
module.exports = function(config) { module.exports = function (config) {
// This test can't run in development mode // This test can't run in development mode
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1,5 @@
module.exports = [ module.exports = [
[/export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/] [
/export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/
]
]; ];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Empty dependency/]];
[/Empty dependency/]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Can't resolve 'missing'/]];
[/Can't resolve 'missing'/]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]];
[/Module not found/, /Can't resolve '\.\/missingModule' /]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Critical dependency/]];
[/Critical dependency/]
];

View File

@ -1,3 +1,3 @@
module.exports = function(config) { module.exports = function (config) {
return config.mode !== "development"; return config.mode !== "development";
}; };

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]];
[/Module not found/, /Can't resolve '\.\/missingModule' /]
];

View File

@ -1,5 +1,5 @@
var supportsLogicalAssignment = require("../../../helpers/supportsLogicalAssignment"); var supportsLogicalAssignment = require("../../../helpers/supportsLogicalAssignment");
module.exports = function(config) { module.exports = function (config) {
return supportsLogicalAssignment(); return supportsLogicalAssignment();
}; };

View File

@ -1,6 +1,6 @@
const supportsOptionalCatchBinding = require("../../../helpers/supportsOptionalCatchBinding"); const supportsOptionalCatchBinding = require("../../../helpers/supportsOptionalCatchBinding");
module.exports = function(config) { module.exports = function (config) {
// XXX: Disable this test if Terser is used because it does not support ES 2019 // XXX: Disable this test if Terser is used because it does not support ES 2019
if (config.mode === "production") { if (config.mode === "production") {
return false; return false;

View File

@ -1,5 +1,5 @@
var supportsSpread = require("../../../helpers/supportsSpread"); var supportsSpread = require("../../../helpers/supportsSpread");
module.exports = function(config) { module.exports = function (config) {
return supportsSpread(); return supportsSpread();
}; };

View File

@ -1,3 +1,7 @@
module.exports = [ module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /error-handling\/index.js/}] [
/Module not found/,
/Can't resolve '\.\/missingModule' /,
{ moduleName: /error-handling\/index.js/ }
]
]; ];

View File

@ -1,3 +1,7 @@
module.exports = [ module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule2' /, {moduleName: /error-handling\/index.js/}] [
/Module not found/,
/Can't resolve '\.\/missingModule2' /,
{ moduleName: /error-handling\/index.js/ }
]
]; ];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Module not found/, /Can't resolve '\.\/someModule' /]];
[/Module not found/, /Can't resolve '\.\/someModule' /],
];

View File

@ -3,10 +3,12 @@ var supportDefaultAssignment = require("../../../helpers/supportDefaultAssignmen
var supportsObjectDestructuring = require("../../../helpers/supportsObjectDestructuring"); var supportsObjectDestructuring = require("../../../helpers/supportsObjectDestructuring");
var supportsIteratorDestructuring = require("../../../helpers/supportsIteratorDestructuring"); var supportsIteratorDestructuring = require("../../../helpers/supportsIteratorDestructuring");
module.exports = function(config) { module.exports = function (config) {
return !config.minimize && return (
!config.minimize &&
supportsES6() && supportsES6() &&
supportDefaultAssignment() && supportDefaultAssignment() &&
supportsObjectDestructuring() && supportsObjectDestructuring() &&
supportsIteratorDestructuring(); supportsIteratorDestructuring()
);
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
const supports = require("webassembly-feature"); const supports = require("webassembly-feature");
module.exports = function(config) { module.exports = function (config) {
return supports["simd"](); return supports["simd"]();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,8 +1,8 @@
const supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); // const supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
const supportsFeature = require("webassembly-feature"); // const supportsFeature = require("webassembly-feature");
module.exports = function (config) { module.exports = function (config) {
// TODO fails with CompileError: WebAssembly.instantiate(): Compiling function #0 failed: memory instruction with no memory @+24 // TODO fails with CompileError: WebAssembly.instantiate(): Compiling function #0 failed: memory instruction with no memory @+24
return false; return false;
return supportsWebAssembly() && supportsFeature.simd(); // return supportsWebAssembly() && supportsFeature.simd();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) { module.exports = function (config) {
return supportsWebAssembly(); return supportsWebAssembly();
}; };

View File

@ -5,11 +5,15 @@ module.exports = {
beforeExecute() { beforeExecute() {
try { try {
fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock"));
} catch (e) {} } catch (e) {
// Empty
}
}, },
afterExecute() { afterExecute() {
try { try {
fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock")); fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock"));
} catch (e) {} } catch (e) {
// Empty
}
} }
}; };

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
return ["a.js", "b.js"]; return ["a.js", "b.js"];
} }
}; };

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
return ["entry1.js", "entry2.js"]; return ["entry1.js", "entry2.js"];
} }
}; };

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/hashed/, /deprecated/]];
[/hashed/, /deprecated/]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [/not found/];
/not found/
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [/not found/];
/not found/
];

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
return ["entry1.js", "entry2.js"]; return ["entry1.js", "entry2.js"];
} }
}; };

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
return ["runtime.js", "common-index_js.js", "main.js"]; return ["runtime.js", "common-index_js.js", "main.js"];
} }
}; };

View File

@ -4,7 +4,7 @@ const allAssets = new Set();
const allBundles = new Set(); const allBundles = new Set();
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
allBundles.add(/\.([^.]+)\./.exec(bundle)[1]); allBundles.add(/\.([^.]+)\./.exec(bundle)[1]);
@ -12,11 +12,11 @@ module.exports = {
switch (i) { switch (i) {
case 0: case 0:
asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'img')[0]; asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "img")[0];
break; break;
case 1: case 1:
case 5: case 5:
asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'asset')[0]; asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "asset")[0];
break; break;
} }

View File

@ -4,7 +4,7 @@ const allFilenameHashes = new Set();
const allChunkHashes = new Set(); const allChunkHashes = new Set();
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
const filename = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; const filename = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
const filenameHash = /\.([a-f0-9]+)\.js$/.exec(filename)[1]; const filenameHash = /\.([a-f0-9]+)\.js$/.exec(filename)[1];
allFilenameHashes.add(filenameHash); allFilenameHashes.add(filenameHash);

View File

@ -4,7 +4,7 @@ const allAssets = new Set();
const allBundles = new Set(); const allBundles = new Set();
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0]; const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
allBundles.add(/\.([^.]+)\./.exec(bundle)[1]); allBundles.add(/\.([^.]+)\./.exec(bundle)[1]);

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/hashed/, /deprecated/]];
[/hashed/, /deprecated/]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/hashed/, /deprecated/]];
[/hashed/, /deprecated/]
];

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./runtime~main.js", "./main.js"];
"./runtime~main.js",
"./main.js"
]
} }
}; };

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return ["./app.js", "./react-vendors.js"]; return ["./app.js", "./react-vendors.js"];
} }
}; };

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./a.js", "./b.js"];
"./a.js",
"./b.js"
]
} }
}; };

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./a.js", "./b.js"];
"./a.js",
"./b.js"
]
} }
}; };

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./a.js", "./b.js"];
"./a.js",
"./b.js"
]
} }
}; };

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/^Module not found/, /.\/index\.js/]];
[/^Module not found/, /.\/index\.js/]
];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/Module not found/]];
[/Module not found/]
];

View File

@ -1,9 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./a.js", "./b.js", "./bundle0.js"];
"./a.js",
"./b.js",
"./bundle0.js"
]
} }
}; };

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function(i, options) { findBundle: function (i, options) {
return [ return ["./common.js", "./main.js"];
"./common.js",
"./main.js"
]
} }
}; };

View File

@ -1,14 +1,14 @@
const System = require("../../../helpers/fakeSystem"); const System = require("../../../helpers/fakeSystem");
module.exports = { module.exports = {
target: 'web', target: "web",
beforeExecute: () => { beforeExecute: () => {
System.init(); System.init();
}, },
moduleScope(scope) { moduleScope(scope) {
scope.window.windowExt = 'works'; scope.window.windowExt = "works";
scope.rootExt = 'works'; scope.rootExt = "works";
scope.varExt = 'works'; scope.varExt = "works";
scope.System = System; scope.System = System;
}, },
afterExecute: () => { afterExecute: () => {

View File

@ -1,3 +1,3 @@
module.exports = function () { module.exports = function () {
return process.version.slice(0, 4) !== "v10." return process.version.slice(0, 4) !== "v10.";
}; };

View File

@ -1,9 +1,9 @@
var fs = require('fs'); var fs = require("fs");
module.exports = { module.exports = {
noTests: true, noTests: true,
findBundle: function(i, options) { findBundle: function (i, options) {
var regex = new RegExp("^bundle\." + options.name, "i"); var regex = new RegExp("^bundle." + options.name, "i");
var files = fs.readdirSync(options.output.path); var files = fs.readdirSync(options.output.path);
var bundle = files.find(function (file) { var bundle = files.find(function (file) {
return regex.test(file); return regex.test(file);

View File

@ -1,10 +1,12 @@
module.exports = [ module.exports = [
{ {
code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/, code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/,
message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/ message:
/Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/
}, },
{ {
code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/, code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/,
message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/ message:
/Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/
} }
]; ];

View File

@ -1,3 +1 @@
module.exports = [ module.exports = [[/hashed/, /deprecated/]];
[/hashed/, /deprecated/]
];

View File

@ -1,8 +1,5 @@
module.exports = { module.exports = {
findBundle: function() { findBundle: function () {
return [ return ["./a.js", "./b.js"];
"./a.js",
"./b.js"
];
} }
}; };

Some files were not shown because too many files have changed in this diff Show More