Merge branch 'main' into next

# Conflicts:
#	.github/renovate.json5
#	.github/workflows/lint.yml
#	package.json
#	src/cli/format.js
#	src/language-js/print/type-annotation.js
#	src/language-js/print/typescript.js
#	src/language-js/utils/index.js
#	tests/format/typescript/enum/jsfmt.spec.js
#	tests/format/vue/with-plugins/jsfmt.spec.js
#	website/yarn.lock
#	yarn.lock
This commit is contained in:
fisker Cheung committed 2022-05-28 11:19:03 +08:00
commit 9569ab12aa
63 files changed
+1727 -169

No files matched your search

+19 -4
View File
@@ -1,17 +1,32 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
labels: ["scope:dependency"],
labels: ["dependency"],
baseBranches: ["next"],
// schedule: ["at 01:00 on sunday"],
schedule: ["after 01:00 on sunday"],
postUpdateOptions: ["yarnDedupeHighest"],
packageRules: [
{
matchPackageNames: ["react", "react-dom"],
groupName: "react",
},
{
matchPackagePrefixes: ["@babel/"],
excludePackageNames: ["@babel/parser"],
groupName: "babel",
},
{
branchPrefix: "renovate/website/",
matchPaths: ["website/package.json"],
labels: ["dependency:website"],
},
{
branchPrefix: "renovate/tools/",
matchPaths: [
"package.json",
"website/package.json",
"scripts/release/package.json",
"scripts/tools/bundle-test/package.json",
"scripts/tools/eslint-plugin-prettier-internal-rules/package.json",
],
labels: ["dependency:tools"],
},
],
}
+3
View File
@@ -45,6 +45,9 @@ jobs:
- name: Lint workflow files
run: yarn lint:actionlint
- name: Validate renovate config
run: npx --package renovate -c renovate-config-validator
- name: Run yarn (/)
run: |
yarn
+25
View File
@@ -0,0 +1,25 @@
# https://gitpod.io/#https://github.com/prettier/prettier
tasks:
- init: |
yarn
yarn build
github:
# https://www.gitpod.io/docs/prebuilds/#configure-prebuilds
prebuilds:
master: true # enable for the default branch (even if it's not named "master")
branches: true
pullRequests: true
pullRequestsFromForks: true
addCheck: true
addComment: false
addBadge: true
addLabel: false
vscode:
extensions:
- esbenp.prettier-vscode
- dbaeumer.vscode-eslint
- editorconfig.editorconfig
- streetsidesoftware.code-spell-checker
+5 -9
View File
@@ -78,24 +78,20 @@ If you want to know more about Prettier's GitHub labels, see the [Issue Labels](
If you're contributing a performance improvement, the following Prettier CLI options can help:
- `--debug-repeat N` uses a naïve loop to repeat the formatting `N` times and measures the average run duration. It can be useful to highlight hot functions in the profiler. The measurements are printed at the debug log level, use `--loglevel debug` to see them.
- `--debug-benchmark` uses [`benchmark`](https://npm.im/benchmark) module to produce statistically significant duration measurements. The measurements are printed at the debug log level, use `--loglevel debug` to see them.
- `--debug-repeat N` uses a naïve loop to repeat the formatting `N` times and measures the average run duration. It can be useful to highlight hot functions in the profiler. This can also set by environment variable `PRETTIER_PERF_REPEAT`.
- `--debug-benchmark` uses [`benchmark`](https://npm.im/benchmark) module to produce statistically significant duration measurements.
For convenience, the following commands for profiling are available via `package.json` `scripts`.
_Unfortunately, [`yarn` simply appends passed arguments to commands, cannot reference them by name](https://github.com/yarnpkg/yarn/issues/5207), so we have to use inline environment variables to pass them._
- `PERF_FILE=<filename> PERF_REPEAT=[number-of-repetitions:1000] yarn perf:repeat` starts the naïve loop. See the CLI output for when the measurements finish, and stop profiling at that moment.
- `PERF_FILE=<filename> PERF_REPEAT=[number-of-repetitions:1000] yarn perf:repeat-inspect` starts the naïve loop with `node --inspect-brk` flag that pauses execution and waits for Chromium/Chrome/Node Inspector to attach. Open [`chrome://inspect`](chrome://inspect), select the process to inspect, and activate the CPU Profiler, this will unpause execution. See the CLI output for when the measurements finish, and stop the CPU Profiler at that moment to avoid collecting more data than needed.
- `PERF_FILE=<filename> yarn perf:benchmark` starts the `benchmark`-powered measurements. See the CLI output for when the measurements finish.
- `PRETTIER_PERF_REPEAT=1000 yarn perf <filename>` starts the naïve loop. See the CLI output for when the measurements finish, and stop profiling at that moment.
- `PRETTIER_PERF_REPEAT=1000 yarn perf:inspect <filename>` starts the naïve loop with `node --inspect-brk` flag that pauses execution and waits for Chromium/Chrome/Node Inspector to attach. Open [`chrome://inspect`](chrome://inspect), select the process to inspect, and activate the CPU Profiler, this will unpause execution. See the CLI output for when the measurements finish, and stop the CPU Profiler at that moment to avoid collecting more data than needed.
- `yarn perf:benchmark <filename>` starts the `benchmark`-powered measurements. See the CLI output for when the measurements finish.
In the above commands:
- `yarn && yarn build` ensures the compiler-optimized version of Prettier is built prior to launching it. Prettier's own environment checks are defaulted to production and removed during the build. The build output is cached, so a rebuild will happen only if the source code changes.
- `NODE_ENV=production` ensures Prettier and its dependencies run in production mode.
- `node --inspect-brk` pauses the script execution until Inspector is connected to the Node process.
- `--loglevel debug` ensures the `--debug-repeat` or `--debug-benchmark` measurements are printed to `stderr`.
- `> /dev/null` ensures the formatted output is discarded.
In addition to the options above, you can use [`node --prof` and `node --prof-process`](https://nodejs.org/en/docs/guides/simple-profiling/), as well as `node --trace-opt --trace-deopt`, to get more advanced performance insights.
-2
View File
@@ -54,8 +54,6 @@
<img alt="weekly downloads from npm" src="https://img.shields.io/npm/dw/prettier.svg?style=flat-square"></a>
<a href="#badge">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
<a href="https://gitter.im/jlongster/prettier">
<img alt="Chat on Gitter" src="https://img.shields.io/gitter/room/jlongster/prettier.svg?style=flat-square"></a>
<a href="https://twitter.com/PrettierCode">
<img alt="Follow Prettier on Twitter" src="https://img.shields.io/twitter/follow/prettiercode.svg?label=follow+prettier&style=flat-square"></a>
</p>
+5 -2
View File
@@ -1,3 +1,6 @@
#### Skip print code or write file when performance flags found (#12682 by @fisker)
#### Simplify performance test (#12682, #12698 by @fisker)
When `--debug-benchmark` or `--debug-repeat` is used, the CLI will skip print the formatted code to the screen or write files.
When `--debug-benchmark` or `--debug-repeat` is passed:
1. The CLI skips print code to the screen or write file
1. Set log level to `debug` automatically
+32
View File
@@ -0,0 +1,32 @@
#### Support Speculation Rules API formatting in HTML (#12882 by @sosukesuzuki)
Please read https://web.dev/speculative-prerendering/ for about Speculation Rules API.
<!-- prettier-ignore -->
```html
<!-- Input -->
<script type="speculationrules">
{
"prerender": [
{"source": "list", "urls": ["https://a.test/foo"]}
]
}
</script>
<!-- Prettier stable -->
<script type="speculationrules">
{
"prerender": [
{"source": "list", "urls": ["https://a.test/foo"]}
]
}
</script>
<!-- Prettier main -->
<script type="speculationrules">
{
"prerender": [{ "source": "list", "urls": ["https://a.test/foo"] }]
}
</script>
```
+77
View File
@@ -0,0 +1,77 @@
#### Make more callee patterns recognized as "test call callee". (#12779 by @HosokawaR)
Supports test calls like [Playwright `test.describe`](https://playwright.dev/docs/api/class-test#test-describe).
<!-- prettier-ignore -->
```jsx
// Input
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial.only("does something really long and complicated so I have to write a very long name for the test", () => {});
// Prettier stable
test.step(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.only(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.parallel(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.parallel.only(
"does something really long and complicated so I have to write a very long name for the testThis is a very",
() => {}
);
test.describe.serial(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.serial.only(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
// Prettier main
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel
.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe
.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
```
+49
View File
@@ -0,0 +1,49 @@
#### Fix comment formats in (#12860 by @HosokawaR)
This change fixes comments format in `exports` to algin with the comment format in `import`
Although this change does not affect the comments format in `import`, follows change log contains examples of comments in `import` for reference.
<!-- prettier-ignore -->
```jsx
// Input
export {
foo,
bar as // comment
baz,
}
import {
foo,
bar as // comment
baz,
} from 'foo'
// Prettier stable
export {
foo,
bar as baz, // comment
};
import {
foo,
// comment
bar as baz,
} from "foo";
// Prettier main
export {
foo,
// comment
bar as baz,
};
import {
foo,
// comment
bar as baz,
} from "foo";
```
+37
View File
@@ -0,0 +1,37 @@
#### [HIGHLIGHT]Support TypeScript 4.7 (#12896, #12897, #12898, #12900, #12921, #12924 by @sosukesuzuki)
Support [TypeScript 4.7](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7) new features!
##### [Instantiation Expressions](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#instantiation-expressions)
```ts
interface Box<T> {
value: T;
}
function makeBox<T>(value: T) {
return { value };
}
const makeHammerBox = makeBox<Hammer>;
const makeWrenchBox = makeBox<Wrench>;
```
##### [Optional Variance](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#optional-variance-annotations-for-type-parameters)
```ts
interface Animal {
animalStuff: any;
}
interface Dog extends Animal {
dogStuff: any;
}
type Getter<out T> = () => T;
type Setter<in T> = (value: T) => void;
```
##### [`extends` constraints for `infer`](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#extends-constraints-on-infer-type-variables)
```ts
type FirstString<T> = T extends [infer extends string, ...unknown[]]
? S
: never;
```
+19
View File
@@ -0,0 +1,19 @@
#### fix formatting for typescript Enum with computed members (#12930 by @HosokawaR)
<!-- prettier-ignore -->
```tsx
// Input
enum A {
[i++],
}
// Prettier stable
enum A {
i++,
}
// Prettier main
enum A {
[i++],
}
```
+3
View File
@@ -0,0 +1,3 @@
#### Infer Stylus parser for Vue SFC style block (#12707 by @lsdsjy)
`<style lang="stylus">` blocks in Vue SFCs can be processed by the appropriate plugin if any.
+9
View File
@@ -66,6 +66,7 @@
"danez",
"Dara",
"dashify",
"dbaeumer",
"decf",
"declarators",
"defun",
@@ -94,6 +95,7 @@
"eqeqeq",
"Ericsburgh",
"Esben",
"esbenp",
"esbuild",
"eslintignore",
"eslump",
@@ -103,6 +105,7 @@
"esutils",
"execa",
"fbglyph",
"fdescribe",
"Ficarra",
"Filipe",
"Fiorini",
@@ -111,6 +114,7 @@
"formatprg",
"Friedly",
"frobble",
"ftest",
"fuzzer",
"Georgii",
"gettin",
@@ -119,6 +123,7 @@
"glimmerjs",
"globbing",
"globby",
"glsl",
"gofmt",
"Gregor",
"Hampus",
@@ -250,6 +255,7 @@
"postprocess",
"postprocessor",
"preactjs",
"prebuilds",
"precache",
"precommit",
"prefetch",
@@ -301,6 +307,7 @@
"softlines",
"Sorin",
"Sosuke",
"speculationrules",
"srcset",
"Stachowiak",
"standalones",
@@ -360,6 +367,8 @@
"Weixin",
"whitespaces",
"wxss",
"xdescribe",
"xtest",
"yamafaktory",
"Yatharth",
"Zatorski",
+33 -5
View File
@@ -176,9 +176,37 @@ If you’d like a JSON schema to validate your configuration, one is available h
## EditorConfig
If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc. Currently, the following EditorConfig properties are supported:
If `options.editorconfig` is `true` and an [`.editorconfig` file](https://editorconfig.org/) is in your project, Prettier will parse it and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by `.prettierrc`, etc.
- `end_of_line`
- `indent_style`
- `indent_size`/`tab_width`
- `max_line_length`
Here’s an annotated description of how different properties map to Prettier’s behavior:
```ini
# Stop the editor from looking for .editorconfig files in the parent directories
# root = true
[*]
# Non-configurable Prettier behaviors
charset = utf-8
insert_final_newline = true
# Caveat: Prettier won’t trim trailing whitespace inside template strings, but your editor might.
# trim_trailing_whitespace = true
# Configurable Prettier behaviors
# (change these if your Prettier config differs)
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
```
Here’s a copy+paste-ready `.editorconfig` file if you use the default options:
```ini
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
```
+1
View File
@@ -60,6 +60,7 @@ To turn off plugin autoloading, use `--no-plugin-search` when using Prettier CLI
- [`prettier-plugin-apex`](https://github.com/dangmai/prettier-plugin-apex) by [**@dangmai**](https://github.com/dangmai)
- [`prettier-plugin-elm`](https://github.com/gicentre/prettier-plugin-elm) by [**@giCentre**](https://github.com/gicentre)
- [`prettier-plugin-erb`](https://github.com/adamzapasnik/prettier-plugin-erb) by [**@adamzapasnik**](https://github.com/adamzapasnik)
- [`prettier-plugin-glsl`](https://github.com/NaridaL/glsl-language-toolkit/tree/main/packages/prettier-plugin-glsl) by [**@NaridaL**](https://github.com/NaridaL)
- [`prettier-plugin-go-template`](https://github.com/NiklasPor/prettier-plugin-go-template) by [**@NiklasPor**](https://github.com/NiklasPor)
- [`prettier-plugin-java`](https://github.com/jhipster/prettier-java) by [**@JHipster**](https://github.com/jhipster)
- [`prettier-plugin-jsonata`](https://github.com/Stedi/prettier-plugin-jsonata) by [**@Stedi**](https://github.com/Stedi)
+6 -6
View File
@@ -24,10 +24,10 @@
"dependencies": {
"@angular/compiler": "12.2.16",
"@babel/code-frame": "7.16.7",
"@babel/parser": "7.17.10",
"@babel/parser": "7.18.0",
"@glimmer/syntax": "0.84.2",
"@iarna/toml": "2.2.5",
"@typescript-eslint/typescript-estree": "5.23.0",
"@typescript-eslint/typescript-estree": "5.26.0",
"acorn": "8.7.1",
"acorn-jsx": "5.3.2",
"angular-estree-parser": "2.5.0",
@@ -83,7 +83,7 @@
"semver": "7.3.7",
"string-width": "5.0.1",
"strip-ansi": "7.0.1",
"typescript": "4.6.4",
"typescript": "4.7.2",
"unicode-regex": "3.0.0",
"unified": "9.2.2",
"vnopts": "1.0.2",
@@ -142,9 +142,9 @@
"test:dist": "cross-env NODE_ENV=production yarn test",
"test:dist-standalone": "cross-env TEST_STANDALONE=1 yarn test:dist",
"test:dist-lint": "eslint --no-eslintrc --no-ignore --no-inline-config --config=./scripts/bundle-eslint-config.cjs \"dist/**/*.{js,mjs}\"",
"perf:repeat": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} ${PERF_FILE:-./index.js} > /dev/null",
"perf:repeat-inspect": "yarn && yarn build && cross-env NODE_ENV=production node --inspect-brk ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} ${PERF_FILE:-./index.js} > /dev/null",
"perf:benchmark": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-benchmark ${PERF_FILE:-./index.js} > /dev/null",
"perf": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js",
"perf:inspect": "yarn && yarn build && cross-env NODE_ENV=production node --inspect-brk ./dist/bin-prettier.js",
"perf:benchmark": "yarn perf --debug-benchmark",
"lint": "run-p lint:*",
"lint:typecheck": "tsc",
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
+37 -36
View File
@@ -67,57 +67,58 @@ const categoryOrder = [
*
* Note: The options below are sorted alphabetically.
*/
/* eslint sort-keys: "error" */
const options = {
check: {
type: "boolean",
category: coreOptions.CATEGORY_OUTPUT,
alias: "c",
category: coreOptions.CATEGORY_OUTPUT,
description: outdent`
Check if the given files are formatted, print a human-friendly summary
message and paths to unformatted files (see also --list-different).
`,
type: "boolean",
},
color: {
// The supports-color package (a sub sub dependency) looks directly at
// `process.argv` for `--no-color` and such-like options. The reason it is
// listed here is to avoid "Ignored unknown option: --no-color" warnings.
// See https://github.com/chalk/supports-color/#info for more information.
type: "boolean",
default: true,
description: "Colorize error messages.",
oppositeDescription: "Do not colorize error messages.",
type: "boolean",
},
config: {
type: "path",
category: coreOptions.CATEGORY_CONFIG,
description:
"Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
oppositeDescription: "Do not look for a configuration file.",
exception: (value) => value === false,
oppositeDescription: "Do not look for a configuration file.",
type: "path",
},
"config-precedence": {
type: "choice",
category: coreOptions.CATEGORY_CONFIG,
default: "cli-override",
choices: [
{
value: "cli-override",
description: "CLI options take precedence over config file",
value: "cli-override",
},
{
value: "file-override",
description: "Config file take precedence over CLI options",
value: "file-override",
},
{
value: "prefer-file",
description: outdent`
If a config file is found will evaluate it and ignore other CLI options.
If no config file is found CLI options will evaluate as normal.
`,
value: "prefer-file",
},
],
default: "cli-override",
description:
"Define in which order config files and CLI options should be evaluated.",
type: "choice",
},
"debug-benchmark": {
// Run the formatting benchmarks. Requires 'benchmark' module to be installed.
@@ -127,102 +128,102 @@ const options = {
// Run the formatting once again on the formatted output, throw if different.
type: "boolean",
},
"debug-print-doc": {
"debug-print-ast": {
type: "boolean",
},
"debug-print-comments": {
type: "boolean",
},
"debug-print-ast": {
"debug-print-doc": {
type: "boolean",
},
"debug-repeat": {
// Repeat the formatting a few times and measure the average duration.
type: "int",
default: 0,
type: "int",
},
editorconfig: {
type: "boolean",
category: coreOptions.CATEGORY_CONFIG,
default: true,
description: "Take .editorconfig into account when parsing configuration.",
oppositeDescription:
"Don't take .editorconfig into account when parsing configuration.",
default: true,
type: "boolean",
},
"error-on-unmatched-pattern": {
type: "boolean",
oppositeDescription: "Prevent errors when pattern is unmatched.",
},
"find-config-path": {
type: "path",
category: coreOptions.CATEGORY_CONFIG,
description:
"Find and print the path to a configuration file for the given input file.",
type: "boolean",
},
"file-info": {
type: "path",
description: outdent`
Extract the following info (as JSON) for a given file path. Reported fields:
* ignored (boolean) - true if file path is filtered by --ignore-path
* inferredParser (string | null) - name of parser inferred from file path
`,
type: "path",
},
"find-config-path": {
category: coreOptions.CATEGORY_CONFIG,
description:
"Find and print the path to a configuration file for the given input file.",
type: "path",
},
help: {
type: "flag",
alias: "h",
description: outdent`
Show CLI usage, or details about the given flag.
Example: --help write
`,
exception: (value) => value === "",
type: "flag",
},
"ignore-path": {
type: "path",
category: coreOptions.CATEGORY_CONFIG,
default: ".prettierignore",
description: "Path to a file with patterns describing files to ignore.",
type: "path",
},
"ignore-unknown": {
type: "boolean",
alias: "u",
description: "Ignore unknown files.",
type: "boolean",
},
"list-different": {
type: "boolean",
category: coreOptions.CATEGORY_OUTPUT,
alias: "l",
category: coreOptions.CATEGORY_OUTPUT,
description:
"Print the names of files that are different from Prettier's formatting (see also --check).",
type: "boolean",
},
loglevel: {
type: "choice",
description: "What level of logs to report.",
default: "log",
choices: ["silent", "error", "warn", "log", "debug"],
default: "log",
description: "What level of logs to report.",
type: "choice",
},
"plugin-search": {
type: "boolean",
oppositeDescription: "Disable plugin autoloading.",
type: "boolean",
},
"support-info": {
type: "boolean",
description: "Print support information as JSON.",
type: "boolean",
},
version: {
type: "boolean",
alias: "v",
description: "Print Prettier version.",
type: "boolean",
},
"with-node-modules": {
type: "boolean",
category: coreOptions.CATEGORY_CONFIG,
description: "Process files inside 'node_modules' directory.",
type: "boolean",
},
write: {
type: "boolean",
alias: "w",
category: coreOptions.CATEGORY_OUTPUT,
description: "Edit files in-place. (Beware!)",
type: "boolean",
},
};
+8
View File
@@ -74,6 +74,14 @@ class Context {
debugRepeat,
};
}
const { PRETTIER_PERF_REPEAT } = process.env;
if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
return {
name: "PRETTIER_PERF_REPEAT (environment variable)",
debugRepeat: Number(PRETTIER_PERF_REPEAT),
};
}
}
}
+5 -5
View File
@@ -165,8 +165,8 @@ async function format(context, input, opt) {
return { formatted: pp, filepath: opt.filepath || "(stdin)\n" };
}
/* istanbul ignore next */
if (context.argv.debugBenchmark) {
const { performanceTestFlag } = context;
if (performanceTestFlag?.debugBenchmark) {
let benchmark;
try {
// eslint-disable-next-line import/no-extraneous-dependencies
@@ -203,7 +203,7 @@ async function format(context, input, opt) {
"'--debug-benchmark' measurements for formatWithCursor: " +
JSON.stringify(result, null, 2)
);
} else if (context.argv.debugRepeat > 0) {
} else if (performanceTestFlag?.debugRepeat) {
const repeat = context.argv.debugRepeat;
context.logger.debug(
"'--debug-repeat' option found, running formatWithCursor " +
@@ -295,8 +295,9 @@ async function formatFiles(context) {
const ignorer = await createIgnorerFromContextOrDie(context);
let numberOfUnformattedFilesFound = 0;
const { performanceTestFlag } = context;
if (context.argv.check && !context.performanceTestFlag) {
if (context.argv.check && !performanceTestFlag) {
context.logger.log("Checking formatting...");
}
@@ -385,7 +386,6 @@ async function formatFiles(context) {
printedFilename.clear();
}
const { performanceTestFlag } = context;
if (performanceTestFlag) {
context.logger.log(
`'${performanceTestFlag.name}' option found, skipped print code or write files.`
+1 -1
View File
@@ -287,7 +287,7 @@ function embed(path, print, textToDoc, options) {
}
case "text": {
if (isScriptLikeTag(node.parent)) {
const parser = inferScriptParser(node.parent);
const parser = inferScriptParser(node.parent, options);
if (parser) {
const value =
parser === "markdown"
+13 -3
View File
@@ -357,7 +357,10 @@ function _inferScriptParser(node) {
return "html";
}
if (type && (type.endsWith("json") || type.endsWith("importmap"))) {
if (
(type && (type.endsWith("json") || type.endsWith("importmap"))) ||
type === "speculationrules"
) {
return "json";
}
@@ -366,7 +369,7 @@ function _inferScriptParser(node) {
}
}
function inferStyleParser(node) {
function inferStyleParser(node, options) {
const { lang } = node.attrMap;
if (!lang || lang === "postcss" || lang === "css") {
return "css";
@@ -379,6 +382,13 @@ function inferStyleParser(node) {
if (lang === "less") {
return "less";
}
// Prettier does not officially support stylus.
// But, we need to handle `"stylus"` here for printing a style block in Vue SFC as stylus code by external plugin.
// https://github.com/prettier/prettier/pull/12707
if (lang === "stylus") {
return inferParserByLanguage("stylus", options);
}
}
function inferScriptParser(node, options) {
@@ -390,7 +400,7 @@ function inferScriptParser(node, options) {
}
if (node.name === "style") {
return inferStyleParser(node);
return inferStyleParser(node, options);
}
if (options && isVueNonHtmlBlock(node, options)) {
+9 -10
View File
@@ -59,7 +59,6 @@ function handleOwnLineComment(context) {
handleWhileComments,
handleTryStatementComments,
handleClassComments,
handleImportSpecifierComments,
handleForComments,
handleUnionTypeComments,
handleOnlyComments,
@@ -80,7 +79,7 @@ function handleEndOfLineComment(context) {
handleClosureTypeCastComments,
handleLastFunctionArgComments,
handleConditionalExpressionComments,
handleImportSpecifierComments,
handleModuleSpecifiersComments,
handleIfStatementComments,
handleWhileComments,
handleTryStatementComments,
@@ -621,14 +620,6 @@ function handleLastFunctionArgComments({
return false;
}
function handleImportSpecifierComments({ comment, enclosingNode }) {
if (enclosingNode?.type === "ImportSpecifier") {
addLeadingComment(enclosingNode, comment);
return true;
}
return false;
}
function handleLabeledStatementComments({ comment, enclosingNode }) {
if (enclosingNode?.type === "LabeledStatement") {
addLeadingComment(enclosingNode, comment);
@@ -766,6 +757,14 @@ function handleModuleSpecifiersComments({
enclosingNode,
text,
}) {
if (
enclosingNode?.type === "ImportSpecifier" ||
enclosingNode?.type === "ExportSpecifier"
) {
addLeadingComment(enclosingNode, comment);
return true;
}
const isImportDeclaration =
precedingNode?.type === "ImportSpecifier" &&
enclosingNode?.type === "ImportDeclaration";
@@ -39,7 +39,7 @@ function throwErrorForInvalidDecorator(
// Values of abstract property is removed since `@typescript-eslint/typescript-estree` v5
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0
function throwErrorForInvalidAbstractProperty(tsNode, esTreeNode) {
const SYNTAX_KIND_PROPERTY_DEFINITION = 166;
const SYNTAX_KIND_PROPERTY_DEFINITION = 167;
const SYNTAX_KIND_ABSTRACT_KEYWORD = 126;
if (
tsNode.kind !== SYNTAX_KIND_PROPERTY_DEFINITION ||
+11
View File
@@ -312,6 +312,16 @@ function printIndexedAccessType(path, options, print) {
return [print("objectType"), leftDelimiter, print("indexType"), "]"];
}
// `TSJSDocNullableType`, `TSJSDocNonNullableType`
function printJSDocType(path, print, token) {
const node = path.getValue();
return [
node.postfix ? "" : token,
print("typeAnnotation"),
node.postfix ? token : "",
];
}
export {
printOpaqueType,
printTypeAlias,
@@ -321,4 +331,5 @@ export {
printTupleType,
printIndexedAccessType,
shouldHugType,
printJSDocType,
};
+8
View File
@@ -131,6 +131,14 @@ function printTypeParameter(path, options, print) {
parts.push(print("variance"));
}
if (node.in) {
parts.push("in ");
}
if (node.out) {
parts.push("out ");
}
parts.push(print("name"));
if (node.bound) {
+12 -4
View File
@@ -42,6 +42,7 @@ import {
printFunctionType,
printTupleType,
printIndexedAccessType,
printJSDocType,
} from "./type-annotation.js";
function printTypescript(path, options, print) {
@@ -195,7 +196,7 @@ function printTypescript(path, options, print) {
return parts;
case "TSTypeQuery":
return ["typeof ", print("exprName")];
return ["typeof ", print("exprName"), print("typeParameters")];
case "TSIndexSignature": {
const parent = path.getParentNode();
@@ -406,7 +407,12 @@ function printTypescript(path, options, print) {
return parts;
case "TSEnumMember":
parts.push(print("id"));
if (node.computed) {
parts.push("[", print("id"), "]");
} else {
parts.push(print("id"));
}
if (node.initializer) {
parts.push(" = ", print("initializer"));
}
@@ -510,9 +516,11 @@ function printTypescript(path, options, print) {
case "TSJSDocUnknownType":
return "?";
case "TSJSDocNullableType":
return ["?", print("typeAnnotation")];
return printJSDocType(path, print, /* token */ "?");
case "TSJSDocNonNullableType":
return ["!", print("typeAnnotation")];
return printJSDocType(path, print, /* token */ "!");
case "TSInstantiationExpression":
return [print("expression"), print("typeParameters")];
default:
/* istanbul ignore next */
throw new Error(
+33 -21
View File
@@ -9,6 +9,7 @@ import {
} from "../../common/util.js";
import { locStart, locEnd, hasSameLocStart } from "../loc.js";
import isBlockComment from "./is-block-comment.js";
import isNodeMatches from "./is-node-matches.js";
const isIdentifierName = esutils.keyword.isIdentifierNameES5;
@@ -445,23 +446,6 @@ function isSimpleType(node) {
return false;
}
const unitTestRe = /^(?:skip|[fx]?(?:it|describe|test))$/;
/**
* @param {{callee: MemberExpression | OptionalMemberExpression}} node
* @returns {boolean}
*/
function isSkipOrOnlyBlock(node) {
return (
isMemberExpression(node.callee) &&
node.callee.object.type === "Identifier" &&
node.callee.property.type === "Identifier" &&
unitTestRe.test(node.callee.object.name) &&
(node.callee.property.name === "only" ||
node.callee.property.name === "skip")
);
}
/**
* @param {CallExpression} node
* @returns {boolean}
@@ -475,6 +459,36 @@ function isUnitTestSetUp(node) {
);
}
const testCallCalleePatterns = [
"it",
"it.only",
"it.skip",
"describe",
"describe.only",
"describe.skip",
"test",
"test.only",
"test.skip",
"test.step",
"test.describe",
"test.describe.only",
"test.describe.parallel",
"test.describe.parallel.only",
"test.describe.serial",
"test.describe.serial.only",
"skip",
"xit",
"xdescribe",
"xtest",
"fit",
"fdescribe",
"ftest",
];
function isTestCallCallee(node) {
return isNodeMatches(node, testCallCalleePatterns);
}
// eg; `describe("some string", (done) => {})`
function isTestCall(node, parent) {
if (node.type !== "CallExpression") {
@@ -490,11 +504,9 @@ function isTestCall(node, parent) {
}
} else if (node.arguments.length === 2 || node.arguments.length === 3) {
if (
((node.callee.type === "Identifier" &&
unitTestRe.test(node.callee.name)) ||
isSkipOrOnlyBlock(node)) &&
(node.arguments[0].type === "TemplateLiteral" ||
isStringLiteral(node.arguments[0]))
isStringLiteral(node.arguments[0])) &&
isTestCallCallee(node.callee)
) {
// it("name", () => { ... }, 2500)
if (node.arguments[2] && !isNumericLiteral(node.arguments[2])) {
+52
View File
@@ -0,0 +1,52 @@
"use strict";
// Copied from https://github.com/sindresorhus/eslint-plugin-unicorn/blob/d53d935951aa815c763fc9441aa452c763294715/rules/utils/is-node-matches.js
/**
* @typedef {import("../types/estree").Node} Node
*/
/**
Check if node matches object name or key path.
@param {Node} node - The AST node to check.
@param {string} nameOrPath - The object name or key path.
@returns {boolean}
*/
function isNodeMatchesNameOrPath(node, nameOrPath) {
const names = nameOrPath.split(".");
for (let index = names.length - 1; index >= 0; index--) {
const name = names[index];
if (index === 0) {
return node.type === "Identifier" && node.name === name;
}
if (
node.type !== "MemberExpression" ||
node.optional ||
node.computed ||
node.property.type !== "Identifier" ||
node.property.name !== name
) {
return false;
}
node = node.object;
}
}
/**
Check if node matches any object name or key path.
@param {Node} node - The AST node to check.
@param {string[]} nameOrPaths - The object name or key paths.
@returns {boolean}
*/
function isNodeMatches(node, nameOrPaths) {
return nameOrPaths.some((nameOrPath) =>
isNodeMatchesNameOrPath(node, nameOrPath)
);
}
module.exports = isNodeMatches;
@@ -0,0 +1,10 @@
"use strict";
const createPlugin = require("../../utils/create-plugin.js");
const COMMENT = "/* Formatted by stylus plugin */";
module.exports = createPlugin({
name: "stylus",
print: (text) => COMMENT + "\n" + text.replace(COMMENT, "").trim(),
});
@@ -0,0 +1,6 @@
{
"private": true,
"name": "prettier-plugin-dummy-stylus",
"version": "1.0.0",
"main": "./index.cjs"
}
@@ -171,6 +171,15 @@ End Function
<script lang="unknown">
</script>
<script type="speculationrules">
{
"prerender": [
{"source": "list", "urls": ["https://a.test/foo"]}
]
}
</script>
=====================================output=====================================
<script type="application/ld+json">
{ "json": true }
@@ -208,5 +217,11 @@ End Function
<script lang="unknown"></script>
<script type="speculationrules">
{
"prerender": [{ "source": "list", "urls": ["https://a.test/foo"] }]
}
</script>
================================================================================
`;
+9 -1
View File
@@ -31,4 +31,12 @@ End Function
</script>
<script lang="unknown">
</script>
</script>
<script type="speculationrules">
{
"prerender": [
{"source": "list", "urls": ["https://a.test/foo"]}
]
}
</script>
@@ -1474,6 +1474,24 @@ export {
barr, // comment
}
const foooo = ''
const barrr = ''
export {
foooo,
barrr as // comment
baz,
} from 'foo'
const fooooo = ''
const barrrr = ''
export {
fooooo,
barrrr as // comment
bazz,
}
=====================================output=====================================
export //comment
{}
@@ -1498,6 +1516,22 @@ export {
barr, // comment
}
const foooo = ""
const barrr = ""
export {
foooo,
// comment
barrr as baz,
} from "foo"
const fooooo = ""
const barrrr = ""
export {
fooooo,
// comment
barrrr as bazz,
}
================================================================================
`;
@@ -1530,6 +1564,24 @@ export {
barr, // comment
}
const foooo = ''
const barrr = ''
export {
foooo,
barrr as // comment
baz,
} from 'foo'
const fooooo = ''
const barrrr = ''
export {
fooooo,
barrrr as // comment
bazz,
}
=====================================output=====================================
export //comment
{};
@@ -1554,6 +1606,141 @@ export {
barr, // comment
};
const foooo = "";
const barrr = "";
export {
foooo,
// comment
barrr as baz,
} from "foo";
const fooooo = "";
const barrrr = "";
export {
fooooo,
// comment
barrrr as bazz,
};
================================================================================
`;
exports[`export-and-import.js - {"semi":false} format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
semi: false
| printWidth
=====================================input======================================
// These are tests to compare comment formats in \`export\` and \`import\`.
export {
foo,
bar as // comment
baz,
} from 'foo'
const fooo = ""
const barr = ""
export {
fooo,
barr as // comment
bazz,
}
import {
foo,
bar as // comment
baz,
} from 'foo'
=====================================output=====================================
// These are tests to compare comment formats in \`export\` and \`import\`.
export {
foo,
// comment
bar as baz,
} from "foo"
const fooo = ""
const barr = ""
export {
fooo,
// comment
barr as bazz,
}
import {
foo,
// comment
bar as baz,
} from "foo"
================================================================================
`;
exports[`export-and-import.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// These are tests to compare comment formats in \`export\` and \`import\`.
export {
foo,
bar as // comment
baz,
} from 'foo'
const fooo = ""
const barr = ""
export {
fooo,
barr as // comment
bazz,
}
import {
foo,
bar as // comment
baz,
} from 'foo'
=====================================output=====================================
// These are tests to compare comment formats in \`export\` and \`import\`.
export {
foo,
// comment
bar as baz,
} from "foo";
const fooo = "";
const barr = "";
export {
fooo,
// comment
barr as bazz,
};
import {
foo,
// comment
bar as baz,
} from "foo";
================================================================================
`;
@@ -0,0 +1,25 @@
// These are tests to compare comment formats in `export` and `import`.
export {
foo,
bar as // comment
baz,
} from 'foo'
const fooo = ""
const barr = ""
export {
fooo,
barr as // comment
bazz,
}
import {
foo,
bar as // comment
baz,
} from 'foo'
+18
View File
@@ -20,3 +20,21 @@ export {
fooo, // comment
barr, // comment
}
const foooo = ''
const barrr = ''
export {
foooo,
barrr as // comment
baz,
} from 'foo'
const fooooo = ''
const barrrr = ''
export {
fooooo,
barrrr as // comment
bazz,
}
@@ -1004,6 +1004,34 @@ skip(\`does something really long and complicated so I have to write a very long
skip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.parallel.only(\`does something really long and complicated so I have to write a very long name for the testThis is a very\`, () => {});
test.describe.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.serial.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
// Should break
it.only("does something really long and complicated so I have to write a very long name for the test", 10, () => {
@@ -1020,6 +1048,14 @@ it.only.only("does something really long and complicated so I have to write a ve
xskip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel.serial("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.dummy.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
// timeout
it(\`handles
@@ -1132,6 +1168,44 @@ skip(\`does something really long and complicated so I have to write a very long
skip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe
.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.parallel(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel
.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.parallel
.only(\`does something really long and complicated so I have to write a very long name for the testThis is a very\`, () => {});
test.describe
.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.serial(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.serial
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial
.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
// Should break
it.only(
@@ -1161,6 +1235,26 @@ xskip(
() => {}
);
test.describe.only.parallel(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.parallel.serial(
"does something really long and complicated so I have to write a very long name for the testThis is a very",
() => {}
);
test.serial(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.dummy.serial(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
// timeout
it(\`handles
@@ -1279,6 +1373,34 @@ skip(\`does something really long and complicated so I have to write a very long
skip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.parallel.only(\`does something really long and complicated so I have to write a very long name for the testThis is a very\`, () => {});
test.describe.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.serial.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
// Should break
it.only("does something really long and complicated so I have to write a very long name for the test", 10, () => {
@@ -1295,6 +1417,14 @@ it.only.only("does something really long and complicated so I have to write a ve
xskip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel.serial("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.dummy.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
// timeout
it(\`handles
@@ -1407,6 +1537,44 @@ skip(\`does something really long and complicated so I have to write a very long
skip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe
.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.parallel(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.parallel
.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.parallel
.only(\`does something really long and complicated so I have to write a very long name for the testThis is a very\`, () => {});
test.describe
.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe
.serial(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
test.describe.serial
.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial
.only(\`does something really long and complicated so I have to write a very long name for the test\`, () => {});
// Should break
it.only(
@@ -1436,6 +1604,26 @@ xskip(
() => {}
);
test.describe.only.parallel(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.parallel.serial(
"does something really long and complicated so I have to write a very long name for the testThis is a very",
() => {}
);
test.serial(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
test.describe.dummy.serial(
"does something really long and complicated so I have to write a very long name for the test",
() => {}
);
// timeout
it(\`handles
@@ -85,6 +85,34 @@ skip(`does something really long and complicated so I have to write a very long
skip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step("does something really long and complicated so I have to write a very long name for the test", () => {});
test.step(`does something really long and complicated so I have to write a very long name for the test`, () => {});
test.describe("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe(`does something really long and complicated so I have to write a very long name for the test`, () => {});
test.describe.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only(`does something really long and complicated so I have to write a very long name for the test`, () => {});
test.describe.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel(`does something really long and complicated so I have to write a very long name for the test`, () => {});
test.describe.parallel.only("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.describe.parallel.only(`does something really long and complicated so I have to write a very long name for the testThis is a very`, () => {});
test.describe.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial(`does something really long and complicated so I have to write a very long name for the test`, () => {});
test.describe.serial.only("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.serial.only(`does something really long and complicated so I have to write a very long name for the test`, () => {});
// Should break
it.only("does something really long and complicated so I have to write a very long name for the test", 10, () => {
@@ -101,6 +129,14 @@ it.only.only("does something really long and complicated so I have to write a ve
xskip("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.only.parallel("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.parallel.serial("does something really long and complicated so I have to write a very long name for the testThis is a very", () => {});
test.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
test.describe.dummy.serial("does something really long and complicated so I have to write a very long name for the test", () => {});
// timeout
it(`handles
@@ -10,7 +10,6 @@ singleQuote: true
=====================================input======================================
# Prettier
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/jlongster/prettier)
[![Build Status](https://travis-ci.org/prettier/prettier.svg?branch=master)](https://travis-ci.org/prettier/prettier)
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
@@ -909,7 +908,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
=====================================output=====================================
# Prettier
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/jlongster/prettier)
[![Build Status](https://travis-ci.org/prettier/prettier.svg?branch=master)](https://travis-ci.org/prettier/prettier)
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
@@ -1989,7 +1987,6 @@ proseWrap: "always"
=====================================input======================================
# Prettier
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/jlongster/prettier)
[![Build Status](https://travis-ci.org/prettier/prettier.svg?branch=master)](https://travis-ci.org/prettier/prettier)
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
@@ -2888,7 +2885,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
=====================================output=====================================
# Prettier
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/jlongster/prettier)
[![Build Status](https://travis-ci.org/prettier/prettier.svg?branch=master)](https://travis-ci.org/prettier/prettier)
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
@@ -1,6 +1,5 @@
# Prettier
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/jlongster/prettier)
[![Build Status](https://travis-ci.org/prettier/prettier.svg?branch=master)](https://travis-ci.org/prettier/prettier)
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
@@ -184,6 +184,22 @@ type Foo =
================================================================================
`;
exports[`ts-4.7-instantiation-expression.ts format 1`] = `
====================================options=====================================
parsers: ["babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
// typeof
let x: typeof y.z<w>;
=====================================output=====================================
// typeof
let x: typeof y.z<w>;
================================================================================
`;
exports[`tuple-labeled-ts.ts format 1`] = `
====================================options=====================================
parsers: ["babel-ts"]
@@ -0,0 +1,2 @@
// typeof
let x: typeof y.z<w>;
@@ -1,5 +1,53 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`computed-members.ts [babel-ts] format 1`] = `
"Unexpected token (2:3)
1 | enum A {
> 2 | [i++],
| ^
3 | }
4 |
5 | const bar = "bar""
`;
exports[`computed-members.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
enum A {
[i++],
}
const bar = "bar"
enum B {
[bar] = 2,
}
const foo = () => "foo";
enum C {
[foo()] = 2,
}
=====================================output=====================================
enum A {
[i++],
}
const bar = "bar";
enum B {
[bar] = 2,
}
const foo = () => "foo";
enum C {
[foo()] = 2,
}
================================================================================
`;
exports[`enum.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -0,0 +1,13 @@
enum A {
[i++],
}
const bar = "bar"
enum B {
[bar] = 2,
}
const foo = () => "foo";
enum C {
[foo()] = 2,
}
+5 -1
View File
@@ -1 +1,5 @@
run_spec(import.meta, ["typescript"]);
run_spec(import.meta, ["typescript"], {
errors: {
"babel-ts": ["computed-members.ts"],
},
});
@@ -411,10 +411,10 @@ let h: !(string | number);
let a: *;
function b(x: ?) {}
let c: ?string;
let d: ?string;
let d: string?;
let e: ?(string | number);
let f: !string;
let g: !string;
let g: string!;
let h: !(string | number);
================================================================================
@@ -449,10 +449,10 @@ let h: !(string | number);
let a: *;
function b(x: ?) {}
let c: ?string;
let d: ?string;
let d: string?;
let e: ?(string | number);
let f: !string;
let g: !string;
let g: string!;
let h: !(string | number);
================================================================================
@@ -477,10 +477,10 @@ let h: !(string | number);
let a: *;
function b(x: ?) {}
let c: ?string;
let d: ?string;
let d: string?;
let e: ?(string | number);
let f: !string;
let g: !string;
let g: string!;
let h: !(string | number);
================================================================================
@@ -0,0 +1,35 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`basic.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
type X3<T> = T extends [infer U extends number] ? MustBeNumber<U> : never;
type X4<T> = T extends [infer U extends number, infer U extends number] ? MustBeNumber<U> : never;
type X5<T> = T extends [infer U extends number, infer U] ? MustBeNumber<U> : never;
type X6<T> = T extends [infer U, infer U extends number] ? MustBeNumber<U> : never;
type X7<T> = T extends [infer U extends string, infer U extends number] ? U : never;
type X8<U, T> = T extends infer U extends number ? U : T;
type X9<U, T> = T extends (infer U extends number ? U : T) ? U : T;
=====================================output=====================================
type X3<T> = T extends [infer U extends number] ? MustBeNumber<U> : never;
type X4<T> = T extends [infer U extends number, infer U extends number]
? MustBeNumber<U>
: never;
type X5<T> = T extends [infer U extends number, infer U]
? MustBeNumber<U>
: never;
type X6<T> = T extends [infer U, infer U extends number]
? MustBeNumber<U>
: never;
type X7<T> = T extends [infer U extends string, infer U extends number]
? U
: never;
type X8<U, T> = T extends infer U extends number ? U : T;
type X9<U, T> = T extends (infer U extends number ? U : T) ? U : T;
================================================================================
`;
@@ -0,0 +1,7 @@
type X3<T> = T extends [infer U extends number] ? MustBeNumber<U> : never;
type X4<T> = T extends [infer U extends number, infer U extends number] ? MustBeNumber<U> : never;
type X5<T> = T extends [infer U extends number, infer U] ? MustBeNumber<U> : never;
type X6<T> = T extends [infer U, infer U extends number] ? MustBeNumber<U> : never;
type X7<T> = T extends [infer U extends string, infer U extends number] ? U : never;
type X8<U, T> = T extends infer U extends number ? U : T;
type X9<U, T> = T extends (infer U extends number ? U : T) ? U : T;
@@ -0,0 +1 @@
run_spec(__dirname, ["typescript"]);
@@ -0,0 +1,70 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`basic.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// basic
const foo = bar<T>;
=====================================output=====================================
// basic
const foo = bar<T>;
================================================================================
`;
exports[`binary-expr.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
new A < B >
C
=====================================output=====================================
new A() < B > C;
================================================================================
`;
exports[`inferface-asi.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
interface Example {
(a: number): typeof a
<T>(): void
};
=====================================output=====================================
interface Example {
(a: number): typeof a;
<T>(): void;
}
================================================================================
`;
exports[`new.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// new
new A<T>;
=====================================output=====================================
// new
new A<T>();
================================================================================
`;
@@ -0,0 +1,2 @@
// basic
const foo = bar<T>;
@@ -0,0 +1,2 @@
new A < B >
C
@@ -0,0 +1,5 @@
interface Example {
(a: number): typeof a
<T>(): void
};
@@ -0,0 +1 @@
run_spec(__dirname, ["typescript"]);
@@ -0,0 +1,2 @@
// new
new A<T>;
@@ -0,0 +1,285 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`basic.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
type Covariant<out T> = {
x: T;
}
type Contravariant<in T> = {
f: (x: T) => void;
}
type Invariant<in out T> = {
f: (x: T) => T;
}
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
}
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
}
type Invariant1<in T> = {
f: (x: T) => T;
}
type Invariant2<out T> = {
f: (x: T) => T;
}
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
}
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
}
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
}
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
=====================================output=====================================
type Covariant<out T> = {
x: T;
};
type Contravariant<in T> = {
f: (x: T) => void;
};
type Invariant<in out T> = {
f: (x: T) => T;
};
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
};
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
};
type Invariant1<in T> = {
f: (x: T) => T;
};
type Invariant2<out T> = {
f: (x: T) => T;
};
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
};
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
};
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
};
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
================================================================================
`;
exports[`with-jsx.tsx [babel-ts] format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// valid JSX
<in T>() => {}</in>;
type Covariant<out T> = {
x: T;
}
type Contravariant<in T> = {
f: (x: T) => void;
}
type Invariant<in out T> = {
f: (x: T) => T;
}
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
}
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
}
type Invariant1<in T> = {
f: (x: T) => T;
}
type Invariant2<out T> = {
f: (x: T) => T;
}
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
}
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
}
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
}
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
=====================================output=====================================
// valid JSX
<in T>() => {}</in>;
type Covariant<out T> = {
x: T;
};
type Contravariant<in T> = {
f: (x: T) => void;
};
type Invariant<in out T> = {
f: (x: T) => T;
};
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
};
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
};
type Invariant1<in T> = {
f: (x: T) => T;
};
type Invariant2<out T> = {
f: (x: T) => T;
};
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
};
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
};
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
};
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
================================================================================
`;
exports[`with-jsx.tsx [typescript] format 1`] = `
"Unexpected token. Did you mean \`{'>'}\` or \`&gt;\`? (2:11)
1 | // valid JSX
> 2 | <in T>() => {}</in>;
| ^
3 |
4 | type Covariant<out T> = {
5 | x: T;"
`;
@@ -0,0 +1,61 @@
type Covariant<out T> = {
x: T;
}
type Contravariant<in T> = {
f: (x: T) => void;
}
type Invariant<in out T> = {
f: (x: T) => T;
}
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
}
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
}
type Invariant1<in T> = {
f: (x: T) => T;
}
type Invariant2<out T> = {
f: (x: T) => T;
}
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
}
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
}
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
}
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
@@ -0,0 +1,3 @@
run_spec(__dirname, ["typescript"], {
errors: { typescript: ["with-jsx.tsx"] },
});
@@ -0,0 +1,64 @@
// valid JSX
<in T>() => {}</in>;
type Covariant<out T> = {
x: T;
}
type Contravariant<in T> = {
f: (x: T) => void;
}
type Invariant<in out T> = {
f: (x: T) => T;
}
type T10<out T> = T;
type T11<in T> = keyof T;
type T12<out T, out K extends keyof T> = T[K];
type T13<in out T> = T[keyof T];
type Covariant1<in T> = {
x: T;
}
type Contravariant1<out T> = keyof T;
type Contravariant2<out T> = {
f: (x: T) => void;
}
type Invariant1<in T> = {
f: (x: T) => T;
}
type Invariant2<out T> = {
f: (x: T) => T;
}
type Foo1<in T> = {
x: T;
f: FooFn1<T>;
}
type Foo2<out T> = {
x: T;
f: FooFn2<T>;
}
type Foo3<in out T> = {
x: T;
f: FooFn3<T>;
}
type T21<in out T> = T;
interface Baz<out T> {}
interface Baz<in T> {}
interface Parent<out A> {
child: Child<A> | null;
parent: Parent<A> | null;
}
declare class StateNode<TContext, in out TEvent extends { type: string }> {
_storedEvent: TEvent;
_action: ActionObject<TEvent>;
_state: StateNode<TContext, any>;
}
@@ -121,16 +121,30 @@ printWidth: 80
| printWidth
=====================================input======================================
<style lang="uppercase-rocks">
/* Should not be uppercased */
hello,
world!
</style>
<style lang="stylus">
/* Should insert a comment above this line */
a
color blue;
</style>
=====================================output=====================================
<style lang="uppercase-rocks">
/* Should not be uppercased */
hello,
world!
</style>
<style lang="stylus">
/* Should insert a comment above this line */
a
color blue;
</style>
================================================================================
`;
@@ -141,16 +155,31 @@ printWidth: 80
| printWidth
=====================================input======================================
<style lang="uppercase-rocks">
/* Should not be uppercased */
hello,
world!
</style>
<style lang="stylus">
/* Should insert a comment above this line */
a
color blue;
</style>
=====================================output=====================================
<style lang="uppercase-rocks">
/* Should not be uppercased */
hello,
world!
</style>
<style lang="stylus">
/* Formatted by stylus plugin */
/* Should insert a comment above this line */
a
color blue;
</style>
================================================================================
`;
@@ -4,6 +4,7 @@ const { require } = createEsmUtils(import.meta);
const plugins = [
require("../../../config/prettier-plugins/prettier-plugin-uppercase-rocks/index.cjs"),
require("../../../config/prettier-plugins/prettier-plugin-dummy-stylus/index.cjs"),
];
run_spec(import.meta, ["vue"], { plugins });
@@ -1,4 +1,11 @@
<style lang="uppercase-rocks">
/* Should not be uppercased */
hello,
world!
</style>
<style lang="stylus">
/* Should insert a comment above this line */
a
color blue;
</style>
-1
View File
@@ -59,7 +59,6 @@ class Footer extends React.Component {
>
Stack Overflow
</a>
<a href="https://gitter.im/jlongster/prettier">Chat on Gitter</a>
<a href="https://twitter.com/PrettierCode">
@PrettierCode on Twitter
</a>
+55 -46
View File
@@ -217,7 +217,16 @@ __metadata:
languageName: node
linkType: hard
"@babel/parser@npm:7.17.10, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.17.10":
"@babel/parser@npm:7.18.0":
version: 7.18.0
resolution: "@babel/parser@npm:7.18.0"
bin:
parser: ./bin/babel-parser.js
checksum: 253b5828bf4a0b443301baedc5993d6f7f35aa0d81cf8f2f2f53940904b7067eab7bd2380aee4b3be1d8efd5ae1008eb0fad19bde28f5fbc213c0fdf9a414466
languageName: node
linkType: hard
"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.17.10":
version: 7.17.10
resolution: "@babel/parser@npm:7.17.10"
bin:
@@ -1545,13 +1554,6 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/types@npm:5.23.0":
version: 5.23.0
resolution: "@typescript-eslint/types@npm:5.23.0"
checksum: 96ae3e80cfae7b34f2846db692c31fb1804bf9651bce1d29f2eb8ae4c763d22f3283adc02dedeebd7cf70e4d8be54ec7f6ca593e03cdca26c791207e7556c2c1
languageName: node
linkType: hard
"@typescript-eslint/types@npm:5.25.0":
version: 5.25.0
resolution: "@typescript-eslint/types@npm:5.25.0"
@@ -1559,21 +1561,10 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/typescript-estree@npm:5.23.0":
version: 5.23.0
resolution: "@typescript-eslint/typescript-estree@npm:5.23.0"
dependencies:
"@typescript-eslint/types": 5.23.0
"@typescript-eslint/visitor-keys": 5.23.0
debug: ^4.3.2
globby: ^11.0.4
is-glob: ^4.0.3
semver: ^7.3.5
tsutils: ^3.21.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 8d85bb1cd777e93cc7322ae8fea25f9b924def02494cdb8395c1d5d17b5fd3ac9bc969418a1d20a5dc28c2cdd85da20e13527e28b595c06ff6f84cd22a78d73f
"@typescript-eslint/types@npm:5.26.0":
version: 5.26.0
resolution: "@typescript-eslint/types@npm:5.26.0"
checksum: 98798616d832da8e5ef61f050e4e72ed921a162cb4ce2b2dfe0a317c66998157e832f449aeab21a1fdfd806e7134091bc1a9446b1089f4687786b646ad8738e7
languageName: node
linkType: hard
@@ -1595,6 +1586,24 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/typescript-estree@npm:5.26.0":
version: 5.26.0
resolution: "@typescript-eslint/typescript-estree@npm:5.26.0"
dependencies:
"@typescript-eslint/types": 5.26.0
"@typescript-eslint/visitor-keys": 5.26.0
debug: ^4.3.4
globby: ^11.1.0
is-glob: ^4.0.3
semver: ^7.3.7
tsutils: ^3.21.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 2cf147629474952725593da64827a7e4e39f79614019529d0d6e5b89236c55f3607c6b4a24f160dbc5978f4cfd60f96fcb573a770c2877f8e29d7552b40e2135
languageName: node
linkType: hard
"@typescript-eslint/utils@npm:5.25.0, @typescript-eslint/utils@npm:^5.10.0":
version: 5.25.0
resolution: "@typescript-eslint/utils@npm:5.25.0"
@@ -1611,16 +1620,6 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:5.23.0":
version: 5.23.0
resolution: "@typescript-eslint/visitor-keys@npm:5.23.0"
dependencies:
"@typescript-eslint/types": 5.23.0
eslint-visitor-keys: ^3.0.0
checksum: 322e10d52a985e8a90d3612bb9d09a87dc64fc4cb1248484f1a9a7a98f65d3ef65a465ce868773a4939e35fa3b726ad609dac5a168efd7eaca4b06df33e965e3
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:5.25.0":
version: 5.25.0
resolution: "@typescript-eslint/visitor-keys@npm:5.25.0"
@@ -1631,6 +1630,16 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:5.26.0":
version: 5.26.0
resolution: "@typescript-eslint/visitor-keys@npm:5.26.0"
dependencies:
"@typescript-eslint/types": 5.26.0
eslint-visitor-keys: ^3.3.0
checksum: 4a5085d19e677f3b44ca4455bba85fd1a3be4d7d2e96bb22738a7497f6f4d16bfdee51059454a78b1e108d8e1593b1a31be40764a66448945118277cff5eff02
languageName: node
linkType: hard
"abbrev@npm:1":
version: 1.1.1
resolution: "abbrev@npm:1.1.1"
@@ -3427,7 +3436,7 @@ __metadata:
languageName: node
linkType: hard
"eslint-visitor-keys@npm:^3.0.0, eslint-visitor-keys@npm:^3.3.0":
"eslint-visitor-keys@npm:^3.3.0":
version: 3.3.0
resolution: "eslint-visitor-keys@npm:3.3.0"
checksum: d59e68a7c5a6d0146526b0eec16ce87fbf97fe46b8281e0d41384224375c4e52f5ffb9e16d48f4ea50785cde93f766b0c898e31ab89978d88b0e1720fbfb7808
@@ -4037,7 +4046,7 @@ __metadata:
languageName: node
linkType: hard
"globby@npm:^11.0.1, globby@npm:^11.0.4, globby@npm:^11.1.0":
"globby@npm:^11.0.1, globby@npm:^11.1.0":
version: 11.1.0
resolution: "globby@npm:11.1.0"
dependencies:
@@ -6658,7 +6667,7 @@ __metadata:
dependencies:
"@angular/compiler": 12.2.16
"@babel/code-frame": 7.16.7
"@babel/parser": 7.17.10
"@babel/parser": 7.18.0
"@babel/types": 7.18.0
"@esbuild-plugins/node-modules-polyfill": 0.1.4
"@glimmer/reference": 0.84.2
@@ -6667,7 +6676,7 @@ __metadata:
"@types/estree": 0.0.51
"@types/jest": 27.5.1
"@typescript-eslint/eslint-plugin": 5.25.0
"@typescript-eslint/typescript-estree": 5.23.0
"@typescript-eslint/typescript-estree": 5.26.0
acorn: 8.7.1
acorn-jsx: 5.3.2
angular-estree-parser: 2.5.0
@@ -6758,7 +6767,7 @@ __metadata:
string-width: 5.0.1
strip-ansi: 7.0.1
tempy: 2.0.0
typescript: 4.6.4
typescript: 4.7.2
unicode-regex: 3.0.0
unified: 9.2.2
vnopts: 1.0.2
@@ -8019,23 +8028,23 @@ __metadata:
languageName: node
linkType: hard
"typescript@npm:4.6.4":
version: 4.6.4
resolution: "typescript@npm:4.6.4"
"typescript@npm:4.7.2":
version: 4.7.2
resolution: "typescript@npm:4.7.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: e7bfcc39cd4571a63a54e5ea21f16b8445268b9900bf55aee0e02ad981be576acc140eba24f1af5e3c1457767c96cea6d12861768fb386cf3ffb34013718631a
checksum: 5163585e6b56410f77d5483b698d9489bbee8902c99029eb70cf6d21525a186530ce19a00951af84eefd4a131cc51d0959f5118e25e70ab61f45ac4057dbd1ef
languageName: node
linkType: hard
"typescript@patch:typescript@4.6.4#~builtin<compat/typescript>":
version: 4.6.4
resolution: "typescript@patch:typescript@npm%3A4.6.4#~builtin<compat/typescript>::version=4.6.4&hash=7ad353"
"typescript@patch:typescript@4.7.2#~builtin<compat/typescript>":
version: 4.7.2
resolution: "typescript@patch:typescript@npm%3A4.7.2#~builtin<compat/typescript>::version=4.7.2&hash=7ad353"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 1cb434fbc637d347be90e3a0c6cd05e33c38f941713c8786d3031faf1842c2c148ba91d2fac01e7276b0ae3249b8633f1660e32686cc7a8c6a8fd5361dc52c66
checksum: 7e2b9a9f4a70fb7616f1b0d986977f8e34a74f046202fa7f24fdee79589598277810fa216b3776c20c0683a9235872c73be34fdb93f67f98c1efaca40999422f
languageName: node
linkType: hard