Skip to content

Commit 62c13c5

Browse files
authored
feat(misc): support prettier v3 (#33898)
## Current Behavior Nx doesn't generate projects with Prettier v3. ## Expected Behavior Nx should generate projects with Prettier v3. ## Related Issue(s) Fixes #30801
1 parent c29834c commit 62c13c5

122 files changed

Lines changed: 955 additions & 890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"singleQuote": true,
33
"endOfLine": "lf",
4+
"trailingComma": "es5",
45
"plugins": ["prettier-plugin-tailwindcss"],
56
"overrides": [
67
{

astro-docs/src/content/docs/concepts/executors-and-configurations.mdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ If defining a new target that needs to run a single shell command, there is a sh
6363
"generators": {},
6464
"targets": {
6565
"echo": {
66-
"command": "echo 'hello world'"
67-
}
68-
}
66+
"command": "echo 'hello world'",
67+
},
68+
},
6969
}
7070
```
7171

astro-docs/src/content/docs/concepts/typescript-project-linking.mdoc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ The root `tsconfig.base.json` should contain a `compilerOptions` property and no
143143
// Required compiler options
144144
"composite": true,
145145
"declaration": true,
146-
"declarationMap": true
146+
"declarationMap": true,
147147
// Other options...
148-
}
148+
},
149149
}
150150
```
151151

@@ -158,7 +158,7 @@ The root `tsconfig.json` file should extend `tsconfig.base.json` and not include
158158
"references": [
159159
// UPDATED BY PROJECT GENERATORS
160160
// All projects in the repository
161-
]
161+
],
162162
}
163163
```
164164

@@ -174,16 +174,16 @@ Each project's `tsconfig.json` file should extend the `tsconfig.base.json` file
174174
// UPDATED BY NX SYNC
175175
// All project dependencies
176176
{
177-
"path": "../utils"
177+
"path": "../utils",
178178
},
179179
// This project's other tsconfig.*.json files
180180
{
181-
"path": "./tsconfig.lib.json"
181+
"path": "./tsconfig.lib.json",
182182
},
183183
{
184-
"path": "./tsconfig.spec.json"
185-
}
186-
]
184+
"path": "./tsconfig.spec.json",
185+
},
186+
],
187187
}
188188
```
189189

@@ -203,9 +203,9 @@ Each project's `tsconfig.lib.json` file extends the project's `tsconfig.json` fi
203203
// UPDATED BY NX SYNC
204204
// tsconfig.lib.json files for project dependencies
205205
{
206-
"path": "../utils/tsconfig.lib.json"
207-
}
208-
]
206+
"path": "../utils/tsconfig.lib.json",
207+
},
208+
],
209209
}
210210
```
211211

@@ -223,9 +223,9 @@ The project's `tsconfig.spec.json` does not need to reference project dependenci
223223
"references": [
224224
// tsconfig.lib.json for this project
225225
{
226-
"path": "./tsconfig.lib.json"
227-
}
228-
]
226+
"path": "./tsconfig.lib.json",
227+
},
228+
],
229229
}
230230
```
231231

@@ -281,10 +281,10 @@ If you define TS path aliases in an individual project's tsconfig files, you sho
281281
"#tests/*": ["./tests/*"],
282282
"@/icon-name": [
283283
"./app/components/ui/icons/name.d.ts",
284-
"./types/icon-name.d.ts"
285-
]
286-
}
287-
}
284+
"./types/icon-name.d.ts",
285+
],
286+
},
287+
},
288288
}
289289
```
290290

@@ -308,9 +308,9 @@ The paths for each library are defined in the root `tsconfig.base.json` and each
308308
"declaration": false,
309309
"paths": {
310310
// These paths are automatically added by Nx library generators
311-
"@myorg/shared-ui": ["packages/shared-ui/src/index.ts"]
311+
"@myorg/shared-ui": ["packages/shared-ui/src/index.ts"],
312312
// ...
313-
}
314-
}
313+
},
314+
},
315315
}
316316
```

astro-docs/src/content/docs/enterprise/Single Tenant/azure-saml.mdoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ filter: 'type:Guides'
3131
![Select SAML authentication method](../../../../assets/enterprise/single-tenant/saml/azure_7.png)
3232

3333
7. Add these configuration options
34-
3534
1. Configure the Identifier **exactly** as `nx-private-cloud`
3635
2. For the **Reply URL**, it should point to your Private Cloud instance URL. Make sure it ends with `/auth-callback`
3736

@@ -46,7 +45,6 @@ filter: 'type:Guides'
4645
![Edit email claim configuration](../../../../assets/enterprise/single-tenant/saml/azure_10.png)
4746

4847
10. Configure it as per below
49-
5048
1. **"Namespace"** needs to be blank
5149
2. **"Name:"** needs to be "email"
5250
3. See screenshot below. This is an important step, because Nx Cloud will expect the "email" property on each profile that logs in.

astro-docs/src/content/docs/enterprise/Single Tenant/okta-saml.mdoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ filter: 'type:Guides'
1515
![Enter SAML application name](../../../../assets/enterprise/single-tenant/saml/okta_3.png)
1616

