diff --git a/.editorconfig b/.editorconfig index 58db511587d7..d18a28ff4a8a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ insert_final_newline = true indent_size = 4 insert_final_newline = false -[website/blog/*.md] +[{,website/blog/,changelog_unreleased/**/}*.md] trim_trailing_whitespace = false [tests/{**/__snapshots__/*, tests/format/**/*}] diff --git a/.eslintrc.js b/.eslintrc.js index 562538ab626b..73aea2d35397 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,9 +4,10 @@ const { isCI } = require("ci-info"); module.exports = { root: true, env: { - es2020: true, + es2021: true, node: true, }, + reportUnusedDisableDirectives: true, extends: ["eslint:recommended", "prettier"], plugins: ["prettier-internal-rules", "import", "regexp", "unicorn"], settings: { @@ -89,7 +90,7 @@ module.exports = { }, ], - "import/extensions": ["error", "always", { ignorePackages: true }], + "import/extensions": ["error", "ignorePackages"], "import/no-extraneous-dependencies": [ "error", { @@ -118,6 +119,8 @@ module.exports = { "unicorn/new-for-builtins": "error", "unicorn/no-array-for-each": "error", "unicorn/no-array-push-push": "error", + "unicorn/no-new-array": "error", + "unicorn/no-useless-length-check": "error", "unicorn/no-useless-undefined": "error", "unicorn/prefer-array-flat": [ "error", @@ -126,12 +129,15 @@ module.exports = { }, ], "unicorn/prefer-array-flat-map": "error", + "unicorn/prefer-array-some": "error", "unicorn/prefer-includes": "error", "unicorn/prefer-number-properties": "error", "unicorn/prefer-optional-catch-binding": "error", "unicorn/prefer-regexp-test": "error", "unicorn/prefer-spread": "error", "unicorn/prefer-string-slice": "error", + "unicorn/prefer-string-starts-ends-with": "error", + "unicorn/prefer-type-error": "error", }, overrides: [ { @@ -168,6 +174,7 @@ module.exports = { alwaysAwait: true, }, ], + "jest/prefer-to-be": "error", }, }, { @@ -229,7 +236,7 @@ module.exports = { functions: ["hasComment", "getComments"], }, "src/language-js/pragma.js", - "src/language-js/parse/postprocess.js", + "src/language-js/parse/postprocess/*.js", "src/language-js/parse/babel.js", "src/language-js/parse/meriyah.js", "src/language-js/parse/json.js", diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9423d6060b16..17a8b818f478 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -5,6 +5,8 @@ # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt # Prettier bump after release +# 2.4.1 +2b5b22056e7e180ba52b04c849b6e8a1e26d87d1 # 2.4.0 ef514b9b5c817cf5105bac31a59e88cbdbdf189b # 2.3.2 diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 4d1086e84486..0e49a3b9a36c 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you: --> -**Prettier 2.4.0** +**Prettier 2.4.1** [Playground link](https://prettier.io/playground/#.....) ```sh diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index 392f0594aed7..ad20de82a127 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE: **Environments:** -- Prettier Version: 2.4.0 +- Prettier Version: 2.4.1 - Running Prettier via: - Runtime: - Operating System: diff --git a/.github/workflows/dev-package-test.yml b/.github/workflows/dev-package-test.yml index dd3b770f216b..0c194e1e752a 100644 --- a/.github/workflows/dev-package-test.yml +++ b/.github/workflows/dev-package-test.yml @@ -31,10 +31,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node }} cache: "yarn" diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 40bcb7e966d9..3622b4bfa5b8 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -18,13 +18,13 @@ jobs: - "macos-latest" - "windows-latest" node: - - "16" + - "16.10.0" - "14" - "12" include: # only enable coverage on the fastest job - os: "ubuntu-latest" - node: "16" + node: "16.10.0" ENABLE_CODE_COVERAGE: true FULL_TEST: true CHECK_TEST_PARSERS: true @@ -41,13 +41,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 # `codecov/codecov-action` require depth to be at least `2`, see #10219 with: fetch-depth: 2 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node }} cache: "yarn" @@ -64,7 +64,7 @@ jobs: run: yarn test --maxWorkers=2 - name: Upload Coverage - uses: codecov/codecov-action@v2.0.3 + uses: codecov/codecov-action@v2.1.0 if: ${{ matrix.ENABLE_CODE_COVERAGE }} with: fail_ci_if_error: true @@ -76,7 +76,7 @@ jobs: PRETTIER_FALLBACK_RESOLVE: true - name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE) - uses: codecov/codecov-action@v2.0.3 + uses: codecov/codecov-action@v2.1.0 if: ${{ matrix.ENABLE_CODE_COVERAGE }} with: fail_ci_if_error: true diff --git a/.github/workflows/eslint-rules.yml b/.github/workflows/eslint-rules.yml index 718ab4a71c0c..724f2b3a5611 100644 --- a/.github/workflows/eslint-rules.yml +++ b/.github/workflows/eslint-rules.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: cache: "yarn" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4dbd35a0e96f..5a7de9eba532 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: cache: "yarn" diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 6f8df0eff0a2..5207ea059c61 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -8,13 +8,13 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2 + - uses: dessant/lock-threads@v3 with: # https://github.com/dessant/lock-threads github-token: ${{ github.token }} - issue-lock-inactive-days: "90" - issue-exclude-created-before: "" - issue-exclude-labels: "keep-unlocked, status:awaiting response" - issue-lock-labels: "locked-due-to-inactivity" - issue-lock-comment: "" + issue-inactive-days: "90" + exclude-issue-created-before: "" + exclude-any-issue-labels: "keep-unlocked, status:awaiting response" + add-issue-labels: "locked-due-to-inactivity" + issue-comment: "" issue-lock-reason: "resolved" diff --git a/.github/workflows/mark-issue-duplicate.yml b/.github/workflows/mark-issue-duplicate.yml index 203a55c2d4b4..5247a0e5c520 100644 --- a/.github/workflows/mark-issue-duplicate.yml +++ b/.github/workflows/mark-issue-duplicate.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, 'Duplicate of ') }} steps: - - uses: actions-cool/issues-helper@v2.4.2 + - uses: actions-cool/issues-helper@v2.5.0 with: actions: "mark-duplicate" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/prod-test.yml b/.github/workflows/prod-test.yml index e7ee6d881add..6e8161c34165 100644 --- a/.github/workflows/prod-test.yml +++ b/.github/workflows/prod-test.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: cache: "yarn" @@ -59,10 +59,10 @@ jobs: needs: [build] steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: cache: "yarn" @@ -88,13 +88,13 @@ jobs: - "macos-latest" - "windows-latest" node: - - "16" + - "16.10.0" - "14" - "12" - "10" include: - os: "ubuntu-latest" - node: "16" + node: "16.10.0" FULL_TEST: true exclude: - os: "macos-latest" @@ -112,10 +112,10 @@ jobs: needs: [build] steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node }} cache: "yarn" diff --git a/.github/workflows/release-script-test.yml b/.github/workflows/release-script-test.yml index 52470aae7bc2..5fcdf8fabca8 100644 --- a/.github/workflows/release-script-test.yml +++ b/.github/workflows/release-script-test.yml @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2.4.0 - name: Setup Node.js - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: version: "14" cache: "yarn" diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fccfd16a41..f5dbcfdf437f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +# 2.4.1 + +[diff](https://github.com/prettier/prettier/compare/2.4.0...2.4.1) + +#### Fix wildcard syntax in `@forward` ([#11482](https://github.com/prettier/prettier/pull/11482)) ([#11487](https://github.com/prettier/prettier/pull/11487) by [@niksy](https://github.com/niksy)) + + +```scss +// Input +@forward "library" as btn-*; + +// Prettier 2.4.0 +@forward "library" as btn- *; + +// Prettier 2.4.1 +@forward "library" as btn-*; +``` + +#### Add new CLI option `debug-print-ast` ([#11514](https://github.com/prettier/prettier/pull/11514) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + +A new `--debug-print-ast` CLI flag for debugging. + # 2.4.0 [diff](https://github.com/prettier/prettier/compare/2.3.2...2.4.0) @@ -289,6 +311,7 @@ const foo = call<{ #### Fix order of `override` modifiers ([#10961](https://github.com/prettier/prettier/pull/10961) by [@sosukesuzuki](https://github.com/sosukesuzuki)) + ```ts // Input class Foo extends Bar { @@ -297,7 +320,7 @@ class Foo extends Bar { // Prettier stable class Foo extends Bar { - abstract override foo: string; + override abstract foo: string; } // Prettier main diff --git a/README.md b/README.md index 189df95a6982..14ced8d52a58 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ foo( ); ``` -Prettier can be run [in your editor](http://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again! +Prettier can be run [in your editor](https://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again! --- diff --git a/changelog_unreleased/cli/11514.md b/changelog_unreleased/cli/11514.md new file mode 100644 index 000000000000..cc6ed95ac4ab --- /dev/null +++ b/changelog_unreleased/cli/11514.md @@ -0,0 +1,3 @@ +#### Add new CLI option `debug-print-ast` (#11514 by @sosukesuzuki) + +A new `--debug-print-ast` CLI flag for debugging. diff --git a/changelog_unreleased/handlebars/11524.md b/changelog_unreleased/handlebars/11524.md new file mode 100644 index 000000000000..09d8fd6c4580 --- /dev/null +++ b/changelog_unreleased/handlebars/11524.md @@ -0,0 +1,14 @@ +#### Uses the opposite quote type for quotes inside mustache statements in attributes (#11524 by @bmaehr) + + +```hbs +{{!-- Input --}} +
+ +{{!-- Prettier main --}} +
+ +{{!-- Prettier stable --}} +
+ +``` diff --git a/changelog_unreleased/html/11827.md b/changelog_unreleased/html/11827.md new file mode 100644 index 000000000000..64380852e4c7 --- /dev/null +++ b/changelog_unreleased/html/11827.md @@ -0,0 +1 @@ +#### Reverts #7865, keeping class names on the same line (#11827 by @jlongster) diff --git a/changelog_unreleased/javascript/11593.md b/changelog_unreleased/javascript/11593.md new file mode 100644 index 000000000000..2369da27af14 --- /dev/null +++ b/changelog_unreleased/javascript/11593.md @@ -0,0 +1,15 @@ +#### Fix parentheses around sequence expression as body of arrow chain (#11593 by @bakkot) + +The required parentheses around sequence expressions as the body of arrow functions were dropped for chained arrows, causing incorrect code to be generated. Now they are included. + + +```jsx +// Input +const f = () => () => (0, 1); + +// Prettier stable +const f = () => () => 0, 1; + +// Prettier main +const f = () => () => (0, 1); +``` diff --git a/changelog_unreleased/javascript/11750.md b/changelog_unreleased/javascript/11750.md new file mode 100644 index 000000000000..e36df4ac284b --- /dev/null +++ b/changelog_unreleased/javascript/11750.md @@ -0,0 +1,18 @@ +#### Ignore errors for sloppy mode syntax (#11750 by @fisker, #11778 by @sosukesuzuki) + + +```jsx +// Input +function foo() { var bar = 1; delete bar; } + +// Prettier stable +SyntaxError: Deleting local variable in strict mode. (1:31) +> 1 | function foo() { var bar = 1; delete bar; } + | ^ + +// Prettier main +function foo() { + var bar = 1; + delete bar; +} +``` diff --git a/changelog_unreleased/javascript/11800.md b/changelog_unreleased/javascript/11800.md new file mode 100644 index 000000000000..8572920c855a --- /dev/null +++ b/changelog_unreleased/javascript/11800.md @@ -0,0 +1,22 @@ +#### Respect spacing for between expressions and parentheses in embedded CSS (#11800 by @sosukesuzuki) + + + + +```jsx +// Input +const paragraph2 = css` + transform: ${expr}(30px); +`; + +// Prettier stable +const paragraph2 = css` + transform: ${expr} (30px); +`; + +// Prettier main +const paragraph2 = css` + transform: ${expr}(30px); +`; + +``` diff --git a/changelog_unreleased/javascript/11835.md b/changelog_unreleased/javascript/11835.md new file mode 100644 index 000000000000..eb7e51eb7e72 --- /dev/null +++ b/changelog_unreleased/javascript/11835.md @@ -0,0 +1,29 @@ +#### Support ES2022 class-private-fields-in syntax in `espree` parser (#11835 by @fisker) + + +```jsx +// Input +class Foo { + #brand; + static isC(obj) { + return #brand in Foo; + } +} + +// Prettier stable +SyntaxError: Unexpected token #brand (4:12) + 2 | #brand; + 3 | static isC(obj) { +> 4 | return #brand in Foo; + | ^ + 5 | } + 6 | } + +// Prettier main +class Foo { + #brand; + static isC(obj) { + return #brand in Foo; + } +} +``` diff --git a/changelog_unreleased/markdown/11685.md b/changelog_unreleased/markdown/11685.md new file mode 100644 index 000000000000..be3d2301251d --- /dev/null +++ b/changelog_unreleased/markdown/11685.md @@ -0,0 +1,21 @@ +#### Keep trailing commas for type parameters in embedded TSX (#11685 by @sosukesuzuki) + + + + +````md + +```tsx +const test = (value: T) => {}; +``` + + +```tsx +const test = (value: T) => {}; +``` + + +```tsx +const test = (value: T) => {}; +``` +```` diff --git a/changelog_unreleased/mdx/11563.md b/changelog_unreleased/mdx/11563.md new file mode 100644 index 000000000000..71fc9684d007 --- /dev/null +++ b/changelog_unreleased/mdx/11563.md @@ -0,0 +1,23 @@ +#### Add support for MDX 2 comments (#11563 by @wooorm) + +This adds basic support for MDX 2 comments (JavaScript-style comments) in +addition to existing MDX 1 comments (HTML-style comments). + +Note that in MDX 2, more complex comments and whole expressions can be used +inside braces. +This currently only supports a single comment on one line so that +`{/* prettier-ignore */}` can be used, but doesn’t support most of MDX 2. + + +```mdx +Input: + +{/*A comment*/} + +Prettier stable: + +{/_A comment_/} + +Prettier main: +{/*A comment*/} +``` diff --git a/changelog_unreleased/scss/11487.md b/changelog_unreleased/scss/11487.md new file mode 100644 index 000000000000..f562cf488cc5 --- /dev/null +++ b/changelog_unreleased/scss/11487.md @@ -0,0 +1,13 @@ +#### Fix wildcard syntax in `@forward` (#11482) (#11487 by @niksy) + + +```scss +// Input +@forward "library" as btn-*; + +// Prettier stable +@forward "library" as btn- *; + +// Prettier main +@forward "library" as btn-*; +``` diff --git a/changelog_unreleased/scss/11637.md b/changelog_unreleased/scss/11637.md new file mode 100644 index 000000000000..424a5534787b --- /dev/null +++ b/changelog_unreleased/scss/11637.md @@ -0,0 +1,21 @@ +#### Improve `with (...)` formatting (#11637 by @sosukesuzuki) + + +```scss +// Input +@use 'library' with ( + $black: #222, + $border-radius: 0.1rem $font-family: 'Helvetica, sans-serif' +); + +// Prettier stable +@use 'library' with + ($black: #222, $border-radius: 0.1rem $font-family: 'Helvetica, sans-serif'); + +// Prettier main +@use 'library' with ( + $black: #222, + $border-radius: 0.1rem $font-family: 'Helvetica, sans-serif' +); + +``` diff --git a/changelog_unreleased/scss/11683.md b/changelog_unreleased/scss/11683.md new file mode 100644 index 000000000000..1c2bf1643418 --- /dev/null +++ b/changelog_unreleased/scss/11683.md @@ -0,0 +1,16 @@ +#### Fix `@forward with` formatting error (#11683 by @sriramarul, @sosukesuzuki) + + +```scss +// Input +@forward 'foo.scss' with ($components: red); + +// Prettier stable +TypeError: Cannot read properties of undefined (reading 'type') + +// Prettier main +@forward "foo.scss" with ( + $components: red +); + +``` diff --git a/changelog_unreleased/typescript/11515.md b/changelog_unreleased/typescript/11515.md new file mode 100644 index 000000000000..50edcb0967c5 --- /dev/null +++ b/changelog_unreleased/typescript/11515.md @@ -0,0 +1,36 @@ +#### Avoid extra offset in arrow function body when using long types (#11515 by @kachkaev and @thorn0) + +Starting with Prettier 2.3.0, type declarations in arrow functions could affect function body offset. Changing the length of the type annotation could produce large diffs and thus increased the chance of git conflicts. To prevent this, function body offset was stabilized. + + +```tsx +// Input +const MyComponentWithLongName: React.VoidFunctionComponent = ({ x, y }) => { + const a = useA(); + return
{x + y + a}
; +}; + +// Prettier 2.2 and below +const MyComponentWithLongName: React.VoidFunctionComponent = ({ + x, + y, +}) => { + const a = useA(); + return
{x + y + a}
; +}; + +// Prettier stable +const MyComponentWithLongName: React.VoidFunctionComponent = + ({ x, y }) => { + const a = useA(); + return
{x + y + a}
; + }; + +// Prettier main +const MyComponentWithLongName: React.VoidFunctionComponent< + MyComponentWithLongNameProps +> = ({ x, y }) => { + const a = useA(); + return
{x + y + a}
; +}; +``` diff --git a/changelog_unreleased/typescript/11717.md b/changelog_unreleased/typescript/11717.md new file mode 100644 index 000000000000..e45402b58fe0 --- /dev/null +++ b/changelog_unreleased/typescript/11717.md @@ -0,0 +1,31 @@ +#### Remove unnecessary parentheses for decorators (#11717, #11849 by @sosukesuzuki) + + +```tsx +// Input +class Test { + @foo`bar` + test1: string = "test" + + @test().x("global").y() + test2: string = "test"; +} + +// Prettier stable +class Test { + @(foo`bar`) + test: string = "test" + + @(test().x("global").y()) + test2: string = "test"; +} + +// Prettier main +class Test { + @foo`bar` + test: string = "test" + + @test().x("global").y() + test2: string = "test"; +} +``` diff --git a/changelog_unreleased/typescript/11721.md b/changelog_unreleased/typescript/11721.md new file mode 100644 index 000000000000..5159197bbcb0 --- /dev/null +++ b/changelog_unreleased/typescript/11721.md @@ -0,0 +1,72 @@ +#### Support TypeScript 4.5 (#11721, #11723, #11813 by @sosukesuzuki) + +Support new TypeScript 4.5 features. + +##### [`type` Modifiers on Import Names](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#type-on-import-names) + + +```ts +// Input +import { type A } from "mod"; + +// Prettier stable +SyntaxError: ',' expected. (1:15) + +// Prettier main +import { type A } from "mod"; + +``` + +##### [Private Field Presence Checks](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-rc/#private-field-presence-checks) + + +```ts +// Input +class Foo { + #prop1; + method() { + return #prop1 in this; + } +} + +// Prettier stable +SyntaxError: Private identifiers are not allowed outside class bodies. (4:12) + 2 | #prop1; + 3 | method() { +> 4 | return #prop1 in this; + | ^ + 5 | } + 6 | } + 7 | + +// Prettier main +class Foo { + #prop1; + method() { + return #prop1 in this; + } +} + +``` + +##### [Import Assertions](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-rc/#import-assertions) + + +```ts +// Input +import obj from "./something.json" assert { type: "json" }; + +// Prettier stable +SyntaxError: ';' expected. (1:36) +> 1 | import obj from "./something.json" assert { type: "json" }; + | ^ + 2 | + +// Prettier main +import obj from "./something.json" assert { type: "json" }; + +``` + +##### Handle `.mts` and `.cts` + +Handle new file extensions `.mts` and `.cts`. diff --git a/docs/browser.md b/docs/browser.md index 8c650329ec52..0a741f408e28 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -32,8 +32,8 @@ See below for examples. ### Global ```html - - + + - + +