@pnp/cli-microsoft365 11.5.0 → 11.6.0-beta.ab6d130
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/docs/docs/cmd/entra/user/user-add.mdx +25 -6
- package/docs/docs/cmd/entra/user/user-get.mdx +19 -2
- package/docs/docs/cmd/entra/user/user-hibp.mdx +4 -0
- package/docs/docs/cmd/entra/user/user-list.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-remove.mdx +26 -5
- package/docs/docs/cmd/entra/user/user-set.mdx +27 -0
- package/docs/docs/cmd/spo/file/file-copy.mdx +1 -1
- package/npm-shrinkwrap.json +541 -288
- package/package.json +17 -17
- package/eslint-rules/lib/index.js +0 -5
- package/eslint-rules/lib/rules/correct-command-class-name.js +0 -132
- package/eslint-rules/lib/rules/correct-command-name.js +0 -65
- package/eslint-rules/lib/rules/no-by-server-relative-url-usage.js +0 -55
- package/eslint-rules/package-lock.json +0 -12
- package/eslint-rules/package.json +0 -5
- package/eslint.config.mjs +0 -273
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.0-beta.ab6d130",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/api.js",
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"Freese, Luise <49960482+LuiseFreese@users.noreply.github.com>",
|
|
156
156
|
"Georgiev, Velin <velin.georgiev@gmail.com>",
|
|
157
157
|
"Ghuge, Pramod <pramod7@gmail.com>",
|
|
158
|
+
"Gispert, Alejandro <alejandrobusiness2022@gmail.com>",
|
|
158
159
|
"Gölles, Thomas <thomy@outlook.at>",
|
|
159
160
|
"Greuel, Dan <dgreuel@gmail.com>",
|
|
160
161
|
"Haerkens, Stijn <118855980+stijnhaerkenss@users.noreply.github.com>",
|
|
@@ -270,20 +271,20 @@
|
|
|
270
271
|
"Zachariassen Laksafoss, Trygvi <trygvi.laksafoss@gmail.com>"
|
|
271
272
|
],
|
|
272
273
|
"dependencies": {
|
|
273
|
-
"@azure/msal-common": "^15.
|
|
274
|
-
"@azure/msal-node": "^3.8.
|
|
275
|
-
"@inquirer/confirm": "^6.0.
|
|
276
|
-
"@inquirer/input": "^5.0.
|
|
277
|
-
"@inquirer/select": "^5.0
|
|
274
|
+
"@azure/msal-common": "^15.15.0",
|
|
275
|
+
"@azure/msal-node": "^3.8.8",
|
|
276
|
+
"@inquirer/confirm": "^6.0.8",
|
|
277
|
+
"@inquirer/input": "^5.0.8",
|
|
278
|
+
"@inquirer/select": "^5.1.0",
|
|
278
279
|
"@xmldom/xmldom": "^0.9.8",
|
|
279
280
|
"adaptive-expressions": "^4.23.3",
|
|
280
281
|
"adaptivecards": "^3.0.5",
|
|
281
282
|
"adaptivecards-templating": "^2.3.1",
|
|
282
283
|
"adm-zip": "^0.5.16",
|
|
283
|
-
"applicationinsights": "^3.
|
|
284
|
-
"axios": "^1.13.
|
|
284
|
+
"applicationinsights": "^3.14.0",
|
|
285
|
+
"axios": "^1.13.6",
|
|
285
286
|
"chalk": "^5.6.2",
|
|
286
|
-
"clipboardy": "^5.1
|
|
287
|
+
"clipboardy": "^5.3.1",
|
|
287
288
|
"configstore": "^8.0.0",
|
|
288
289
|
"csv-parse": "^6.1.0",
|
|
289
290
|
"csv-stringify": "^6.6.0",
|
|
@@ -293,7 +294,7 @@
|
|
|
293
294
|
"node-forge": "^1.3.3",
|
|
294
295
|
"omelette": "^0.4.17",
|
|
295
296
|
"open": "^11.0.0",
|
|
296
|
-
"semver": "^7.7.
|
|
297
|
+
"semver": "^7.7.4",
|
|
297
298
|
"strip-json-comments": "^5.0.3",
|
|
298
299
|
"typescript": "^5.9.3",
|
|
299
300
|
"update-notifier": "^7.3.1",
|
|
@@ -305,13 +306,13 @@
|
|
|
305
306
|
"devDependencies": {
|
|
306
307
|
"@actions/core": "^3.0.0",
|
|
307
308
|
"@microsoft/microsoft-graph-types": "^2.43.1",
|
|
308
|
-
"@stylistic/eslint-plugin": "^5.
|
|
309
|
+
"@stylistic/eslint-plugin": "^5.9.0",
|
|
309
310
|
"@types/adm-zip": "^0.5.7",
|
|
310
311
|
"@types/jmespath": "^0.15.2",
|
|
311
312
|
"@types/json-schema": "^7.0.15",
|
|
312
313
|
"@types/json-to-ast": "^2.1.4",
|
|
313
314
|
"@types/mocha": "^10.0.10",
|
|
314
|
-
"@types/node": "^24.
|
|
315
|
+
"@types/node": "^24.11.0",
|
|
315
316
|
"@types/node-forge": "^1.3.14",
|
|
316
317
|
"@types/omelette": "^0.4.5",
|
|
317
318
|
"@types/semver": "^7.7.1",
|
|
@@ -319,16 +320,15 @@
|
|
|
319
320
|
"@types/update-notifier": "^6.0.8",
|
|
320
321
|
"@types/uuid": "^10.0.0",
|
|
321
322
|
"@types/yargs-parser": "^21.0.3",
|
|
322
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
323
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
323
324
|
"@typescript-eslint/parser": "^8.46.4",
|
|
324
325
|
"c8": "^10.1.3",
|
|
325
|
-
"eslint": "^9.39.
|
|
326
|
-
"eslint-plugin-cli-microsoft365": "file:eslint-rules",
|
|
326
|
+
"eslint": "^9.39.3",
|
|
327
327
|
"eslint-plugin-mocha": "^11.2.0",
|
|
328
328
|
"mocha": "^11.7.5",
|
|
329
|
-
"rimraf": "^6.1.
|
|
329
|
+
"rimraf": "^6.1.3",
|
|
330
330
|
"sinon": "^21.0.1",
|
|
331
331
|
"source-map-support": "^0.5.21",
|
|
332
332
|
"tsc-watch": "^7.2.0"
|
|
333
333
|
}
|
|
334
|
-
}
|
|
334
|
+
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
function getClassNameFromFilePath(filePath, dictionary, capitalized) {
|
|
2
|
-
const pos = filePath.indexOf('/src/m365/');
|
|
3
|
-
if (pos < 0) {
|
|
4
|
-
// not a command file
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// /src/m365/ = 10
|
|
9
|
-
const relativePath = filePath.substr(pos + 10);
|
|
10
|
-
let segments = relativePath.split('/');
|
|
11
|
-
segments.splice(segments.indexOf('commands'), 1);
|
|
12
|
-
|
|
13
|
-
// remove command prefix
|
|
14
|
-
const length = segments.length;
|
|
15
|
-
if (length > 1) {
|
|
16
|
-
const commandPrefix = segments[length - 2];
|
|
17
|
-
segments[length - 1] = segments[length - 1].replace(`${commandPrefix}-`, '');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// replace last element of array with split words
|
|
21
|
-
segments.push(...segments.pop().replace('.ts', '').split('-'));
|
|
22
|
-
|
|
23
|
-
const words = segments
|
|
24
|
-
.map(s => breakWords(s, dictionary))
|
|
25
|
-
.flat()
|
|
26
|
-
.map(w => capitalizeWord(w, capitalized))
|
|
27
|
-
|
|
28
|
-
const commandName = [
|
|
29
|
-
...words,
|
|
30
|
-
'Command'
|
|
31
|
-
].join('');
|
|
32
|
-
|
|
33
|
-
return commandName;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function capitalizeWord(word, capitalized) {
|
|
37
|
-
const capitalizedWord = capitalized.find(c => c.toLowerCase() === word);
|
|
38
|
-
if (capitalizedWord) {
|
|
39
|
-
return capitalizedWord;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return word.substr(0, 1).toUpperCase() + word.substr(1).toLowerCase();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function breakWords(longWord, dictionary) {
|
|
46
|
-
const words = [];
|
|
47
|
-
for (let i = 0; i < dictionary.length; i++) {
|
|
48
|
-
if (longWord.indexOf(dictionary[i]) === 0) {
|
|
49
|
-
words.push(dictionary[i]);
|
|
50
|
-
longWord = longWord.replace(dictionary[i], '');
|
|
51
|
-
i = -1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (longWord) {
|
|
56
|
-
words.push(longWord);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return words;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
module.exports = {
|
|
63
|
-
// exported for testing
|
|
64
|
-
getClassNameFromFilePath: getClassNameFromFilePath,
|
|
65
|
-
breakWords: breakWords,
|
|
66
|
-
meta: {
|
|
67
|
-
type: 'problem',
|
|
68
|
-
docs: {
|
|
69
|
-
description: 'Incorrect command class name',
|
|
70
|
-
suggestion: true
|
|
71
|
-
},
|
|
72
|
-
fixable: 'code',
|
|
73
|
-
messages: {
|
|
74
|
-
invalidName: "'{{ actualClassName }}' is not a valid command class name. Expected '{{ expectedClassName }}'"
|
|
75
|
-
},
|
|
76
|
-
schema: [
|
|
77
|
-
{
|
|
78
|
-
type: 'array',
|
|
79
|
-
items: { type: 'string' },
|
|
80
|
-
uniqueItems: true,
|
|
81
|
-
title: 'dictionary',
|
|
82
|
-
description: 'List of known word parts used to break long command names into words.'
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
type: 'array',
|
|
86
|
-
items: { type: 'string' },
|
|
87
|
-
uniqueItems: true,
|
|
88
|
-
title: 'capitalized',
|
|
89
|
-
description: 'List of known word parts that should be capitalized.'
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
create: context => {
|
|
94
|
-
return {
|
|
95
|
-
'ClassDeclaration': function (node) {
|
|
96
|
-
if (node.abstract) {
|
|
97
|
-
// command classes are not abstract
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (!node.superClass) {
|
|
102
|
-
// class doesn't inherit from another class
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (node.superClass.name.indexOf('Command') < 0) {
|
|
107
|
-
// class doesn't inherit from a command class
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const expectedClassName = getClassNameFromFilePath(context.getFilename(), context.options[0], context.options[1]);
|
|
112
|
-
if (!expectedClassName) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const actualClassName = node.id.name;
|
|
117
|
-
|
|
118
|
-
if (actualClassName !== expectedClassName) {
|
|
119
|
-
context.report({
|
|
120
|
-
node: node.id,
|
|
121
|
-
messageId: 'invalidName',
|
|
122
|
-
data: {
|
|
123
|
-
actualClassName,
|
|
124
|
-
expectedClassName
|
|
125
|
-
},
|
|
126
|
-
fix: fixer => fixer.replaceText(node.id, expectedClassName)
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
function getConstNameFromFilePath(filePath) {
|
|
2
|
-
const pos = filePath.indexOf('/src/m365/');
|
|
3
|
-
if (pos < 0) {
|
|
4
|
-
// not a command file
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// /src/m365/ = 10
|
|
9
|
-
const relativePath = filePath.substr(pos + 10);
|
|
10
|
-
const segments = relativePath.split('/');
|
|
11
|
-
segments.splice(segments.indexOf('commands'), 1);
|
|
12
|
-
|
|
13
|
-
const length = segments.length;
|
|
14
|
-
if (length === 2) {
|
|
15
|
-
// remove service from the command file name
|
|
16
|
-
segments[1] = segments[1].replace(`${segments[0]}-`, '');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const constName = segments.pop()
|
|
20
|
-
.replace('.ts', '')
|
|
21
|
-
.split('-')
|
|
22
|
-
.map(w => w.toUpperCase())
|
|
23
|
-
.join('_');
|
|
24
|
-
|
|
25
|
-
return constName;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// unfortunately we can't auto-fix this rule because the
|
|
29
|
-
// const needs to be changed where it's defined rather than
|
|
30
|
-
// where it's used
|
|
31
|
-
module.exports = {
|
|
32
|
-
meta: {
|
|
33
|
-
type: 'problem',
|
|
34
|
-
docs: {
|
|
35
|
-
description: 'Incorrect command name',
|
|
36
|
-
suggestion: true
|
|
37
|
-
},
|
|
38
|
-
messages: {
|
|
39
|
-
invalidName: "'{{ actualConstName }}' is not a valid command name. Expected '{{ expectedConstName }}'"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
create: context => {
|
|
43
|
-
return {
|
|
44
|
-
'MethodDefinition[key.name = "name"] MemberExpression > Identifier[name != "commands"]': function (node) {
|
|
45
|
-
const actualConstName = node.name;
|
|
46
|
-
const expectedConstName = getConstNameFromFilePath(context.getFilename());
|
|
47
|
-
|
|
48
|
-
if (!expectedConstName) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (actualConstName !== expectedConstName) {
|
|
53
|
-
context.report({
|
|
54
|
-
node: node,
|
|
55
|
-
messageId: 'invalidName',
|
|
56
|
-
data: {
|
|
57
|
-
actualConstName,
|
|
58
|
-
expectedConstName
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function reportIncorrectEndpoint(context, node, urlEndpoint, pathEndpoint, updatedValue) {
|
|
2
|
-
context.report({
|
|
3
|
-
node,
|
|
4
|
-
messageId: 'incorrectEndpoint',
|
|
5
|
-
data: { urlEndpoint, pathEndpoint },
|
|
6
|
-
fix: fixer => fixer.replaceText(node, updatedValue),
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
meta: {
|
|
12
|
-
type: 'problem',
|
|
13
|
-
docs: {
|
|
14
|
-
description: "Prevent usage of 'ByServerRelativeUrl' endpoint",
|
|
15
|
-
recommended: true
|
|
16
|
-
},
|
|
17
|
-
fixable: 'code',
|
|
18
|
-
messages: {
|
|
19
|
-
incorrectEndpoint: `Avoid "{{ urlEndpoint }}" endpoint. Instead, use "{{ pathEndpoint }}". Reference issue #5333 for more information.`
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
create: context => {
|
|
23
|
-
return {
|
|
24
|
-
TemplateLiteral(node) {
|
|
25
|
-
const sourceCodeText = context.getSourceCode().getText(node);
|
|
26
|
-
const updatedValue = sourceCodeText
|
|
27
|
-
.replace(/GetFileByServerRelativeUrl\(/ig, 'GetFileByServerRelativePath(DecodedUrl=')
|
|
28
|
-
.replace(/GetFolderByServerRelativeUrl\(/ig, 'GetFolderByServerRelativePath(DecodedUrl=');
|
|
29
|
-
|
|
30
|
-
if (updatedValue !== sourceCodeText) {
|
|
31
|
-
const templateValue = node.quasis.map(quasi => quasi.value.raw).join('');
|
|
32
|
-
const urlEndpoint = templateValue.match(/GetFileByServerRelativeUrl\(/i) ? "GetFileByServerRelativeUrl('url')" : "GetFolderByServerRelativeUrl('url')";
|
|
33
|
-
const pathEndpoint = urlEndpoint.replace("Url('url')", "Path(DecodedUrl='url')");
|
|
34
|
-
|
|
35
|
-
reportIncorrectEndpoint(context, node, urlEndpoint, pathEndpoint, updatedValue);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
VariableDeclarator(node) {
|
|
39
|
-
const { init } = node;
|
|
40
|
-
if (
|
|
41
|
-
init && init.type === 'Literal' &&
|
|
42
|
-
(String(init.value).match(/GetFileByServerRelativeUrl\(/i) || String(init.value).match(/GetFolderByServerRelativeUrl\(/i))
|
|
43
|
-
) {
|
|
44
|
-
const urlEndpoint = String(init.value).match(/GetFileByServerRelativeUrl\(/i) ? "GetFileByServerRelativeUrl('url')" : "GetFolderByServerRelativeUrl('url')";
|
|
45
|
-
const pathEndpoint = urlEndpoint.replace("Url('url')", "Path(DecodedUrl='url')");
|
|
46
|
-
const updatedValue = String(init.value)
|
|
47
|
-
.replace(/GetFileByServerRelativeUrl\(/i, 'GetFileByServerRelativePath(DecodedUrl=')
|
|
48
|
-
.replace(/GetFolderByServerRelativeUrl\(/i, 'GetFolderByServerRelativePath(DecodedUrl=');
|
|
49
|
-
|
|
50
|
-
reportIncorrectEndpoint(context, init, urlEndpoint, pathEndpoint, `'${updatedValue}'`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
};
|
package/eslint.config.mjs
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import globals from 'globals';
|
|
2
|
-
import js from '@eslint/js';
|
|
3
|
-
import parser from '@typescript-eslint/parser';
|
|
4
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
5
|
-
import mocha from 'eslint-plugin-mocha';
|
|
6
|
-
import stylistic from '@stylistic/eslint-plugin';
|
|
7
|
-
import cliM365 from './eslint-rules/lib/index.js';
|
|
8
|
-
|
|
9
|
-
// List of words used in command names used for word breaking
|
|
10
|
-
// Sorted alphabetically for easy maintenance
|
|
11
|
-
const dictionary = [
|
|
12
|
-
'access',
|
|
13
|
-
'activation',
|
|
14
|
-
'activations',
|
|
15
|
-
'adaptive',
|
|
16
|
-
'administrative',
|
|
17
|
-
'ai',
|
|
18
|
-
'app',
|
|
19
|
-
'application',
|
|
20
|
-
'apply',
|
|
21
|
-
'approve',
|
|
22
|
-
'assessment',
|
|
23
|
-
'assets',
|
|
24
|
-
'assignment',
|
|
25
|
-
'audit',
|
|
26
|
-
'autofill',
|
|
27
|
-
'azure',
|
|
28
|
-
'bin',
|
|
29
|
-
'brand',
|
|
30
|
-
'builder',
|
|
31
|
-
'call',
|
|
32
|
-
'card',
|
|
33
|
-
'catalog',
|
|
34
|
-
'center',
|
|
35
|
-
'checklist',
|
|
36
|
-
'client',
|
|
37
|
-
'comm',
|
|
38
|
-
'command',
|
|
39
|
-
'community',
|
|
40
|
-
'container',
|
|
41
|
-
'content',
|
|
42
|
-
'conversation',
|
|
43
|
-
'custom',
|
|
44
|
-
'customizer',
|
|
45
|
-
'dataverse',
|
|
46
|
-
'default',
|
|
47
|
-
'definition',
|
|
48
|
-
'dev',
|
|
49
|
-
'details',
|
|
50
|
-
'directory',
|
|
51
|
-
'eligibility',
|
|
52
|
-
'enterprise',
|
|
53
|
-
'entra',
|
|
54
|
-
'event',
|
|
55
|
-
'eventreceiver',
|
|
56
|
-
'external',
|
|
57
|
-
'externalize',
|
|
58
|
-
'folder',
|
|
59
|
-
'fun',
|
|
60
|
-
'group',
|
|
61
|
-
'groupify',
|
|
62
|
-
'groupmembership',
|
|
63
|
-
'guest',
|
|
64
|
-
'health',
|
|
65
|
-
'hide',
|
|
66
|
-
'historical',
|
|
67
|
-
'home',
|
|
68
|
-
'hub',
|
|
69
|
-
'in',
|
|
70
|
-
'info',
|
|
71
|
-
'inheritance',
|
|
72
|
-
'init',
|
|
73
|
-
'install',
|
|
74
|
-
'installed',
|
|
75
|
-
'is',
|
|
76
|
-
'issue',
|
|
77
|
-
'item',
|
|
78
|
-
'label',
|
|
79
|
-
'list',
|
|
80
|
-
'link',
|
|
81
|
-
'log',
|
|
82
|
-
'login',
|
|
83
|
-
'logout',
|
|
84
|
-
'mailbox',
|
|
85
|
-
'management',
|
|
86
|
-
'member',
|
|
87
|
-
'membership',
|
|
88
|
-
'messaging',
|
|
89
|
-
'model',
|
|
90
|
-
'multitenant',
|
|
91
|
-
'm365',
|
|
92
|
-
'news',
|
|
93
|
-
'oauth2',
|
|
94
|
-
'office365',
|
|
95
|
-
'one',
|
|
96
|
-
'open',
|
|
97
|
-
'ops',
|
|
98
|
-
'org',
|
|
99
|
-
'organization',
|
|
100
|
-
'owner',
|
|
101
|
-
'permission',
|
|
102
|
-
'pim',
|
|
103
|
-
'place',
|
|
104
|
-
'policy',
|
|
105
|
-
'profile',
|
|
106
|
-
'pronouns',
|
|
107
|
-
'property',
|
|
108
|
-
'record',
|
|
109
|
-
'records',
|
|
110
|
-
'recycle',
|
|
111
|
-
'registration',
|
|
112
|
-
'request',
|
|
113
|
-
'resolver',
|
|
114
|
-
'retention',
|
|
115
|
-
'revoke',
|
|
116
|
-
'role',
|
|
117
|
-
'room',
|
|
118
|
-
'schema',
|
|
119
|
-
'search',
|
|
120
|
-
'sensitivity',
|
|
121
|
-
'service',
|
|
122
|
-
'session',
|
|
123
|
-
'set',
|
|
124
|
-
'setting',
|
|
125
|
-
'settings',
|
|
126
|
-
'setup',
|
|
127
|
-
'sharing',
|
|
128
|
-
'side',
|
|
129
|
-
'site',
|
|
130
|
-
'status',
|
|
131
|
-
'storage',
|
|
132
|
-
'table',
|
|
133
|
-
'teams',
|
|
134
|
-
'threat',
|
|
135
|
-
'to',
|
|
136
|
-
'todo',
|
|
137
|
-
'token',
|
|
138
|
-
'type',
|
|
139
|
-
'unit',
|
|
140
|
-
'url',
|
|
141
|
-
'user',
|
|
142
|
-
'value',
|
|
143
|
-
'web',
|
|
144
|
-
'webhook'
|
|
145
|
-
];
|
|
146
|
-
|
|
147
|
-
// List of words that should be capitalized in a specific way
|
|
148
|
-
const capitalized = [
|
|
149
|
-
'OAuth2'
|
|
150
|
-
];
|
|
151
|
-
|
|
152
|
-
// Sort dictionary to put the longest words first
|
|
153
|
-
const sortedDictionary = dictionary.sort((a, b) => b.length - a.length);
|
|
154
|
-
|
|
155
|
-
export default [
|
|
156
|
-
// Ignored files
|
|
157
|
-
{
|
|
158
|
-
ignores: [
|
|
159
|
-
"**/package-generate/assets/**",
|
|
160
|
-
"**/test-projects/**",
|
|
161
|
-
"clientsidepages.ts",
|
|
162
|
-
"**/*.d.ts",
|
|
163
|
-
"**/*.js",
|
|
164
|
-
"**/*.cjs"
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
// JS recommendations
|
|
168
|
-
js.configs.recommended,
|
|
169
|
-
{
|
|
170
|
-
plugins: { '@typescript-eslint': tsPlugin },
|
|
171
|
-
rules: tsPlugin.configs.recommended.rules
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
languageOptions: {
|
|
175
|
-
ecmaVersion: 2015,
|
|
176
|
-
sourceType: 'module',
|
|
177
|
-
parser: parser,
|
|
178
|
-
parserOptions: {
|
|
179
|
-
ecmaVersion: 2015,
|
|
180
|
-
sourceType: 'module',
|
|
181
|
-
project: './tsconfig.json'
|
|
182
|
-
},
|
|
183
|
-
globals: {
|
|
184
|
-
...globals.node,
|
|
185
|
-
...globals.commonjs,
|
|
186
|
-
...globals.es2021,
|
|
187
|
-
...globals.mocha,
|
|
188
|
-
NodeJS: 'readonly'
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
plugins: {
|
|
192
|
-
'@typescript-eslint': tsPlugin,
|
|
193
|
-
'cli-microsoft365': cliM365,
|
|
194
|
-
'@stylistic': stylistic,
|
|
195
|
-
mocha
|
|
196
|
-
},
|
|
197
|
-
rules: {
|
|
198
|
-
'cli-microsoft365/correct-command-class-name': ['error', sortedDictionary, capitalized],
|
|
199
|
-
'cli-microsoft365/correct-command-name': 'error',
|
|
200
|
-
'cli-microsoft365/no-by-server-relative-url-usage': 'error',
|
|
201
|
-
'@stylistic/indent': ['error', 2],
|
|
202
|
-
'@stylistic/semi': ['error'],
|
|
203
|
-
'@stylistic/comma-dangle': ['error', 'never'],
|
|
204
|
-
'@stylistic/brace-style': [
|
|
205
|
-
'error',
|
|
206
|
-
'stroustrup',
|
|
207
|
-
{ allowSingleLine: true }
|
|
208
|
-
],
|
|
209
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
210
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
211
|
-
'@typescript-eslint/no-inferrable-types': 'off',
|
|
212
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
213
|
-
'@typescript-eslint/explicit-module-boundary-types': [
|
|
214
|
-
'error',
|
|
215
|
-
{ allowArgumentsExplicitlyTypedAsAny: true }
|
|
216
|
-
],
|
|
217
|
-
'@typescript-eslint/no-unused-vars': [
|
|
218
|
-
'error',
|
|
219
|
-
{ argsIgnorePattern: '^_' }
|
|
220
|
-
],
|
|
221
|
-
camelcase: ['error', {
|
|
222
|
-
allow: [
|
|
223
|
-
'child_process',
|
|
224
|
-
'error_description',
|
|
225
|
-
'_Child_Items_',
|
|
226
|
-
'_Object_Type_',
|
|
227
|
-
'FN\\d+',
|
|
228
|
-
'OData__.*',
|
|
229
|
-
'vti_.*',
|
|
230
|
-
'Query.*',
|
|
231
|
-
'app_displayname',
|
|
232
|
-
'access_token',
|
|
233
|
-
'expires_on',
|
|
234
|
-
'extension_*'
|
|
235
|
-
]
|
|
236
|
-
}],
|
|
237
|
-
curly: ['error', 'all'],
|
|
238
|
-
eqeqeq: ['error', 'always'],
|
|
239
|
-
'@typescript-eslint/naming-convention': [
|
|
240
|
-
'error',
|
|
241
|
-
{
|
|
242
|
-
selector: ['method'],
|
|
243
|
-
format: ['camelCase']
|
|
244
|
-
}
|
|
245
|
-
],
|
|
246
|
-
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
|
|
247
|
-
'mocha/no-identical-title': 'error',
|
|
248
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
249
|
-
'@typescript-eslint/no-empty-function': 'error'
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
files: ['**/*.spec.ts'],
|
|
254
|
-
rules: {
|
|
255
|
-
'no-console': 'error',
|
|
256
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
257
|
-
'cli-microsoft365/correct-command-class-name': 'off',
|
|
258
|
-
'cli-microsoft365/correct-command-name': 'off'
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
files: ['**/viva/commands/engage/**'],
|
|
263
|
-
rules: {
|
|
264
|
-
camelcase: 'off'
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
files: ['**/*.mjs'],
|
|
269
|
-
rules: {
|
|
270
|
-
'@typescript-eslint/explicit-function-return-type': 'off'
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
];
|