Skip to content

Commit 6a70198

Browse files
author
GitHub Actions
committed
Merge branch 'main' into v1
2 parents 5951169 + d8f3e2c commit 6a70198

File tree

15 files changed

+2354
-1848
lines changed

15 files changed

+2354
-1848
lines changed

.eslintrc.cjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
module.exports = {
2+
env: {
3+
es2021: true,
4+
node: true,
5+
},
6+
extends: ['eslint:recommended', 'prettier'],
7+
overrides: [],
8+
parserOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module',
11+
},
12+
rules: {
13+
// overrides
14+
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
15+
16+
// important
17+
'no-shadow': 'error',
18+
19+
// possible errors
20+
eqeqeq: 'error',
21+
'no-constant-binary-expression': 'error',
22+
'no-duplicate-imports': 'error',
23+
'no-return-assign': 'error',
24+
'no-sequences': 'error',
25+
26+
// preference/style
27+
'no-else-return': 'error',
28+
'no-return-await': 'error',
29+
'no-var': 'error',
30+
'require-await': 'error',
31+
'spaced-comment': ['error', 'always'],
32+
33+
// not needed with typescript checking, copied from https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts
34+
// (this repo currently doesn't use typescript-eslint)
35+
'constructor-super': 'off', // ts(2335) & ts(2377)
36+
'getter-return': 'off', // ts(2378)
37+
'no-const-assign': 'off', // ts(2588)
38+
'no-dupe-args': 'off', // ts(2300)
39+
'no-dupe-class-members': 'off', // ts(2393) & ts(2300)
40+
'no-dupe-keys': 'off', // ts(1117)
41+
'no-func-assign': 'off', // ts(2539)
42+
'no-import-assign': 'off', // ts(2539) & ts(2540)
43+
'no-new-symbol': 'off', // ts(7009)
44+
'no-obj-calls': 'off', // ts(2349)
45+
'no-redeclare': 'off', // ts(2451)
46+
'no-setter-return': 'off', // ts(2408)
47+
'no-this-before-super': 'off', // ts(2376)
48+
'no-undef': 'off', // ts(2304)
49+
'no-unreachable': 'off', // ts(7027)
50+
'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358)
51+
'valid-typeof': 'off', // ts(2367)
52+
},
53+
};

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ecraig12345

.github/renovate.json5

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"github>microsoft/m365-renovate-config:automergeTypes",
54
"github>microsoft/m365-renovate-config:libraryRecommended",
6-
"github>microsoft/m365-renovate-config:keepFresh",
7-
"github>microsoft/m365-renovate-config:scheduleNoisy"
5+
"github>microsoft/m365-renovate-config:keepFresh"
86
],
97

108
"ignorePresets": [
@@ -18,16 +16,31 @@
1816

1917
"lockFileMaintenance": {
2018
"automerge": true,
21-
"platformAutomerge": true
19+
"platformAutomerge": true,
20+
"semanticCommitType": "build"
2221
},
2322

24-
"assignees": ["ecraig12345"],
23+
"pin": {
24+
"enabled": false
25+
},
26+
"rangeStrategy": "update-lockfile",
2527

2628
"packageRules": [
2729
{
2830
// Use "build" for all dep updates because they don't actually affect the configs
2931
"matchPackagePatterns": ["*"],
3032
"semanticCommitType": "build"
33+
},
34+
{
35+
// Group updates of all deps except Renovate.
36+
"groupName": "devDependencies",
37+
"matchPackagePatterns": ["*"],
38+
"matchUpdateTypes": ["minor", "patch"],
39+
"excludeDepNames": ["renovate"]
40+
},
41+
{
42+
"matchPackageNames": ["renovate"],
43+
"schedule": ["before 5am on the 8th and 22nd day of the month"]
3144
}
3245
]
3346
}

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
concurrency:
1111
group: ${{ github.ref }}-ci
12+
cancel-in-progress: true
1213

1314
jobs:
1415
ci:
@@ -26,6 +27,9 @@ jobs:
2627

2728
- run: yarn --frozen-lockfile
2829

