@pnp/cli-microsoft365 11.2.0-beta.e0616e6 → 11.3.0-beta.ad8e99a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/onenote/commands/notebook/notebook-add.js +4 -3
- package/dist/m365/onenote/commands/notebook/notebook-list.js +6 -17
- package/dist/m365/onenote/commands/page/page-list.js +5 -8
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.22.0-beta.1.js → doctor-1.22.0.js} +3 -3
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.22.1.js +21 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002033_DEVDEP_css_loader.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002035_DEVDEP_types_heft_jest.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014003_CODE_launch.js +7 -44
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021005_PKG_scripts_test.js +18 -9
- package/dist/m365/spfx/commands/project/project-upgrade/rules/{FN021008_PKG_scripts_start.js → FN021007_PKG_scripts_start.js} +3 -3
- package/dist/m365/spfx/commands/project/project-upgrade/rules/{FN021012_PKG_scripts_eject_webpack.js → FN021008_PKG_scripts_eject_webpack.js} +3 -3
- package/dist/m365/spfx/commands/project/project-upgrade/rules/{FN021013_PKG_overrides_rushstack_heft.js → FN021009_PKG_overrides_rushstack_heft.js} +3 -3
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025002_ESLINTRCJS_rushstack_import_requires_chunk_name.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025003_ESLINTRCJS_rushstack_pair_react_dom_render_unmount.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025004_ESLINTRCJS_microsoft_spfx_import_requires_chunk_name.js +50 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025005_ESLINTRCJS_microsoft_spfx_pair_react_dom_render_unmount.js +50 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.22.0-beta.1.js → upgrade-1.22.0.js} +80 -155
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.1.js +55 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.3.4.js +42 -1
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spfx/commands/spfx-doctor.js +43 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +4 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +8 -2
- package/dist/m365/spo/commands/commandset/commandset-add.js +4 -0
- package/dist/m365/spo/commands/commandset/commandset-set.js +8 -1
- package/dist/m365/teams/commands/channel/channel-add.js +13 -33
- package/dist/utils/stringUtil.js +4 -0
- package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx +20 -1
- package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx +22 -1
- package/docs/docs/cmd/login.mdx +35 -11
- package/docs/docs/cmd/onenote/notebook/notebook-add.mdx +17 -0
- package/docs/docs/cmd/onenote/notebook/notebook-list.mdx +17 -0
- package/docs/docs/cmd/onenote/page/page-list.mdx +18 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +3 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +3 -0
- package/docs/docs/cmd/spo/commandset/commandset-add.mdx +3 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.mdx +3 -0
- package/npm-shrinkwrap.json +1359 -666
- package/package.json +17 -17
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002033_DEVDEP_jest_junit.js +0 -10
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015012_FILE_config_heft_json.js +0 -10
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015013_FILE_config_jest_config_json.js +0 -10
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021007_PKG_scripts_deploy.js +0 -45
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021009_PKG_scripts_build_watch.js +0 -45
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021010_PKG_scripts_package_solution.js +0 -45
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021011_PKG_scripts_deploy_azure_storage.js +0 -45
|
@@ -7,10 +7,11 @@ var _OneNoteNotebookAddCommand_instances, _OneNoteNotebookAddCommand_initTelemet
|
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
|
-
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
11
|
import { spo } from '../../../../utils/spo.js';
|
|
13
|
-
|
|
12
|
+
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
13
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
14
|
+
class OneNoteNotebookAddCommand extends GraphDelegatedCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.NOTEBOOK_ADD;
|
|
16
17
|
}
|
|
@@ -55,7 +56,7 @@ class OneNoteNotebookAddCommand extends GraphCommand {
|
|
|
55
56
|
endpoint += `users/${args.options.userId}`;
|
|
56
57
|
}
|
|
57
58
|
else if (args.options.userName) {
|
|
58
|
-
endpoint += `users/${args.options.userName}`;
|
|
59
|
+
endpoint += `users/${formatting.encodeQueryParameter(args.options.userName)}`;
|
|
59
60
|
}
|
|
60
61
|
else if (args.options.groupId) {
|
|
61
62
|
endpoint += `groups/${args.options.groupId}`;
|
|
@@ -4,13 +4,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _OneNoteNotebookListCommand_instances, _OneNoteNotebookListCommand_initTelemetry, _OneNoteNotebookListCommand_initOptions, _OneNoteNotebookListCommand_initValidators, _OneNoteNotebookListCommand_initOptionSets;
|
|
7
|
-
import request from '../../../../request.js';
|
|
8
7
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
8
|
import { odata } from '../../../../utils/odata.js';
|
|
10
9
|
import { validation } from '../../../../utils/validation.js';
|
|
11
|
-
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
10
|
import commands from '../../commands.js';
|
|
13
|
-
|
|
11
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
+
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
13
|
+
import { spo } from '../../../../utils/spo.js';
|
|
14
|
+
class OneNoteNotebookListCommand extends GraphDelegatedCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.NOTEBOOK_LIST;
|
|
16
17
|
}
|
|
@@ -34,7 +35,7 @@ class OneNoteNotebookListCommand extends GraphCommand {
|
|
|
34
35
|
endpoint += `users/${args.options.userId}`;
|
|
35
36
|
}
|
|
36
37
|
else if (args.options.userName) {
|
|
37
|
-
endpoint += `users/${args.options.userName}`;
|
|
38
|
+
endpoint += `users/${formatting.encodeQueryParameter(args.options.userName)}`;
|
|
38
39
|
}
|
|
39
40
|
else if (args.options.groupId) {
|
|
40
41
|
endpoint += `groups/${args.options.groupId}`;
|
|
@@ -44,7 +45,7 @@ class OneNoteNotebookListCommand extends GraphCommand {
|
|
|
44
45
|
endpoint += `groups/${groupId}`;
|
|
45
46
|
}
|
|
46
47
|
else if (args.options.webUrl) {
|
|
47
|
-
const siteId = await
|
|
48
|
+
const siteId = await spo.getSpoGraphSiteId(args.options.webUrl);
|
|
48
49
|
endpoint += `sites/${siteId}`;
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
@@ -57,18 +58,6 @@ class OneNoteNotebookListCommand extends GraphCommand {
|
|
|
57
58
|
const group = await entraGroup.getGroupByDisplayName(groupName);
|
|
58
59
|
return group.id;
|
|
59
60
|
}
|
|
60
|
-
async getSpoSiteId(webUrl) {
|
|
61
|
-
const url = new URL(webUrl);
|
|
62
|
-
const requestOptions = {
|
|
63
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
64
|
-
headers: {
|
|
65
|
-
accept: 'application/json;odata.metadata=none'
|
|
66
|
-
},
|
|
67
|
-
responseType: 'json'
|
|
68
|
-
};
|
|
69
|
-
const site = await request.get(requestOptions);
|
|
70
|
-
return site.id;
|
|
71
|
-
}
|
|
72
61
|
async commandAction(logger, args) {
|
|
73
62
|
try {
|
|
74
63
|
const endpoint = await this.getEndpointUrl(args);
|
|
@@ -8,9 +8,10 @@ import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
|
-
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
11
|
import commands from '../../commands.js';
|
|
13
|
-
|
|
12
|
+
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
13
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
14
|
+
class OneNotePageListCommand extends GraphDelegatedCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.PAGE_LIST;
|
|
16
17
|
}
|
|
@@ -34,13 +35,13 @@ class OneNotePageListCommand extends GraphCommand {
|
|
|
34
35
|
endpoint += `users/${args.options.userId}`;
|
|
35
36
|
}
|
|
36
37
|
else if (args.options.userName) {
|
|
37
|
-
endpoint += `users/${args.options.userName}`;
|
|
38
|
+
endpoint += `users/${formatting.encodeQueryParameter(args.options.userName)}`;
|
|
38
39
|
}
|
|
39
40
|
else if (args.options.groupId) {
|
|
40
41
|
endpoint += `groups/${args.options.groupId}`;
|
|
41
42
|
}
|
|
42
43
|
else if (args.options.groupName) {
|
|
43
|
-
const groupId = await
|
|
44
|
+
const groupId = await entraGroup.getGroupIdByDisplayName(args.options.groupName);
|
|
44
45
|
endpoint += `groups/${groupId}`;
|
|
45
46
|
}
|
|
46
47
|
else if (args.options.webUrl) {
|
|
@@ -53,10 +54,6 @@ class OneNotePageListCommand extends GraphCommand {
|
|
|
53
54
|
endpoint += '/onenote/pages';
|
|
54
55
|
return endpoint;
|
|
55
56
|
}
|
|
56
|
-
async getGroupId(groupName) {
|
|
57
|
-
const group = await entraGroup.getGroupByDisplayName(groupName);
|
|
58
|
-
return group.id;
|
|
59
|
-
}
|
|
60
57
|
async commandAction(logger, args) {
|
|
61
58
|
try {
|
|
62
59
|
const endpoint = await this.getEndpointUrl(args);
|
package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.22.0-beta.1.js → doctor-1.22.0.js}
RENAMED
|
@@ -14,8 +14,8 @@ export default [
|
|
|
14
14
|
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
15
15
|
new FN002015_DEVDEP_types_react('17'),
|
|
16
16
|
new FN002016_DEVDEP_types_react_dom('17'),
|
|
17
|
-
new FN002021_DEVDEP_rushstack_eslint_config('4.
|
|
18
|
-
new FN002022_DEVDEP_typescript('5.
|
|
17
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.5.2'),
|
|
18
|
+
new FN002022_DEVDEP_typescript('~5.8.0'),
|
|
19
19
|
new FN021001_PKG_spfx_deps_versions_match_project_version(true)
|
|
20
20
|
];
|
|
21
|
-
//# sourceMappingURL=doctor-1.22.0
|
|
21
|
+
//# sourceMappingURL=doctor-1.22.0.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FN002021_DEVDEP_rushstack_eslint_config } from '../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
2
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
3
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
4
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
5
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
6
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
7
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
8
|
+
import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
|
|
9
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
10
|
+
export default [
|
|
11
|
+
new FN001008_DEP_react('17'),
|
|
12
|
+
new FN001009_DEP_react_dom('17'),
|
|
13
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
14
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
15
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
16
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
17
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.5.2'),
|
|
18
|
+
new FN002022_DEVDEP_typescript('~5.8.0'),
|
|
19
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(true)
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=doctor-1.22.1.js.map
|
|
@@ -74,7 +74,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
74
74
|
'1.20.0',
|
|
75
75
|
'1.21.0',
|
|
76
76
|
'1.21.1',
|
|
77
|
-
'1.22.0
|
|
77
|
+
'1.22.0',
|
|
78
|
+
'1.22.1'
|
|
78
79
|
];
|
|
79
80
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
80
81
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN001034_DEP_microsoft_sp_adaptive_card_extension_base extends DependencyRule {
|
|
3
3
|
constructor(packageVersion) {
|
|
4
|
-
super('@microsoft/sp-adaptive-card-extension-base', packageVersion, false,
|
|
4
|
+
super('@microsoft/sp-adaptive-card-extension-base', packageVersion, false, true);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN001034';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002033_DEVDEP_css_loader extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('css-loader', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002033';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002033_DEVDEP_css_loader.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002034_DEVDEP_microsoft_spfx_heft_plugins extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@microsoft/spfx-heft-plugins', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002034';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002034_DEVDEP_microsoft_spfx_heft_plugins.js.map
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002035_DEVDEP_types_heft_jest.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002035_DEVDEP_types_heft_jest extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@types/heft-jest', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002035';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN002035_DEVDEP_types_heft_jest.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Rule } from '../../Rule.js';
|
|
2
|
+
import { stringUtil } from '../../../../../../utils/stringUtil.js';
|
|
2
3
|
export class FN014003_CODE_launch extends Rule {
|
|
3
|
-
constructor() {
|
|
4
|
+
constructor(contents) {
|
|
4
5
|
super();
|
|
6
|
+
this.contents = contents;
|
|
5
7
|
}
|
|
6
8
|
get id() {
|
|
7
9
|
return 'FN014003';
|
|
@@ -13,48 +15,7 @@ export class FN014003_CODE_launch extends Rule {
|
|
|
13
15
|
return `In the .vscode folder, add the launch.json file`;
|
|
14
16
|
}
|
|
15
17
|
get resolution() {
|
|
16
|
-
return
|
|
17
|
-
/**
|
|
18
|
-
Install Chrome Debugger Extension for Visual Studio Code
|
|
19
|
-
to debug your components with the Chrome browser:
|
|
20
|
-
https://aka.ms/spfx-debugger-extensions
|
|
21
|
-
*/
|
|
22
|
-
"version": "0.2.0",
|
|
23
|
-
"configurations": [{
|
|
24
|
-
"name": "Local workbench",
|
|
25
|
-
"type": "chrome",
|
|
26
|
-
"request": "launch",
|
|
27
|
-
"url": "https://localhost:4321/temp/workbench.html",
|
|
28
|
-
"webRoot": "\${workspaceRoot}",
|
|
29
|
-
"sourceMaps": true,
|
|
30
|
-
"sourceMapPathOverrides": {
|
|
31
|
-
"webpack:///../../../src/*": "\${webRoot}/src/*",
|
|
32
|
-
"webpack:///../../../../src/*": "\${webRoot}/src/*",
|
|
33
|
-
"webpack:///../../../../../src/*": "\${webRoot}/src/*"
|
|
34
|
-
},
|
|
35
|
-
"runtimeArgs": [
|
|
36
|
-
"--remote-debugging-port=9222"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "Hosted workbench",
|
|
41
|
-
"type": "chrome",
|
|
42
|
-
"request": "launch",
|
|
43
|
-
"url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
|
|
44
|
-
"webRoot": "\${workspaceRoot}",
|
|
45
|
-
"sourceMaps": true,
|
|
46
|
-
"sourceMapPathOverrides": {
|
|
47
|
-
"webpack:///../../../src/*": "\${webRoot}/src/*",
|
|
48
|
-
"webpack:///../../../../src/*": "\${webRoot}/src/*",
|
|
49
|
-
"webpack:///../../../../../src/*": "\${webRoot}/src/*"
|
|
50
|
-
},
|
|
51
|
-
"runtimeArgs": [
|
|
52
|
-
"--remote-debugging-port=9222",
|
|
53
|
-
"-incognito"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}`;
|
|
18
|
+
return this.contents;
|
|
58
19
|
}
|
|
59
20
|
get resolutionType() {
|
|
60
21
|
return 'json';
|
|
@@ -66,7 +27,9 @@ export class FN014003_CODE_launch extends Rule {
|
|
|
66
27
|
return '.vscode/launch.json';
|
|
67
28
|
}
|
|
68
29
|
visit(project, findings) {
|
|
69
|
-
if (!project.vsCode ||
|
|
30
|
+
if (!project.vsCode ||
|
|
31
|
+
!project.vsCode.launchJson ||
|
|
32
|
+
stringUtil.normalizeLineEndings(project.vsCode.launchJson.source) !== stringUtil.normalizeLineEndings(this.contents)) {
|
|
70
33
|
this.addFinding(findings);
|
|
71
34
|
}
|
|
72
35
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JsonRule } from "../../JsonRule.js";
|
|
2
2
|
export class FN021005_PKG_scripts_test extends JsonRule {
|
|
3
|
-
constructor(script) {
|
|
3
|
+
constructor(script, add = true) {
|
|
4
4
|
super();
|
|
5
5
|
this.script = script;
|
|
6
|
+
this.add = add;
|
|
6
7
|
}
|
|
7
8
|
get id() {
|
|
8
9
|
return 'FN021005';
|
|
@@ -11,12 +12,12 @@ export class FN021005_PKG_scripts_test extends JsonRule {
|
|
|
11
12
|
return 'package.json scripts.test';
|
|
12
13
|
}
|
|
13
14
|
get description() {
|
|
14
|
-
return 'Update package.json scripts.test property
|
|
15
|
+
return `${this.add ? 'Update' : 'Remove'} package.json scripts.test property`;
|
|
15
16
|
}
|
|
16
17
|
get resolution() {
|
|
17
18
|
return `{
|
|
18
19
|
"scripts": {
|
|
19
|
-
"test": "${this.script}"
|
|
20
|
+
"test": ${this.add ? `"${this.script}"` : '""'}
|
|
20
21
|
}
|
|
21
22
|
}`;
|
|
22
23
|
}
|
|
@@ -33,12 +34,20 @@ export class FN021005_PKG_scripts_test extends JsonRule {
|
|
|
33
34
|
if (!project.packageJson) {
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
if (this.add) {
|
|
38
|
+
if (!project.packageJson.scripts ||
|
|
39
|
+
typeof project.packageJson.scripts !== 'object' ||
|
|
40
|
+
!project.packageJson.scripts.test ||
|
|
41
|
+
project.packageJson.scripts.test !== this.script) {
|
|
42
|
+
const node = this.getAstNodeFromFile(project.packageJson, 'scripts.test');
|
|
43
|
+
this.addFindingWithPosition(findings, node);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if (project.packageJson.scripts?.test === this.script) {
|
|
48
|
+
const node = this.getAstNodeFromFile(project.packageJson, 'scripts.test');
|
|
49
|
+
this.addFindingWithPosition(findings, node);
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JsonRule } from "../../JsonRule.js";
|
|
2
|
-
export class
|
|
2
|
+
export class FN021007_PKG_scripts_start extends JsonRule {
|
|
3
3
|
constructor(script) {
|
|
4
4
|
super();
|
|
5
5
|
this.script = script;
|
|
6
6
|
}
|
|
7
7
|
get id() {
|
|
8
|
-
return '
|
|
8
|
+
return 'FN021007';
|
|
9
9
|
}
|
|
10
10
|
get title() {
|
|
11
11
|
return 'package.json scripts.start';
|
|
@@ -42,4 +42,4 @@ export class FN021008_PKG_scripts_start extends JsonRule {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=FN021007_PKG_scripts_start.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JsonRule } from "../../JsonRule.js";
|
|
2
|
-
export class
|
|
2
|
+
export class FN021008_PKG_scripts_eject_webpack extends JsonRule {
|
|
3
3
|
constructor(script) {
|
|
4
4
|
super();
|
|
5
5
|
this.script = script;
|
|
6
6
|
}
|
|
7
7
|
get id() {
|
|
8
|
-
return '
|
|
8
|
+
return 'FN021008';
|
|
9
9
|
}
|
|
10
10
|
get title() {
|
|
11
11
|
return 'package.json scripts.eject-webpack';
|
|
@@ -42,4 +42,4 @@ export class FN021012_PKG_scripts_eject_webpack extends JsonRule {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=FN021008_PKG_scripts_eject_webpack.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JsonRule } from "../../JsonRule.js";
|
|
2
|
-
export class
|
|
2
|
+
export class FN021009_PKG_overrides_rushstack_heft extends JsonRule {
|
|
3
3
|
constructor(version) {
|
|
4
4
|
super();
|
|
5
5
|
this.version = version;
|
|
6
6
|
}
|
|
7
7
|
get id() {
|
|
8
|
-
return '
|
|
8
|
+
return 'FN021009';
|
|
9
9
|
}
|
|
10
10
|
get title() {
|
|
11
11
|
return 'package.json overrides.@rushstack/heft';
|
|
@@ -42,4 +42,4 @@ export class FN021013_PKG_overrides_rushstack_heft extends JsonRule {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=FN021009_PKG_overrides_rushstack_heft.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
import { TsRule } from './TsRule.js';
|
|
4
|
+
export class FN025002_ESLINTRCJS_rushstack_import_requires_chunk_name extends TsRule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
get id() {
|
|
9
|
+
return 'FN025002';
|
|
10
|
+
}
|
|
11
|
+
get title() {
|
|
12
|
+
return '.eslintrc.js override rule @rushstack/import-requires-chunk-name';
|
|
13
|
+
}
|
|
14
|
+
get description() {
|
|
15
|
+
return `Add override rule @rushstack/import-requires-chunk-name in .eslintrc.js`;
|
|
16
|
+
}
|
|
17
|
+
get resolution() {
|
|
18
|
+
return `// Require chunk names for dynamic imports in SPFx projects. https://www.npmjs.com/package/@rushstack/eslint-plugin
|
|
19
|
+
'@rushstack/import-requires-chunk-name': 1,${os.EOL}`;
|
|
20
|
+
}
|
|
21
|
+
get resolutionType() {
|
|
22
|
+
return 'js';
|
|
23
|
+
}
|
|
24
|
+
get severity() {
|
|
25
|
+
return 'Required';
|
|
26
|
+
}
|
|
27
|
+
get file() {
|
|
28
|
+
return './.eslintrc.js';
|
|
29
|
+
}
|
|
30
|
+
visit(project, findings) {
|
|
31
|
+
if (!project.esLintRcJs) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const nodes = project.esLintRcJs.nodes;
|
|
35
|
+
if (!nodes) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const occurrences = [];
|
|
39
|
+
if (nodes
|
|
40
|
+
.filter(node => ts.isPropertyName(node))
|
|
41
|
+
.map(node => node)
|
|
42
|
+
.filter(i => i.getText() === `'@rushstack/import-requires-chunk-name'`).length !== 0) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const node = nodes
|
|
46
|
+
.map(node => node)
|
|
47
|
+
.find(i => i.text === 'rules');
|
|
48
|
+
if (!node) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.addOccurrence(this.resolution, project.esLintRcJs.path, project.path, node, occurrences);
|
|
52
|
+
if (occurrences.length > 0) {
|
|
53
|
+
this.addFindingWithOccurrences(occurrences, findings);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=FN025002_ESLINTRCJS_rushstack_import_requires_chunk_name.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
import { TsRule } from './TsRule.js';
|
|
4
|
+
export class FN025003_ESLINTRCJS_rushstack_pair_react_dom_render_unmount extends TsRule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
get id() {
|
|
9
|
+
return 'FN025003';
|
|
10
|
+
}
|
|
11
|
+
get title() {
|
|
12
|
+
return '.eslintrc.js override rule @rushstack/pair-react-dom-render-unmount';
|
|
13
|
+
}
|
|
14
|
+
get description() {
|
|
15
|
+
return `Add override rule @rushstack/pair-react-dom-render-unmount in .eslintrc.js`;
|
|
16
|
+
}
|
|
17
|
+
get resolution() {
|
|
18
|
+
return `// Ensure that React components rendered with ReactDOM.render() are unmounted with ReactDOM.unmountComponentAtNode(). https://www.npmjs.com/package/@rushstack/eslint-plugin
|
|
19
|
+
'@rushstack/pair-react-dom-render-unmount': 1,${os.EOL}`;
|
|
20
|
+
}
|
|
21
|
+
get resolutionType() {
|
|
22
|
+
return 'js';
|
|
23
|
+
}
|
|
24
|
+
get severity() {
|
|
25
|
+
return 'Required';
|
|
26
|
+
}
|
|
27
|
+
get file() {
|
|
28
|
+
return './.eslintrc.js';
|
|
29
|
+
}
|
|
30
|
+
visit(project, findings) {
|
|
31
|
+
if (!project.esLintRcJs) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const nodes = project.esLintRcJs.nodes;
|
|
35
|
+
if (!nodes) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const occurrences = [];
|
|
39
|
+
if (nodes
|
|
40
|
+
.filter(node => ts.isPropertyName(node))
|
|
41
|
+
.map(node => node)
|
|
42
|
+
.filter(i => i.getText() === `'@rushstack/pair-react-dom-render-unmount'`).length !== 0) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const node = nodes
|
|
46
|
+
.map(node => node)
|
|
47
|
+
.find(i => i.text === 'rules');
|
|
48
|
+
if (!node) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.addOccurrence(this.resolution, project.esLintRcJs.path, project.path, node, occurrences);
|
|
52
|
+
if (occurrences.length > 0) {
|
|
53
|
+
this.addFindingWithOccurrences(occurrences, findings);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=FN025003_ESLINTRCJS_rushstack_pair_react_dom_render_unmount.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { TsRule } from './TsRule.js';
|
|
3
|
+
export class FN025004_ESLINTRCJS_microsoft_spfx_import_requires_chunk_name extends TsRule {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN025004';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return '.eslintrc.js override rule @microsoft/spfx/import-requires-chunk-name';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Remove override rule @microsoft/spfx/import-requires-chunk-name in .eslintrc.js`;
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
get resolutionType() {
|
|
20
|
+
return 'js';
|
|
21
|
+
}
|
|
22
|
+
get severity() {
|
|
23
|
+
return 'Required';
|
|
24
|
+
}
|
|
25
|
+
get file() {
|
|
26
|
+
return './.eslintrc.js';
|
|
27
|
+
}
|
|
28
|
+
visit(project, findings) {
|
|
29
|
+
if (!project.esLintRcJs) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const nodes = project.esLintRcJs.nodes;
|
|
33
|
+
if (!nodes) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const occurrences = [];
|
|
37
|
+
const node = nodes
|
|
38
|
+
.filter(node => ts.isPropertyName(node))
|
|
39
|
+
.map(node => node)
|
|
40
|
+
.find(i => i.getText() === `'@microsoft/spfx/import-requires-chunk-name'`);
|
|
41
|
+
if (!node) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.addOccurrence(this.resolution, project.esLintRcJs.path, project.path, node, occurrences);
|
|
45
|
+
if (occurrences.length > 0) {
|
|
46
|
+
this.addFindingWithOccurrences(occurrences, findings);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=FN025004_ESLINTRCJS_microsoft_spfx_import_requires_chunk_name.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { TsRule } from './TsRule.js';
|
|
3
|
+
export class FN025005_ESLINTRCJS_microsoft_spfx_pair_react_dom_render_unmount extends TsRule {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return 'FN025005';
|
|
9
|
+
}
|
|
10
|
+
get title() {
|
|
11
|
+
return '.eslintrc.js override rule @microsoft/spfx/pair-react-dom-render-unmount';
|
|
12
|
+
}
|
|
13
|
+
get description() {
|
|
14
|
+
return `Remove override rule @microsoft/spfx/pair-react-dom-render-unmount in .eslintrc.js`;
|
|
15
|
+
}
|
|
16
|
+
get resolution() {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
get resolutionType() {
|
|
20
|
+
return 'js';
|
|
21
|
+
}
|
|
22
|
+
get severity() {
|
|
23
|
+
return 'Required';
|
|
24
|
+
}
|
|
25
|
+
get file() {
|
|
26
|
+
return './.eslintrc.js';
|
|
27
|
+
}
|
|
28
|
+
visit(project, findings) {
|
|
29
|
+
if (!project.esLintRcJs) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const nodes = project.esLintRcJs.nodes;
|
|
33
|
+
if (!nodes) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const occurrences = [];
|
|
37
|
+
const node = nodes
|
|
38
|
+
.filter(node => ts.isPropertyName(node))
|
|
39
|
+
.map(node => node)
|
|
40
|
+
.find(i => i.getText() === `'@microsoft/spfx/pair-react-dom-render-unmount'`);
|
|
41
|
+
if (!node) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.addOccurrence(this.resolution, project.esLintRcJs.path, project.path, node, occurrences);
|
|
45
|
+
if (occurrences.length > 0) {
|
|
46
|
+
this.addFindingWithOccurrences(occurrences, findings);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=FN025005_ESLINTRCJS_microsoft_spfx_pair_react_dom_render_unmount.js.map
|