Skip to content

Commit 7af12c0

Browse files
authored
Clean up dev dependencies and migrate ESLint config (#19206)
Clean up unused dev dependencies, migrate ESLint config to native flat config, and fix npm audit vulnerabilities.%0A%0ARemoved unused devDependencies: @types/mocha, css-loader, style-loader, ncp.%0A%0AMigrated eslint.config.mjs from FlatCompat to native ESLint 9 flat config. Replaced @typescript-eslint/eslint-plugin + @typescript-eslint/parser with unified typescript-eslint package. Removed @eslint/eslintrc.%0A%0ABumped copy-webpack-plugin to 14.0.0 and terser-webpack-plugin to 5.3.17 to fix serialize-javascript vulnerability (GHSA-5c6j-r48x-rmvq). ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/19206)
1 parent 20b991e commit 7af12c0

File tree

6 files changed

+2196
-2695
lines changed

6 files changed

+2196
-2695
lines changed

src/vscode-bicep/eslint.config.mjs

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,50 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import notice from "eslint-plugin-notice";
5-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
6-
import tsParser from "@typescript-eslint/parser";
7-
import path from "node:path";
8-
import { fileURLToPath } from "node:url";
94
import js from "@eslint/js";
10-
import { FlatCompat } from "@eslint/eslintrc";
11-
12-
const __filename = fileURLToPath(import.meta.url);
13-
const __dirname = path.dirname(__filename);
14-
const compat = new FlatCompat({
15-
baseDirectory: __dirname,
16-
recommendedConfig: js.configs.recommended,
17-
allConfig: js.configs.all
18-
});
5+
import jest from "eslint-plugin-jest";
6+
import notice from "eslint-plugin-notice";
7+
import react from "eslint-plugin-react";
8+
import tseslint from "typescript-eslint";
199

20-
export default [{
21-
ignores: [
22-
"out/**/*",
23-
"**/.eslintrc.cjs",
24-
"**/webpack.config.ts",
25-
"**/jest.config.*.js",
26-
],
27-
}, ...compat.extends(
28-
"eslint:recommended",
29-
"plugin:@typescript-eslint/recommended",
30-
"plugin:react/recommended",
31-
"plugin:react/jsx-runtime",
32-
"plugin:jest/recommended",
33-
"plugin:jest/style",
34-
), {
35-
files: ["**/*.ts", "**/*.tsx"],
36-
37-
plugins: {
38-
notice,
39-
"@typescript-eslint": typescriptEslint,
10+
export default tseslint.config(
11+
{
12+
ignores: [
13+
"out/**/*",
14+
"**/.eslintrc.cjs",
15+
"**/webpack.config.ts",
16+
"**/jest.config.*.js",
17+
],
4018
},
19+
js.configs.recommended,
20+
...tseslint.configs.recommended,
21+
{
22+
...react.configs.flat.recommended,
23+
settings: { react: { version: "detect" } },
24+
},
25+
react.configs.flat["jsx-runtime"],
26+
jest.configs["flat/recommended"],
27+
jest.configs["flat/style"],
28+
{
29+
files: ["**/*.ts", "**/*.tsx"],
4130

42-
languageOptions: {
43-
parser: tsParser,
44-
ecmaVersion: 5,
45-
sourceType: "script",
46-
47-
parserOptions: {
48-
project: true,
31+
plugins: {
32+
notice,
4933
},
50-
},
5134

52-
rules: {
53-
"notice/notice": [
54-
2,
55-
{
56-
"templateFile": "../copyright-template.js",
57-
}
58-
]
59-
},
35+
languageOptions: {
36+
parserOptions: {
37+
project: true,
38+
},
39+
},
6040

61-
settings: {
62-
react: {
63-
version: "detect",
41+
rules: {
42+
"notice/notice": [
43+
2,
44+
{
45+
templateFile: "../copyright-template.js",
46+
},
47+
],
6448
},
6549
},
66-
}];
50+
);

0 commit comments

Comments
 (0)