conventional-changelog/commitlint
### [`v16.0.1`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@commitlint/cli/CHANGELOG.md#1601-httpsgithubcomconventional-changelogcommitlintcomparev1600v1601-2021-12-28)
[Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v16.0.0...v16.0.1)
**Note:** Version bump only for package [@commitlint/cli](https://togithub.com/commitlint/cli)
typescript-eslint/typescript-eslint (@typescript-eslint/eslint-plugin)
### [`v5.8.1`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#581-httpsgithubcomtypescript-eslinttypescript-eslintcomparev580v581-2021-12-27)
[Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1)
##### Bug Fixes
- **eslint-plugin:** \[consistent-indexed-object-style] do not report for circular references ([#4347](https://togithub.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://togithub.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7))
- **eslint-plugin:** \[consistent-type-definitions] correct fixer with declare keyword ([#4334](https://togithub.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://togithub.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427))
- **eslint-plugin:** \[padding-line-between-statements] make function overloading is also processed ([#4345](https://togithub.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://togithub.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380))
typescript-eslint/typescript-eslint (@typescript-eslint/parser)
### [`v5.8.1`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#581-httpsgithubcomtypescript-eslinttypescript-eslintcomparev580v581-2021-12-27)
[Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1)
**Note:** Version bump only for package [@typescript-eslint/parser](https://togithub.com/typescript-eslint/parser)
bcoe/c8
### [`v7.11.0`](https://togithub.com/bcoe/c8/blob/HEAD/CHANGELOG.md#7110-httpsgithubcombcoec8comparev7100v7110-2021-12-30)
[Compare Source](https://togithub.com/bcoe/c8/compare/v7.10.0...v7.11.0)
##### Features
- add --extension option ([#331](https://togithub.com/bcoe/c8/issues/331)) ([ff01cd8](https://togithub.com/bcoe/c8/commit/ff01cd832a155494892b24c30c5a1c8f0169fd8e))
##### Bug Fixes
- **config:** support configuration inheritance ([#343](https://togithub.com/bcoe/c8/issues/343)) ([e81ed5d](https://togithub.com/bcoe/c8/commit/e81ed5dd9ef5dac1a1f2f6dc26a07abb6c05d709))
evanw/esbuild
### [`v0.14.10`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01410)
[Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.9...v0.14.10)
- Enable tree shaking of classes with lowered static fields ([#175](https://togithub.com/evanw/esbuild/issues/175))
If the configured target environment doesn't support static class fields, they are converted into a call to esbuild's `__publicField` function instead. However, esbuild's tree-shaking pass treated this call as a side effect, which meant that all classes with static fields were ineligible for tree shaking. This release fixes the problem by explicitly ignoring calls to the `__publicField` function during tree shaking side-effect determination. Tree shaking is now enabled for these classes:
```js
// Original code
class Foo { static foo = 'foo' }
class Bar { static bar = 'bar' }
new Bar()
// Old output (with --tree-shaking=true --target=es6)
class Foo {
}
__publicField(Foo, "foo", "foo");
class Bar {
}
__publicField(Bar, "bar", "bar");
new Bar();
// New output (with --tree-shaking=true --target=es6)
class Bar {
}
__publicField(Bar, "bar", "bar");
new Bar();
```
- Treat `--define:foo=undefined` as an undefined literal instead of an identifier ([#1407](https://togithub.com/evanw/esbuild/issues/1407))
References to the global variable `undefined` are automatically replaced with the literal value for undefined, which appears as `void 0` when printed. This allows for additional optimizations such as collapsing `undefined ?? bar` into just `bar`. However, this substitution was not done for values specified via `--define:`. As a result, esbuild could potentially miss out on certain optimizations in these cases. With this release, it's now possible to use `--define:` to substitute something with an undefined literal:
```js
// Original code
let win = typeof window !== 'undefined' ? window : {}
// Old output (with --define:window=undefined --minify)
let win=typeof undefined!="undefined"?undefined:{};
// New output (with --define:window=undefined --minify)
let win={};
```
- Add the `--drop:debugger` flag ([#1809](https://togithub.com/evanw/esbuild/issues/1809))
Passing this flag causes all [`debugger;` statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) to be removed from the output. This is similar to the `drop_debugger: true` flag available in the popular UglifyJS and Terser JavaScript minifiers.
- Add the `--drop:console` flag ([#28](https://togithub.com/evanw/esbuild/issues/28))
Passing this flag causes all [`console.xyz()` API calls](https://developer.mozilla.org/en-US/docs/Web/API/console#methods) to be removed from the output. This is similar to the `drop_console: true` flag available in the popular UglifyJS and Terser JavaScript minifiers.
WARNING: Using this flag can introduce bugs into your code! This flag removes the entire call expression including all call arguments. If any of those arguments had important side effects, using this flag will change the behavior of your code. Be very careful when using this flag. If you want to remove console API calls without removing arguments with side effects (which does not introduce bugs), you should mark the relevant API calls as pure instead like this: `--pure:console.log --minify`.
- Inline calls to certain no-op functions when minifying ([#290](https://togithub.com/evanw/esbuild/issues/290), [#907](https://togithub.com/evanw/esbuild/issues/907))
This release makes esbuild inline two types of no-op functions: empty functions and identity functions. These most commonly arise when most of the function body is eliminated as dead code. In the examples below, this happens because we use `--define:window.DEBUG=false` to cause dead code elimination inside the function body of the resulting `if (false)` statement. This inlining is a small code size and performance win but, more importantly, it allows for people to use these features to add useful abstractions that improve the development experience without needing to worry about the run-time performance impact.
An identity function is a function that just returns its argument. Here's an example of inlining an identity function:
```js
// Original code
function logCalls(fn) {
if (window.DEBUG) return function(...args) {
console.log('calling', fn.name, 'with', args)
return fn.apply(this, args)
}
return fn
}
export const foo = logCalls(function foo() {})
// Old output (with --minify --define:window.DEBUG=false --tree-shaking=true)
function o(n){return n}export const foo=o(function(){});
// New output (with --minify --define:window.DEBUG=false --tree-shaking=true)
export const foo=function(){};
```
An empty function is a function with an empty body. Here's an example of inlining an empty function:
```ts
// Original code
function assertNotNull(val: Object | null): asserts val is Object {
if (window.DEBUG && val === null) throw new Error('null assertion failed');
}
export const val = getFoo();
assertNotNull(val);
console.log(val.bar);
// Old output (with --minify --define:window.DEBUG=false --tree-shaking=true)
function l(o){}export const val=getFoo();l(val);console.log(val.bar);
// New output (with --minify --define:window.DEBUG=false --tree-shaking=true)
export const val=getFoo();console.log(val.bar);
```
To get this behavior you'll need to use the `function` keyword to define your function since that causes the definition to be hoisted, which eliminates concerns around initialization order. These features also work across modules, so functions are still inlined even if the definition of the function is in a separate module from the call to the function. To get cross-module function inlining to work, you'll need to have bundling enabled and use the `import` and `export` keywords to access the function so that esbuild can see which functions are called. And all of this has been added without an observable impact to compile times.
I previously wasn't able to add this to esbuild easily because of esbuild's low-pass compilation approach. The compiler only does three full passes over the data for speed. The passes are roughly for parsing, binding, and printing. It's only possible to inline something after binding but it needs to be inlined before printing. Also the way module linking was done made it difficult to roll back uses of symbols that were inlined, so the symbol definitions were not tree shaken even when they became unused due to inlining.
The linking issue was somewhat resolved when I fixed [#128](https://togithub.com/evanw/esbuild/issues/128) in the previous release. To implement cross-module inlining of TypeScript enums, I came up with a hack to defer certain symbol uses until the linking phase, which happens after binding but before printing. Another hack is that inlining of TypeScript enums is done directly in the printer to avoid needing another pass.
The possibility of these two hacks has unblocked these simple function inlining use cases that are now handled. This isn't a fully general approach because optimal inlining is recursive. Inlining something may open up further inlining opportunities, which either requires multiple iterations or a worklist algorithm, both of which don't work when doing late-stage inlining in the printer. But the function inlining that esbuild now implements is still useful even though it's one level deep, and so I believe it's still worth adding.
### [`v0.14.9`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0149)
[Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.8...v0.14.9)
- Implement cross-module tree shaking of TypeScript enum values ([#128](https://togithub.com/evanw/esbuild/issues/128))
If your bundle uses TypeScript enums across multiple files, esbuild is able to inline the enum values as long as you export and import the enum using the ES module `export` and `import` keywords. However, this previously still left the definition of the enum in the bundle even when it wasn't used anymore. This was because esbuild's tree shaking (i.e. dead code elimination) is based on information recorded during parsing, and at that point we don't know which imported symbols are inlined enum values and which aren't.
With this release, esbuild will now remove enum definitions that become unused due to cross-module enum value inlining. Property accesses off of imported symbols are now tracked separately during parsing and then resolved during linking once all inlined enum values are known. This behavior change means esbuild's support for cross-module inlining of TypeScript enums is now finally complete. Here's an example:
```js
// entry.ts
import { Foo } from './enum'
console.log(Foo.Bar)
// enum.ts
export enum Foo { Bar }
```
Bundling the example code above now results in the enum definition being completely removed from the bundle:
```js
// Old output (with --bundle --minify --format=esm)
var r=(o=>(o[o.Bar=0]="Bar",o))(r||{});console.log(0);
// New output (with --bundle --minify --format=esm)
console.log(0);
```
- Fix a regression with `export {} from` and CommonJS ([#1890](https://togithub.com/evanw/esbuild/issues/1890))
This release fixes a regression that was introduced by the change in 0.14.7 that avoids calling the `__toESM` wrapper for import statements that are converted to `require` calls and that don't use the `default` or `__esModule` export names. The previous change was correct for the `import {} from` syntax but not for the `export {} from` syntax, which meant that in certain cases with re-exported values, the value of the `default` import could be different than expected. This release fixes the regression.
- Warn about using `module` or `exports` in ESM code ([#1887](https://togithub.com/evanw/esbuild/issues/1887))
CommonJS export variables cannot be referenced in ESM code. If you do this, they are treated as global variables instead. This release includes a warning for people that try to use both CommonJS and ES module export styles in the same file. Here's an example:
```ts
export enum Something {
a,
b,
}
module.exports = { a: 1, b: 2 }
```
Running esbuild on that code now generates a warning that looks like this:
▲ [WARNING] The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected
example.ts:5:0:
5 │ module.exports = { a: 1, b: 2 }
╵ ~~~~~~
This file is considered to be an ECMAScript module because of the "export" keyword here:
example.ts:1:0:
1 │ export enum Something {
╵ ~~~~~~
eslint/eslint
### [`v8.6.0`](https://togithub.com/eslint/eslint/releases/v8.6.0)
[Compare Source](https://togithub.com/eslint/eslint/compare/v8.5.0...v8.6.0)
#### Features
- [`6802a54`](https://togithub.com/eslint/eslint/commit/6802a54837ea008bef4d5ae11522941693ba5ef6) feat: handle logical assignment in no-self-assign ([#14152](https://togithub.com/eslint/eslint/issues/14152)) (Zzzen)
- [`3b38018`](https://togithub.com/eslint/eslint/commit/3b38018ef5cb004ad5bc011de726bd2df2eb2f3f) feat: allow to define `eslint-disable-next-line` in multiple lines ([#15436](https://togithub.com/eslint/eslint/issues/15436)) (Nitin Kumar)
- [`9d6fe5a`](https://togithub.com/eslint/eslint/commit/9d6fe5a6b65f397bafc5eb0a995e96717cdc9b53) feat: false negative with `onlyDeclarations` + `properties` in id-match ([#15431](https://togithub.com/eslint/eslint/issues/15431)) (Nitin Kumar)
#### Documentation
- [`6c4dee2`](https://togithub.com/eslint/eslint/commit/6c4dee2e87dac8d0751ce2426ded651ed0986112) docs: Document homedir is a configuration root ([#15469](https://togithub.com/eslint/eslint/issues/15469)) (Bas Bosman)
- [`51c37b1`](https://togithub.com/eslint/eslint/commit/51c37b118aed9c0d7a0efd40c491efca04c82ef9) docs: consistency changes ([#15404](https://togithub.com/eslint/eslint/issues/15404)) (Bas Bosman)
- [`775d181`](https://togithub.com/eslint/eslint/commit/775d18138244a28ebe1cb92849cd0f4e8cd27672) docs: Mention character classes in no-useless-escape ([#15421](https://togithub.com/eslint/eslint/issues/15421)) (Sebastian Simon)
#### Chores
- [`3a384fc`](https://togithub.com/eslint/eslint/commit/3a384fc287cebb7be5fe5ed95497d578437a503a) chore: Upgrade espree to 9.3.0 ([#15473](https://togithub.com/eslint/eslint/issues/15473)) (Brandon Mills)
- [`1443cc2`](https://togithub.com/eslint/eslint/commit/1443cc2fc8785157936b864258924fe9bcd23210) chore: Update blogpost.md.ejs ([#15468](https://togithub.com/eslint/eslint/issues/15468)) (Nicholas C. Zakas)
- [`28e907a`](https://togithub.com/eslint/eslint/commit/28e907a4ca05a026d156f814f4118f8fe713e99d) refactor: remove unused parameter in `linter.js` ([#15451](https://togithub.com/eslint/eslint/issues/15451)) (Milos Djermanovic)
- [`eaa08d3`](https://togithub.com/eslint/eslint/commit/eaa08d3055b195bce59cc96bb63ac29038cd7c7d) test: add tests for `allowReserved` parser option with flat config ([#15450](https://togithub.com/eslint/eslint/issues/15450)) (Milos Djermanovic)
okonet/lint-staged
### [`v12.1.5`](https://togithub.com/okonet/lint-staged/releases/v12.1.5)
[Compare Source](https://togithub.com/okonet/lint-staged/compare/v12.1.4...v12.1.5)
##### Bug Fixes
- search configuration starting from explicit cwd option ([c7ea359](https://togithub.com/okonet/lint-staged/commit/c7ea3594c81f7c2724a7babc8e8d57926b4679c8))
- using `--debug` option enables debug mode ([5cceeb6](https://togithub.com/okonet/lint-staged/commit/5cceeb65630752b646047ae88cacc48b76758f1c))
egoist/tsup
### [`v5.11.10`](https://togithub.com/egoist/tsup/releases/v5.11.10)
[Compare Source](https://togithub.com/egoist/tsup/compare/v5.11.9...v5.11.10)
##### Bug Fixes
- remove --inlineDynamicImports (it's never used) ([ce15069](https://togithub.com/egoist/tsup/commit/ce15069d346e75d6bbbbb7431ad5deac06b1772a))
- support multiple targets ([#525](https://togithub.com/egoist/tsup/issues/525)) ([2a42a02](https://togithub.com/egoist/tsup/commit/2a42a02fc7c3619560dfaf65d548790c68c25453))
Configuration
📅 Schedule: "before 3am on Monday" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR contains the following updates:
^16.0.0
->^16.0.1
^16.11.17
->^16.11.18
^5.8.0
->^5.8.1
^5.8.0
->^5.8.1
^7.10.0
->^7.11.0
^0.14.8
->^0.14.10
^8.5.0
->^8.6.0
^12.1.4
->^12.1.5
^5.11.9
->^5.11.10
Release Notes
conventional-changelog/commitlint
### [`v16.0.1`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@commitlint/cli/CHANGELOG.md#1601-httpsgithubcomconventional-changelogcommitlintcomparev1600v1601-2021-12-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v16.0.0...v16.0.1) **Note:** Version bump only for package [@commitlint/cli](https://togithub.com/commitlint/cli)typescript-eslint/typescript-eslint (@typescript-eslint/eslint-plugin)
### [`v5.8.1`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#581-httpsgithubcomtypescript-eslinttypescript-eslintcomparev580v581-2021-12-27) [Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) ##### Bug Fixes - **eslint-plugin:** \[consistent-indexed-object-style] do not report for circular references ([#4347](https://togithub.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://togithub.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7)) - **eslint-plugin:** \[consistent-type-definitions] correct fixer with declare keyword ([#4334](https://togithub.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://togithub.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427)) - **eslint-plugin:** \[padding-line-between-statements] make function overloading is also processed ([#4345](https://togithub.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://togithub.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380))typescript-eslint/typescript-eslint (@typescript-eslint/parser)
### [`v5.8.1`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#581-httpsgithubcomtypescript-eslinttypescript-eslintcomparev580v581-2021-12-27) [Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) **Note:** Version bump only for package [@typescript-eslint/parser](https://togithub.com/typescript-eslint/parser)bcoe/c8
### [`v7.11.0`](https://togithub.com/bcoe/c8/blob/HEAD/CHANGELOG.md#7110-httpsgithubcombcoec8comparev7100v7110-2021-12-30) [Compare Source](https://togithub.com/bcoe/c8/compare/v7.10.0...v7.11.0) ##### Features - add --extension option ([#331](https://togithub.com/bcoe/c8/issues/331)) ([ff01cd8](https://togithub.com/bcoe/c8/commit/ff01cd832a155494892b24c30c5a1c8f0169fd8e)) ##### Bug Fixes - **config:** support configuration inheritance ([#343](https://togithub.com/bcoe/c8/issues/343)) ([e81ed5d](https://togithub.com/bcoe/c8/commit/e81ed5dd9ef5dac1a1f2f6dc26a07abb6c05d709))evanw/esbuild
### [`v0.14.10`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01410) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.9...v0.14.10) - Enable tree shaking of classes with lowered static fields ([#175](https://togithub.com/evanw/esbuild/issues/175)) If the configured target environment doesn't support static class fields, they are converted into a call to esbuild's `__publicField` function instead. However, esbuild's tree-shaking pass treated this call as a side effect, which meant that all classes with static fields were ineligible for tree shaking. This release fixes the problem by explicitly ignoring calls to the `__publicField` function during tree shaking side-effect determination. Tree shaking is now enabled for these classes: ```js // Original code class Foo { static foo = 'foo' } class Bar { static bar = 'bar' } new Bar() // Old output (with --tree-shaking=true --target=es6) class Foo { } __publicField(Foo, "foo", "foo"); class Bar { } __publicField(Bar, "bar", "bar"); new Bar(); // New output (with --tree-shaking=true --target=es6) class Bar { } __publicField(Bar, "bar", "bar"); new Bar(); ``` - Treat `--define:foo=undefined` as an undefined literal instead of an identifier ([#1407](https://togithub.com/evanw/esbuild/issues/1407)) References to the global variable `undefined` are automatically replaced with the literal value for undefined, which appears as `void 0` when printed. This allows for additional optimizations such as collapsing `undefined ?? bar` into just `bar`. However, this substitution was not done for values specified via `--define:`. As a result, esbuild could potentially miss out on certain optimizations in these cases. With this release, it's now possible to use `--define:` to substitute something with an undefined literal: ```js // Original code let win = typeof window !== 'undefined' ? window : {} // Old output (with --define:window=undefined --minify) let win=typeof undefined!="undefined"?undefined:{}; // New output (with --define:window=undefined --minify) let win={}; ``` - Add the `--drop:debugger` flag ([#1809](https://togithub.com/evanw/esbuild/issues/1809)) Passing this flag causes all [`debugger;` statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) to be removed from the output. This is similar to the `drop_debugger: true` flag available in the popular UglifyJS and Terser JavaScript minifiers. - Add the `--drop:console` flag ([#28](https://togithub.com/evanw/esbuild/issues/28)) Passing this flag causes all [`console.xyz()` API calls](https://developer.mozilla.org/en-US/docs/Web/API/console#methods) to be removed from the output. This is similar to the `drop_console: true` flag available in the popular UglifyJS and Terser JavaScript minifiers. WARNING: Using this flag can introduce bugs into your code! This flag removes the entire call expression including all call arguments. If any of those arguments had important side effects, using this flag will change the behavior of your code. Be very careful when using this flag. If you want to remove console API calls without removing arguments with side effects (which does not introduce bugs), you should mark the relevant API calls as pure instead like this: `--pure:console.log --minify`. - Inline calls to certain no-op functions when minifying ([#290](https://togithub.com/evanw/esbuild/issues/290), [#907](https://togithub.com/evanw/esbuild/issues/907)) This release makes esbuild inline two types of no-op functions: empty functions and identity functions. These most commonly arise when most of the function body is eliminated as dead code. In the examples below, this happens because we use `--define:window.DEBUG=false` to cause dead code elimination inside the function body of the resulting `if (false)` statement. This inlining is a small code size and performance win but, more importantly, it allows for people to use these features to add useful abstractions that improve the development experience without needing to worry about the run-time performance impact. An identity function is a function that just returns its argument. Here's an example of inlining an identity function: ```js // Original code function logCalls(fn) { if (window.DEBUG) return function(...args) { console.log('calling', fn.name, 'with', args) return fn.apply(this, args) } return fn } export const foo = logCalls(function foo() {}) // Old output (with --minify --define:window.DEBUG=false --tree-shaking=true) function o(n){return n}export const foo=o(function(){}); // New output (with --minify --define:window.DEBUG=false --tree-shaking=true) export const foo=function(){}; ``` An empty function is a function with an empty body. Here's an example of inlining an empty function: ```ts // Original code function assertNotNull(val: Object | null): asserts val is Object { if (window.DEBUG && val === null) throw new Error('null assertion failed'); } export const val = getFoo(); assertNotNull(val); console.log(val.bar); // Old output (with --minify --define:window.DEBUG=false --tree-shaking=true) function l(o){}export const val=getFoo();l(val);console.log(val.bar); // New output (with --minify --define:window.DEBUG=false --tree-shaking=true) export const val=getFoo();console.log(val.bar); ``` To get this behavior you'll need to use the `function` keyword to define your function since that causes the definition to be hoisted, which eliminates concerns around initialization order. These features also work across modules, so functions are still inlined even if the definition of the function is in a separate module from the call to the function. To get cross-module function inlining to work, you'll need to have bundling enabled and use the `import` and `export` keywords to access the function so that esbuild can see which functions are called. And all of this has been added without an observable impact to compile times. I previously wasn't able to add this to esbuild easily because of esbuild's low-pass compilation approach. The compiler only does three full passes over the data for speed. The passes are roughly for parsing, binding, and printing. It's only possible to inline something after binding but it needs to be inlined before printing. Also the way module linking was done made it difficult to roll back uses of symbols that were inlined, so the symbol definitions were not tree shaken even when they became unused due to inlining. The linking issue was somewhat resolved when I fixed [#128](https://togithub.com/evanw/esbuild/issues/128) in the previous release. To implement cross-module inlining of TypeScript enums, I came up with a hack to defer certain symbol uses until the linking phase, which happens after binding but before printing. Another hack is that inlining of TypeScript enums is done directly in the printer to avoid needing another pass. The possibility of these two hacks has unblocked these simple function inlining use cases that are now handled. This isn't a fully general approach because optimal inlining is recursive. Inlining something may open up further inlining opportunities, which either requires multiple iterations or a worklist algorithm, both of which don't work when doing late-stage inlining in the printer. But the function inlining that esbuild now implements is still useful even though it's one level deep, and so I believe it's still worth adding. ### [`v0.14.9`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0149) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.8...v0.14.9) - Implement cross-module tree shaking of TypeScript enum values ([#128](https://togithub.com/evanw/esbuild/issues/128)) If your bundle uses TypeScript enums across multiple files, esbuild is able to inline the enum values as long as you export and import the enum using the ES module `export` and `import` keywords. However, this previously still left the definition of the enum in the bundle even when it wasn't used anymore. This was because esbuild's tree shaking (i.e. dead code elimination) is based on information recorded during parsing, and at that point we don't know which imported symbols are inlined enum values and which aren't. With this release, esbuild will now remove enum definitions that become unused due to cross-module enum value inlining. Property accesses off of imported symbols are now tracked separately during parsing and then resolved during linking once all inlined enum values are known. This behavior change means esbuild's support for cross-module inlining of TypeScript enums is now finally complete. Here's an example: ```js // entry.ts import { Foo } from './enum' console.log(Foo.Bar) // enum.ts export enum Foo { Bar } ``` Bundling the example code above now results in the enum definition being completely removed from the bundle: ```js // Old output (with --bundle --minify --format=esm) var r=(o=>(o[o.Bar=0]="Bar",o))(r||{});console.log(0); // New output (with --bundle --minify --format=esm) console.log(0); ``` - Fix a regression with `export {} from` and CommonJS ([#1890](https://togithub.com/evanw/esbuild/issues/1890)) This release fixes a regression that was introduced by the change in 0.14.7 that avoids calling the `__toESM` wrapper for import statements that are converted to `require` calls and that don't use the `default` or `__esModule` export names. The previous change was correct for the `import {} from` syntax but not for the `export {} from` syntax, which meant that in certain cases with re-exported values, the value of the `default` import could be different than expected. This release fixes the regression. - Warn about using `module` or `exports` in ESM code ([#1887](https://togithub.com/evanw/esbuild/issues/1887)) CommonJS export variables cannot be referenced in ESM code. If you do this, they are treated as global variables instead. This release includes a warning for people that try to use both CommonJS and ES module export styles in the same file. Here's an example: ```ts export enum Something { a, b, } module.exports = { a: 1, b: 2 } ``` Running esbuild on that code now generates a warning that looks like this: ▲ [WARNING] The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected example.ts:5:0: 5 │ module.exports = { a: 1, b: 2 } ╵ ~~~~~~ This file is considered to be an ECMAScript module because of the "export" keyword here: example.ts:1:0: 1 │ export enum Something { ╵ ~~~~~~eslint/eslint
### [`v8.6.0`](https://togithub.com/eslint/eslint/releases/v8.6.0) [Compare Source](https://togithub.com/eslint/eslint/compare/v8.5.0...v8.6.0) #### Features - [`6802a54`](https://togithub.com/eslint/eslint/commit/6802a54837ea008bef4d5ae11522941693ba5ef6) feat: handle logical assignment in no-self-assign ([#14152](https://togithub.com/eslint/eslint/issues/14152)) (Zzzen) - [`3b38018`](https://togithub.com/eslint/eslint/commit/3b38018ef5cb004ad5bc011de726bd2df2eb2f3f) feat: allow to define `eslint-disable-next-line` in multiple lines ([#15436](https://togithub.com/eslint/eslint/issues/15436)) (Nitin Kumar) - [`9d6fe5a`](https://togithub.com/eslint/eslint/commit/9d6fe5a6b65f397bafc5eb0a995e96717cdc9b53) feat: false negative with `onlyDeclarations` + `properties` in id-match ([#15431](https://togithub.com/eslint/eslint/issues/15431)) (Nitin Kumar) #### Documentation - [`6c4dee2`](https://togithub.com/eslint/eslint/commit/6c4dee2e87dac8d0751ce2426ded651ed0986112) docs: Document homedir is a configuration root ([#15469](https://togithub.com/eslint/eslint/issues/15469)) (Bas Bosman) - [`51c37b1`](https://togithub.com/eslint/eslint/commit/51c37b118aed9c0d7a0efd40c491efca04c82ef9) docs: consistency changes ([#15404](https://togithub.com/eslint/eslint/issues/15404)) (Bas Bosman) - [`775d181`](https://togithub.com/eslint/eslint/commit/775d18138244a28ebe1cb92849cd0f4e8cd27672) docs: Mention character classes in no-useless-escape ([#15421](https://togithub.com/eslint/eslint/issues/15421)) (Sebastian Simon) #### Chores - [`3a384fc`](https://togithub.com/eslint/eslint/commit/3a384fc287cebb7be5fe5ed95497d578437a503a) chore: Upgrade espree to 9.3.0 ([#15473](https://togithub.com/eslint/eslint/issues/15473)) (Brandon Mills) - [`1443cc2`](https://togithub.com/eslint/eslint/commit/1443cc2fc8785157936b864258924fe9bcd23210) chore: Update blogpost.md.ejs ([#15468](https://togithub.com/eslint/eslint/issues/15468)) (Nicholas C. Zakas) - [`28e907a`](https://togithub.com/eslint/eslint/commit/28e907a4ca05a026d156f814f4118f8fe713e99d) refactor: remove unused parameter in `linter.js` ([#15451](https://togithub.com/eslint/eslint/issues/15451)) (Milos Djermanovic) - [`eaa08d3`](https://togithub.com/eslint/eslint/commit/eaa08d3055b195bce59cc96bb63ac29038cd7c7d) test: add tests for `allowReserved` parser option with flat config ([#15450](https://togithub.com/eslint/eslint/issues/15450)) (Milos Djermanovic)okonet/lint-staged
### [`v12.1.5`](https://togithub.com/okonet/lint-staged/releases/v12.1.5) [Compare Source](https://togithub.com/okonet/lint-staged/compare/v12.1.4...v12.1.5) ##### Bug Fixes - search configuration starting from explicit cwd option ([c7ea359](https://togithub.com/okonet/lint-staged/commit/c7ea3594c81f7c2724a7babc8e8d57926b4679c8)) - using `--debug` option enables debug mode ([5cceeb6](https://togithub.com/okonet/lint-staged/commit/5cceeb65630752b646047ae88cacc48b76758f1c))egoist/tsup
### [`v5.11.10`](https://togithub.com/egoist/tsup/releases/v5.11.10) [Compare Source](https://togithub.com/egoist/tsup/compare/v5.11.9...v5.11.10) ##### Bug Fixes - remove --inlineDynamicImports (it's never used) ([ce15069](https://togithub.com/egoist/tsup/commit/ce15069d346e75d6bbbbb7431ad5deac06b1772a)) - support multiple targets ([#525](https://togithub.com/egoist/tsup/issues/525)) ([2a42a02](https://togithub.com/egoist/tsup/commit/2a42a02fc7c3619560dfaf65d548790c68c25453))Configuration
📅 Schedule: "before 3am on Monday" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by WhiteSource Renovate. View repository job log here.