Replace eslint-plugin-react with @eslint-react/eslint-plugin (#17152)
This commit is contained in:
1 parent
f818a362d6
commit
ca4ab12695
10 files changed
+382
-1246
No files matched your search
@@ -121,6 +121,28 @@ function esmifyTypescriptEslint(text) {
|
||||
`,
|
||||
);
|
||||
|
||||
/**
|
||||
```js
|
||||
var FOO;
|
||||
(function (FOO) {
|
||||
})(FOO || (exports.FOO = FOO = {}));
|
||||
```
|
||||
->
|
||||
```js
|
||||
var FOO;
|
||||
(function (FOO) {
|
||||
})(FOO ?? {}));
|
||||
export {FOO};
|
||||
```
|
||||
*/
|
||||
text = text.replaceAll(
|
||||
/(?<=\n\}\))\((?<name>\S+) \|\| \(exports\.\k<name> = \k<name> = \{\}\)\);/gu,
|
||||
outdent`
|
||||
($<name> ??= {});
|
||||
export {$<name>};
|
||||
`,
|
||||
);
|
||||
|
||||
// Make sure ESBuild treat it as Module
|
||||
text += "\nexport {};";
|
||||
|
||||
|
||||
Reference in new issue
Block a user