Skip to content

Commit c337560

Browse files
Upgrade dependencies for highlighting libs + playground (#19636)
###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/19636)
1 parent d5c6b33 commit c337560

14 files changed

Lines changed: 2963 additions & 4801 deletions

src/highlightjs/eslint.config.mjs

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,9 @@
55
import eslint from "@eslint/js";
66
import tseslint from "typescript-eslint";
77
import pluginJest from 'eslint-plugin-jest';
8+
import headers from "eslint-plugin-headers";
89
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
910

10-
const copyrightHeader = "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.";
11-
12-
/** @type {import('eslint').Rule.RuleModule} */
13-
const copyrightNoticeRule = {
14-
meta: {
15-
type: "suggestion",
16-
fixable: "code",
17-
messages: {
18-
missingCopyright: "File must start with the Microsoft copyright header.",
19-
},
20-
},
21-
create(context) {
22-
return {
23-
Program(node) {
24-
const sourceCode = context.sourceCode;
25-
const text = sourceCode.getText();
26-
if (!text.startsWith(copyrightHeader)) {
27-
context.report({
28-
node,
29-
messageId: "missingCopyright",
30-
fix(fixer) {
31-
return fixer.insertTextBefore(node, copyrightHeader + "\n\n");
32-
},
33-
});
34-
}
35-
},
36-
};
37-
},
38-
};
39-
4011
export default tseslint.config({
4112
files: ["src/**/*.ts", "test/**/*.ts", "test-live/**/*.ts"],
4213
extends: [
@@ -48,12 +19,15 @@ export default tseslint.config({
4819
languageOptions: {
4920
ecmaVersion: 2020,
5021
},
51-
plugins: {
52-
"copyright": {
53-
rules: { notice: copyrightNoticeRule },
54-
},
55-
},
22+
plugins: { headers },
5623
rules: {
57-
"copyright/notice": "error",
24+
"headers/header-format": [
25+
"error",
26+
{
27+
source: "string",
28+
style: "line",
29+
content: "Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.",
30+
},
31+
],
5832
},
5933
});

src/highlightjs/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
"js"
88
],
99
transform: {
10-
'^.+\\.(ts|tsx)$': 'ts-jest'
10+
'^.+\\.(ts|tsx)$': '@swc/jest'
1111
},
1212
testMatch: [
1313
'**/test/**/*.test.(ts)'

0 commit comments

Comments
 (0)