Commit graph

4 commits

Author SHA1 Message Date
Shuaib Hasan Akib
1b4dcc01ff docs: replace old https://angular.io/license with https://angular.dev/license 2026-01-12 13:41:30 -08:00
Joey Perrott
de4c06cf5c build: migrate tslint rules from dev-infra to local (#62709)
Migrate the tslint rules used in dev-infra to locally defined rules as they are unused in other repos

PR Close #62709
2025-07-22 10:07:13 -04:00
Paul Gschwendtner
6add6a097d build: replace validate import ESM/CJS interop rule with dev-infra shipped rule (#44238)
The import ESM/CJS interop lint rule has been ported to the shared
dev-infra package, so we can remove the local version here.

PR Close #44238
2021-12-08 13:42:41 -05:00
Paul Gschwendtner
d15a692789 build: enable esModuleInterop in TypeScript compilations (#43431)
Enables the `esModuleInterop` for all TypeScript compilations in the
project. This allows us to emit proper ESM-compatible code. e.g.
consider the following import:

```ts
import * as ts from 'typescript';
```

This import currently will break at runtime in NodeJS because the
`typescript` package is not shipping ESM. It's still a CommonJS module.
ES modules are able to import from `typescript` though, using an import
statement as above, but everything in `module.exports` is being exposed
as the `default` named export. TypeScript at runtime does not have any
other named exports, so for actual ESM compatibility, all of our imports
need to be switched to:

```
import ts from 'typescript';
```

The `esModuleInterop` option allows this to work even though the
`d.ts` file of TS currently suggests that there are _only_ named exports.
The TypeScript language service will now suggest the correct import form as
shown above. It doesn't enforce that unfortunately, but this commit also
adds a lint rule that enforces certain patterns so that we emit imports
that are compatible with both ESM and CJS output (CJS still needed here
since tests run with CJS devmode output still; this is a future project
to switch that over to ESM!)

PR Close #43431
2021-10-01 18:28:45 +00:00