1717
3. On the Next page, configure it as below:
18-
1918
1. The Single Sign On URL needs to point to your Nx Cloud instance URL and ends with `/auth-callback`
2019
2. The Audience should be `nx-private-cloud`
2120

@@ -31,7 +30,6 @@ filter: 'type:Guides'
3130

3231
6. Click “Next”, and select the first option on the next screen.
3332
7. Go to the assignments tab and assign the users that can login to the Nx Cloud WebApp:
34-
3533
1. **Note:** This just gives them permission to use the Nx Cloud web app with their own workspace. Users will still need to be invited manually through the web app to your main workspace.
3634

3735
![Assign users to SAML application](../../../../assets/enterprise/single-tenant/saml/okta_6.png)

astro-docs/src/content/docs/enterprise/conformance.mdoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ Conformance rules are configured in the `conformance` property of the `nx.json`
4949
"depConstraints": [
5050
{
5151
"sourceTag": "scope:shared",
52-
"onlyDependOnProjectsWithTags": ["scope:shared"]
53-
}
54-
]
55-
}
52+
"onlyDependOnProjectsWithTags": ["scope:shared"],
53+
},
54+
],
55+
},
5656
},
5757
{
5858
"rule": "@nx/conformance/ensure-owners",
59-
"projects": ["!experimental-app"]
59+
"projects": ["!experimental-app"],
6060
},
6161
{
62-
"rule": "./tools/local-conformance-rule.ts"
63-
}
64-
]
65-
}
62+
"rule": "./tools/local-conformance-rule.ts",
63+
},
64+
],
65+
},
6666
}
6767
```
6868

astro-docs/src/content/docs/enterprise/publish-conformance-rules-to-nx-cloud.mdoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ We now have a valid implementation of a rule and we are ready to build it and pu
3535
"executor": "@nx/conformance:bundle-rules",
3636
"outputs": ["{options.outputPath}"],
3737
"options": {
38-
"outputPath": "{projectRoot}/dist"
39-
}
40-
}
41-
}
38+
"outputPath": "{projectRoot}/dist",
39+
},
40+
},
41+
},
4242
}
4343
```
4444

@@ -67,14 +67,14 @@ Because publishing the rules is a relatively common operation, you can also wire
6767
"executor": "@nx/conformance:bundle-rules",
6868
"outputs": ["{options.outputPath}"],
6969
"options": {
70-
"outputPath": "{projectRoot}/dist"
71-
}
70+
"outputPath": "{projectRoot}/dist",
71+
},
7272
},
7373
"publish": {
7474
"dependsOn": ["build"],
75-
"command": "npx nx-cloud publish-conformance-rules {projectRoot}/dist"
76-
}
77-
}
75+
"command": "npx nx-cloud publish-conformance-rules {projectRoot}/dist",
76+
},
77+
},
7878
}
7979
```
8080

astro-docs/src/content/docs/extending-nx/create-sync-generator.mdoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ A sync generator should be able to run without any required options, so update t
5252
"title": "",
5353
"type": "object",
5454
"properties": {},
55-
"required": []
55+
"required": [],
5656
}
5757
```
5858

@@ -96,8 +96,8 @@ Global sync generators are registered in the `nx.json` file like this:
9696
// nx.json
9797
{
9898
"sync": {
99-
"globalGenerators": ["@myprg/my-plugin:my-sync-generator"]
100-
}
99+
"globalGenerators": ["@myprg/my-plugin:my-sync-generator"],
100+
},
101101
}
102102
```
103103

@@ -169,9 +169,9 @@ For projects using [inferred targets](/docs/concepts/inferred-tasks) (no project
169169
{
170170
"targets": {
171171
"build": {
172-
"syncGenerators": ["my-plugin:my-sync-generator"]
173-
}
174-
}
172+
"syncGenerators": ["my-plugin:my-sync-generator"],
173+
},
174+
},
175175
}
176176
```
177177

@@ -183,7 +183,7 @@ You might have to adjust the name of your plugin based on your specific workspac
183183

184184
```jsonc
185185
{
186-
"syncGenerators": ["@myorg/my-plugin:my-sync-generator"]
186+
"syncGenerators": ["@myorg/my-plugin:my-sync-generator"],
187187
}
188188
```
189189

astro-docs/src/content/docs/extending-nx/createnodes-compatibility.mdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export interface OldCreateNodesContext extends CreateNodesContextV2 {
107107

108108
type OldCreateNodes<T = unknown> = readonly [
109109
projectFilePattern: string,
110-
createNodesFunction: OldCreateNodesFunction<T>
110+
createNodesFunction: OldCreateNodesFunction<T>,
111111
];
112112

113113
export type OldCreateNodesFunction<T = unknown> = (

astro-docs/src/content/docs/extending-nx/local-executors.mdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ Our last step is to add this executor to a given project's `targets` object in y
111111
"echo": {
112112
"executor": "@my-org/my-plugin:echo",
113113
"options": {
114-
"textToEcho": "Hello World"
115-
}
116-
}
117-
}
114+
"textToEcho": "Hello World",
115+
},
116+
},
117+
},
118118
}
119119
```
120120

0 commit comments

Comments
 (0)