Skip to content

Commit 7427d47

Browse files
authored
chore: upgrade eslint from v8 to v9
1 parent d1ba3a0 commit 7427d47

19 files changed

+3582
-1577
lines changed

.cspell.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"version": "0.2",
33
"language": "en,en-gb",
4-
"words": ["memfs", "sokra", "Koppers", "commitlint"],
5-
4+
"words": [
5+
"memfs",
6+
"sokra",
7+
"Koppers",
8+
"commitlint",
9+
"eslintcache",
10+
"cspellcache"
11+
],
612
"ignorePaths": [
713
"CHANGELOG.md",
814
"package.json",

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ logs
33
*.log
44
npm-debug.log*
55
.eslintcache
6+
.cspellcache
67
/coverage
78
/dist
89
/local

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ import myLib from "imports-loader?imports=named|library|myMethod,angular!./examp
109109
```
110110

111111
```js
112-
const myLib = require(
113-
`imports-loader?type=commonjs&imports=single|jquery|$,angular!./example.js`,
114-
);
112+
const myLib = require("imports-loader?type=commonjs&imports=single|jquery|$,angular!./example.js");
115113
// `|` is separator in a query string, equivalently `single|jquery|$` and `angular`
116114
// Adds the following code to the beginning of example.js:
117115
//
@@ -124,9 +122,7 @@ const myLib = require(
124122
```
125123

126124
```js
127-
const myLib = require(
128-
`imports-loader?type=commonjs&imports=single|myLib|myMethod&wrapper=window&!./example.js`,
129-
);
125+
const myLib = require("imports-loader?type=commonjs&imports=single|myLib|myMethod&wrapper=window&!./example.js");
130126
// `|` is separator in a query string, equivalently `single|myLib|myMethod` and `angular`
131127
// Adds the following code to the example.js:
132128
//
@@ -190,13 +186,15 @@ module.exports = {
190186

191187
Generate output:
192188

189+
<!-- eslint-skip -->
190+
193191
```js
192+
import angular from "angular";
194193
import $ from "jquery";
195194
import lib_2_default from "lib_2";
196195
import { lib2_method_1, lib2_method_2 as lib_2_method_2_short } from "lib_3";
197196
import * as my_namespace from "lib_4";
198197
import "lib_5";
199-
import angular from "angular";
200198
```
201199

202200
Finally, run `webpack` using the method you normally use (e.g., via CLI or an npm script).
@@ -250,7 +248,7 @@ module.exports = {
250248
Generate output:
251249

252250
```js
253-
var Foo = require("Foo");
251+
const Foo = require("Foo");
254252

255253
// ...
256254
// Code
@@ -308,7 +306,7 @@ type imports =
308306
name: string;
309307
alias: string;
310308
}
311-
| Array<
309+
| (
312310
| string
313311
| {
314312
syntax:
@@ -323,7 +321,7 @@ type imports =
323321
name: string;
324322
alias: string;
325323
}
326-
>;
324+
)[];
327325
```
328326

329327
Default: `undefined`
@@ -341,7 +339,6 @@ The `|` or `%20` (space) allow to separate the `syntax`, `moduleName`, `name` an
341339
String syntax - `[[syntax] [moduleName] [name] [alias]]` or `[[syntax]|[moduleName]|[name]|[alias]]`, where:
342340

343341
- `[syntax]` (**may be omitted**):
344-
345342
- if `type` is `module`- can be `default`, `named`, `namespace` or `side-effects`, the default value is `default`.
346343
- if `type` is `commonjs`- can be `single`, `multiple` or `pure`, the default value is `single`.
347344

@@ -433,7 +430,7 @@ module.exports = {
433430
Generate output:
434431

435432
```js
436-
var myName = require("lib");
433+
const myName = require("lib");
437434

438435
// ...
439436
// Code
@@ -447,7 +444,6 @@ Allows to use an object to describe an import.
447444
Properties:
448445

449446
- `syntax`:
450-
451447
- if `type` is `module`- can be `default`, `named`, `namespace` or `side-effects`
452448
- if `type` is `commonjs`- can be `single`, `multiple` or `pure`
453449

@@ -543,6 +539,8 @@ module.exports = {
543539

544540
Generate output:
545541

542+
<!-- eslint-skip -->
543+
546544
```js
547545
import angular from "angular";
548546
import $ from "jquery";
@@ -566,7 +564,7 @@ type wrapper =
566564
| string
567565
| {
568566
thisArg: string;
569-
args: Record<string, string> | Array<string>;
567+
args: Record<string, string> | string[];
570568
};
571569
```
572570

@@ -610,6 +608,8 @@ module.exports = {
610608

611609
Generate output:
612610

611+
<!-- eslint-skip -->
612+
613613
```js
614614
import $ from "jquery";
615615

@@ -652,14 +652,16 @@ module.exports = {
652652

653653
Generate output:
654654

655+
<!-- eslint-skip -->
656+
655657
```js
656658
import $ from "jquery";
657659

658660
(function () {
659661
// ...
660662
// Code
661663
// ...
662-
}).call(window);
664+
}).call(globalThis);
663665
```
664666

665667
#### `object`
@@ -697,14 +699,16 @@ module.exports = {
697699

698700
Generate output:
699701

702+
<!-- eslint-skip -->
703+
700704
```js
701705
import $ from "jquery";
702706

703707
(function (myVariable, myOtherVariable) {
704708
// ...
705709
// Code
706710
// ...
707-
}).call(window, myVariable, myOtherVariable);
711+
}).call(globalThis, myVariable, myOtherVariable);
708712
```
709713

710714
#### `object` with different parameter names
@@ -745,14 +749,16 @@ module.exports = {
745749

746750
Generate output:
747751

752+
<!-- eslint-skip -->
753+
748754
```js
749755
import $ from "jquery";
750756

751757
(function (var1, var2) {
752758
// ...
753759
// Code
754760
// ...
755-
}).call(window, myVariable, myOtherVariable);
761+
}).call(globalThis, myVariable, myOtherVariable);
756762
```
757763

758764
### `additionalCode`
@@ -802,7 +808,7 @@ Generate output:
802808
```js
803809
import $ from "jquery";
804810

805-
var myVariable = false;
811+
const myVariable = false;
806812

807813
// ...
808814
// Code
@@ -843,7 +849,7 @@ Generate output:
843849
```js
844850
import $ from "jquery";
845851

846-
var define = false; /* Disable AMD for misbehaving libraries */
852+
const define = false; /* Disable AMD for misbehaving libraries */
847853

848854
// ...
849855
// Code

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from "eslint/config";
2+
import configs from "eslint-config-webpack/configs.js";
3+
4+
export default defineConfig([
5+
{
6+
extends: [configs["recommended-dirty"]],
7+
},
8+
]);

0 commit comments

Comments
 (0)