30+
- name: Check formatting
31+
run: yarn format:check
32+
2933
- name: Type check scripts
3034
run: yarn build
3135

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,9 @@ Auto-merge minor and patch updates to `devDependencies` and lock file maintenanc
789789
"matchUpdateTypes": ["minor", "patch"],
790790
"automerge": true,
791791
"platformAutomerge": true,
792-
"stabilityDays": 2,
793792
"internalChecksFilter": "strict",
794-
"excludePackageNames": ["typescript"]
793+
"excludePackageNames": ["typescript"],
794+
"minimumReleaseAge": "2 days"
795795
}
796796
]
797797
}
@@ -948,10 +948,6 @@ Update "noisy" (frequently-updating) packages once every other week.
948948
```json
949949
{
950950
"packageRules": [
951-
{
952-
"matchPackageNames": ["renovate"],
953-
"schedule": ["before 5am on the 8th and 22nd day of the month"]
954-
},
955951
{
956952
"matchPackagePrefixes": ["@microsoft/api-extractor"],
957953
"schedule": ["before 5am on the 8th and 22nd day of the month"]

automergeDevLock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"matchUpdateTypes": ["minor", "patch"],
1515
"automerge": true,
1616
"platformAutomerge": true,
17-
"stabilityDays": 2,
1817
"internalChecksFilter": "strict",
19-
"excludePackageNames": ["typescript"]
18+
"excludePackageNames": ["typescript"],
19+
"minimumReleaseAge": "2 days"
2020
}
2121
]
2222
}

package.json

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
"url": "https://github.com/microsoft/m365-renovate-config.git"
99
},
1010
"scripts": {
11-
"build": "tsc -p jsconfig.json",
11+
"build": "tsc",
1212
"check-token": "node ./scripts/checkToken.js",
1313
"fix-repo-refs": "node ./scripts/fixRepoRefs.js",
1414
"format": "prettier --write .",
15-
"lint": "node ./scripts/lintPresets.js",
15+
"format:check": "prettier --check .",
16+
"lint": "eslint . && node ./scripts/lintPresets.js",
1617
"prepare": "husky install",
1718
"release": "HUSKY=0 semantic-release",
1819
"test:basic": "node ./scripts/testPresetsBasic.js",
@@ -21,20 +22,22 @@
2122
"update-refs": "node ./scripts/updateRefs.js"
2223
},
2324
"devDependencies": {
24-
"@commitlint/cli": "17.4.4",
25-
"@semantic-release/changelog": "6.0.2",
26-
"@semantic-release/exec": "6.0.3",
27-
"@semantic-release/git": "10.0.1",
28-
"@types/jju": "1.4.2",
29-
"@types/node": "18.15.0",
30-
"conventional-changelog-conventionalcommits": "5.0.0",
31-
"execa": "7.0.0",
32-
"husky": "8.0.3",
33-
"jju": "1.4.0",
34-
"prettier": "2.8.4",
35-
"renovate": "34.154.1",
36-
"semantic-release": "19.0.5",
37-
"typescript": "4.9.5"
25+
"@commitlint/cli": "^17.5.1",
26+
"@semantic-release/changelog": "^6.0.3",
27+
"@semantic-release/exec": "^6.0.3",
28+
"@semantic-release/git": "^10.0.1",
29+
"@types/jju": "^1.4.2",
30+
"@types/node": "^18.15.11",
31+
"conventional-changelog-conventionalcommits": "^5.0.0",
32+
"eslint": "^8.36.0",
33+
"eslint-config-prettier": "^8.8.0",
34+
"execa": "^7.1.1",
35+
"husky": "^8.0.3",
36+
"jju": "^1.4.0",
37+
"prettier": "^2.8.7",
38+
"renovate": "35.46.0",
39+
"semantic-release": "^21.0.1",
40+
"typescript": "^5.0.3"
3841
},
3942
"release": {
4043
"branches": [

scheduleNoisy.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"description": "Update \"noisy\" (frequently-updating) packages once every other week.",
55

66
"packageRules": [
7-
{
8-
"matchPackageNames": ["renovate"],
9-
"schedule": ["before 5am on the 8th and 22nd day of the month"]
10-
},
117
{
128
"matchPackagePrefixes": ["@microsoft/api-extractor"],
139
"schedule": ["before 5am on the 8th and 22nd day of the month"]

scripts/lintPresets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const requiredAttributes = {
88

99
const presets = readPresets();
1010

11-
for (const { name, filename, json } of presets) {
11+
for (const { name: presetName, filename, json } of presets) {
1212
const logIssue = (message) => {
13-
logError(`${name}: ${message}`, filename);
13+
logError(`${presetName}: ${message}`, filename);
1414
process.exitCode = 1;
1515
};
1616

scripts/testPresetsBasic.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ async function checkPreset(preset, hasInvalidRepoConfig) {
112112
filename
113113
);
114114
return 'unknown';
115-
} else {
116-
logError(`Unknown error validating ${filename}. See logs for details.`, filename);
117-
return 'error';
118115
}
116+
117+
logError(`Unknown error validating ${filename}. See logs for details.`, filename);
118+
return 'error';
119119
}
120120

121121
if (migratedConfig || newConfig) {
@@ -140,26 +140,24 @@ function migrateConfig(preset, migratedConfig) {
140140

141141
// Update the file if running locally or this is the repo config (to prevent others from failing).
142142
// There's no point in updating other configs in CI since they can't be committed.
143-
let shouldUpdate = !isGithub || filename === repoRenovateConfigPath;
143+
const isRepoConfig = filename === repoRenovateConfigPath;
144144
let result = /** @type {Result} */ ('ok');
145145

146146
if (isGithub) {
147147
result = 'error';
148148
// Log errors for CI
149-
let error = `❌ ${filename} requires migration.\n`;
150-
if (shouldUpdate) {
151-
error +=
152-
'This migration will be run locally in CI so that the other presets ' +
153-
'can be validated, but you must update this config ';
154-
} else {
155-
error += 'You must update this config ';
156-
}
157-
(error += 'by either running this test locally or manually copying the following content.'),
158-
logError(error, filename);
149+
logError(
150+
`❌ ${filename} requires migration.\n` +
151+
(isRepoConfig
152+
? 'This will be done locally in CI so the other presets can be validated, but you '
153+
: 'You ') +
154+
'must update this config by either running this test locally or manually copying the following content.',
155+
filename
156+
);
159157
console.log(migratedContent);
160158
}
161159

162-
if (shouldUpdate) {
160+
if (!isGithub || isRepoConfig) {
163161
// Actually update and format the file
164162
console.log(`Migrating ${filename} (see git diff for details)`);
165163
fs.writeFileSync(absolutePath, migratedContent);

0 commit comments

Comments
 (0)